xtrophic2
Posts: 5
Joined: Thu Jan 30, 2025 11:37 am

Parameters not getting passed properly to prerequisites (in /qn mode)

Installer is working perfect when running with full GUI but when running silent properties are not set correctly.

There are pre-requisites that are depending on properties being set. They are set by a powershell script / custom action C# implementation. All other aspects of the install seem to use the properties properly except the installation of prerequisites.

Not even APPDIR is set. So what am I doing wrong?

How the install looks for the Erlang prereq:
Screenshot_48.png
Screenshot_48.png (30.94 KiB) Viewed 15281 times
How it's installed when using the /qn:
Screenshot_49.png
Screenshot_49.png (21.72 KiB) Viewed 15281 times

The rest of the files (part of the actual application) end up in C:\Program Files\<CompanyName>\<AppName>, so it seems some parts of the installer honor the correct settings, others don't.

Looking in the log file it also looks like the properties are set early on:

Code: Select all

MSI (s) (2C:68) [08:40:32:426]: Doing action: SET_APPDIR
Action ended 08:40:32: ValidateProductID. Return value 1.
MSI (s) (2C:68) [08:40:32:428]: PROPERTY CHANGE: Adding APPDIR property. Its value is 'C:\Program Files\<Company>\<Product>'.
Action start 08:40:32: SET_APPDIR.


MSI (s) (2C!70) [08:40:32:402]: PROPERTY CHANGE: Modifying SQL_INSTALL_CONNECTIONSTRING property. Its current value is '**********'. Its new value: '**********'.
Ruddox SetupHelper - SQL_SERVER_DATABASE = ********
MSI (s) (2C!70) [08:40:32:402]: PROPERTY CHANGE: Modifying SQL_SERVER_PASSWORD property. Its current value is '**********'. Its new value: '**********'.
****** SetupHelper - SQL_INSTALL_CONNECTIONSTRING = *********
****** SetupHelper - SQL_SERVER_PASSWORD = *********
I also see these lines before the prereqs are installed. It seems a bit suspicious, but I can't see where it's used in the installer:

Code: Select all

MSI (c) (90:04) [08:52:01:279]: Doing action: AI_RestoreInstallerProps
Action start 08:52:01: AI_RestoreInstallerProps.
MSI (c) (90:20) [08:52:01:530]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\2\MSIA78B.tmp, Entrypoint: RestoreInstallerProps
Action ended 08:52:01: AI_RestoreInstallerProps. Return value 1.
Any insight on how to resolve this would be appreciated.
xtrophic2
Posts: 5
Joined: Thu Jan 30, 2025 11:37 am

Re: Parameters not getting passed properly to prerequisites (in /qn mode)

Attaching a simple installer project that shows this behaviour when using /qn to install it.
Attachments
Prereq Test.zip
(4.82 KiB) Downloaded 100 times
Eusebiu
Posts: 4964
Joined: Wed Nov 14, 2012 2:04 pm

Re: Parameters not getting passed properly to prerequisites (in /qn mode)

Hi,

Thank you for the test project.

Please keep in mind that this happens because the "APPDIR" property is not set to any value at the moment the prerequisite is launched during a silent installation.

During a Full UI installation, the APPDIR property is set on the Dialogs stage and the prerequisite is launched at the end of that stage, but during a silent installation, the prerequisite is launched by the EXE Bootstrapper before the "APPDIR" property to be set.

The "APPDIR" property is set during the "Execute Sequence > Paths Resolution" action group from the "Custom Actions" page during a silent installation, but the prerequisite is launched before the "Execute Sequence" phase. The "UI Sequence" phase is skipped during a silent installation.

In order to avoid this, you can set the "APPDIR" property through command line when you install the main package silently. For example:
  • mainPackage.exe /qn APPDIR="C:\Program Files\My Product"
Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”