PetrB
Posts: 4
Joined: Wed Jul 02, 2025 11:38 am

Property is not passed to "Install" stage

Hello,

I have quite an urgent issues on my Advanced Installer (22.8) Enterprise version.

I have made a custom action DLL (using the Advanced Installer project in Visual Studio), so I can send data between custom actions and installer.

I have a few properties, which I parse from a config file and send to the installer before "Install" stage. During debugging I confirmed, the properties have values I expect them to have.

Here comes the problem. One of those properties has its value removed (set to empty - that is the default) at the start of the "Install" stage and when I send it to another custom action (deffered), its not there. This is not a problem of just one AI project. I have another project which does the exact same thing.

I though there was a problem with passing properties and its values to the install stage, but when I run the installer.exe in command line and set the property there, its successfully passed to the install stage.

I don't know if its important, but I test it during a major upgrade (first time install) -> I have a product installed, so its first uninstalled, so maybe there is a problem?

Attached are my properties (the property in question is "VENDOR")

Here is the code I use to set the properties (I have checked and they should be set - I even tried to show a message box in AI after the custom action and the value is there in the UI stage)

Code: Select all

public static int GetClientAppSettings(string aMsiHandle)
{
    var session = new MsiSession(aMsiHandle);

    try
    {
        var appdir = session.GetProperty(PropertyName.AppDir);
        if (!Directory.Exists(appdir))
            throw new DirectoryNotFoundException("Install folder does not exists!");

        var settingWrapper = new ClientAppSettingsWrapper();

        extractClient(appdir, settingWrapper);

        // Set properties back to AI
        // If a property is set through command line, do not override it
        var existingAppServer = session.GetProperty(PropertyName.AppServerName);
        if (existingAppServer == DefaultValues.NetworkAppServerName)
            session.SetProperty(PropertyName.AppServerName, settingWrapper.AppServerHost);

        var existingAppPort = session.GetProperty(PropertyName.AppServerPort);
        if (existingAppPort == DefaultValues.AppServerPort)
            session.SetProperty(PropertyName.AppServerPort, settingWrapper.AppServerPort);
        
        var existingVendor = session.GetProperty(PropertyName.Vendor);
        if (existingVendor == DefaultValues.Vendor)
            session.SetProperty(PropertyName.Vendor, settingWrapper.Vendor);
            
        var existingClientLanguage = session.GetProperty(PropertyName.Language);
        if (existingClientLanguage == DefaultValues.ClientLanguage)
            session.SetProperty(PropertyName.Language, settingWrapper.Language);
            
        var existingHeartbeat = session.GetProperty(PropertyName.HeartbeatNotificationDelay);
        if (existingHeartbeat == DefaultValues.HeartbeatNotificationDelay)
            session.SetProperty(PropertyName.HeartbeatNotificationDelay, settingWrapper.HeartbeatNotification);

        return (int)ExitCode.Success;
    }
    catch (Exception ex)
    {
        // log
        return (int)ExitCode.Error;
    }
}
Best Regards
PetrB
Attachments
properties.png
properties.png (19.62 KiB) Viewed 64 times

Return to “Common Problems”