I am doing some prototyping with application packages and have created a simple example (by hand) with an Install, Configure and Uninstall script.
Uploading, installing and uninstalling via the SLNet Test Client works correctly, however the Configure button is greyed out.
I have tested the following so far:
- Stripped down the Configure script to the minimum (it now only contains the Entrypoint function with an information event message)
- Added a <Configuration> entry to the AppInfo.xml as seen in this article
- Removed all references to third party libraries
I am running DM 10.1.0.0-9966. I was also looking at the example scripts in the Companion Files archive, but they are not working out of the box (I assume due to some changes in the namespace hierarchies). Are there more recent examples I can use for reference?
Hi Tobias,
The 'configure' button should be enabled in client test tool when the app package was correctly installed, has a config script, and at least one configuration entry in the AppInfo.xml. Can you double-check the following things?
- The 'Configuration' tag in the AppInfo should contain at least one entry. I have verified the AppInfo.xml at the bottom of this answer works on DM10.2.12, and should work on earlier DM versions as well. The important bit is everything between the 'Configuration' tag.
- Make sure the install status of the DMApp is marked as 'Installed' in the installed packages tab of the App Packages window in client test tool.
- Make sure the Config.xml file is contained in the .dmapp. If you unzip the .dmapp it should be in the Scripts folder, and should have the name 'Config.xml'
- If all this looks ok, it might be a good idea to check the the installed app info. See below for some example code you can use in an automation script. The 'Configuration' of the installed app should not be null, and there should at least be one configuration entry:
The script to check the installed apps:
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.AppPackages;namespace CheckInstalledApps
{
public class Script
{
public void Run(Engine engine)
{
var helper = new AppPackageHelper(engine.SendSLNetMessage);
var installedApps = helper.GetInstalledApps();engine.GenerateInformation($"Got {installedApps.Count} installed apps");
foreach (var installedAppInfo in installedApps)
{
if (installedAppInfo.AppInfo?.Configuration == null)
{
engine.GenerateInformation($"App {installedAppInfo.AppInfo.Name} ({installedAppInfo.AppInfo.Version}): no configuration defined");
continue;
}
else
{
engine.GenerateInformation($"App{installedAppInfo.AppInfo.Name} ({installedAppInfo.AppInfo.Version}): {installedAppInfo.AppInfo?.Configuration?.Entries?.Count} entries in the configuration");
}
}
}
}
}
The example AppInfo.xml:
<AppInfo>
<Name>RT_APP_PACKAGES_Configuration</Name>
<DisplayName>This is an example package</DisplayName>
<Version>1.0.0</Version>
<Description>This is an example package for RT purposes</Description>
<LastModifiedAt>2020-05-07T09:15:05</LastModifiedAt>
<MinDmaVersion>10.0.7</MinDmaVersion>
<AllowMultipleInstalledVersions>true</AllowMultipleInstalledVersions>
<Configuration>
<Entries>
<Entry>
<ID>ExampleEntry</ID>
<Name>Example Name</Name>
</Entry>
</Entries>
</Configuration>
</AppInfo>
Dear Seppe,
Thank you for you detailed response.
In the end, I figured out myself what the problem was: I had thought that the configuration entries are entirely optional (as written in one of the text references), however it seems that at least the outer or nodes have to exist before the AppInfo.xml is valid against the schema. After adding some configuration parameters, I was then able to run the script.
Another question on the topic: Do you plan to extend the functionality of the parameters to be more than strings? Using a drop-down menu with fixed values would simplify the data validation.
As this question has been inactive for a long time, we will now close it. If you want further information, could you post a new question?