We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

PetrB
Posts: 6
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 3180 times
PetrB
Posts: 6
Joined: Wed Jul 02, 2025 11:38 am

Re: Property is not passed to "Install" stage

For information, the problem is no longer urgent.

I managed to fix my case, by saving the properties to a file and then loading it when I need it.

Meaning, the properties no longer "travel" through the installer, but are saved on a disk.

-------------------------
The problem still persists, but I don't need a solution for the time being.

I also managed to find another property called "DOMAIN_NAME" (default empty) in a different aip project, that does the same as the "VENDOR".

Here is the order of actions I do to set/load the property.

1) I have a (immediate) custom action (the one in previous comment) that sets a property value after UI Senquences - MigrateFeatureStates
2) Just before Execute Sequences - Install Service is another (deffered) custom action, that gets the property and writes in in a file (but the value is no longer there)

Meaning somewhere between these two sequences, the value of the property is lost. (I used a MessageBox to show the property after it is set and it managed to correctly show the value I expected.)

Best Regards
PetrB
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Property is not passed to "Install" stage

Hello PetrB,

Thank you for your followup on this.

I am glad to hear that you managed to have this fixed yourself.

Also, thank your for sharing the solution with us - I am sure this will be of help for further users facing a similar scenario.

Regarding this specific issue, I have tried following this test-case:
1) I have a (immediate) custom action (the one in previous comment) that sets a property value after UI Senquences - MigrateFeatureStates
2) Just before Execute Sequences - Install Service is another (deffered) custom action, that gets the property and writes in in a file (but the value is no longer there)
but I'm afraid I am not able to reproduce this on my end.

If possible, in order for me to further test and investigate this on our end, could you please try to create a minimal sample project that reproduces this and forward it to me via email at support at advancedinstaller dot com?

The project should only contain the required resources - for example, if you are using a custom DLL, send that so I can build the AIP file on my end. Preferably, it would be great if you could replace the custom DLL with an inline script, for example, so I can have access to the source code of the custom action.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
PetrB
Posts: 6
Joined: Wed Jul 02, 2025 11:38 am

Re: Property is not passed to "Install" stage

Hello,

I thought you would not be able to easily replicate the issues. That was the reason I fixed it in a diffrent way.

Unfortunately, I don't have time to create a sample project, for an issue that is quite hard to replicate, since I will be in a crunch time for a few months at the very least.

Best regards
PetrB
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Property is not passed to "Install" stage

Hello Petr,

Thank you for your followup on this.
Unfortunately, I don't have time to create a sample project, for an issue that is quite hard to replicate, since I will be in a crunch time for a few months at the very least.
That is alright. If you have time in the future and want to revisit this, please do not hesitate to re-open this thread.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”