Raptor039
Posts: 4
Joined: Mon Dec 09, 2024 9:18 pm

Set a registry key property value base on a MSI property dynamically generated

Hi,

I repackaged a Java app to distribute at large scale. During the setup, I need to generate an arbitrary GUID and set this GUID inside a registry key property value :
Image

The installer need to be executed in silent mode, because it's deployed through SCCM.

I tried to do this with an inline powershell script CA by using AI_SetMsiProperty like explain here but it didn't work.

How can I achieve this action ? As a warkaround I can define a public property at installation with msiexec but I really would like that this action reside inside the installer.

Thanks for your help.
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Set a registry key property value base on a MSI property dynamically generated

Hello and welcome to our forums,

Please note that we have predefined custom action to set a property, if you do not want to set it via command line.

Set Installer Property

Using this custom action, you can set HIN_GUID to what value you need.

Additionally, it should also work with PowerShell, could you please give me some more details here so I can try to assist you? How have you set the property? Can you provide the code and also a screenshot of the custom action configuration?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Raptor039
Posts: 4
Joined: Mon Dec 09, 2024 9:18 pm

Re: Set a registry key property value base on a MSI property dynamically generated

Hi @Catalin !

Thanks for your answer.

Concerned the CA Set Installer Property, is it possible value could be generated as an arbitrary string when installer ran ?

Concerned the powershell CA, please find attached a screen of my setting as asked.

Have a good evening.
Attachments
AI_01.jpg
AI_01.jpg (256.48 KiB) Viewed 15706 times
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Set a registry key property value base on a MSI property dynamically generated

Hello,
Concerned the CA Set Installer Property, is it possible value could be generated as an arbitrary string when installer ran ?
Unfortunately not.

Regarding the PowerShell script, I'm not quite sure what's wrong there.

Everything seems to be working as expected and the HIN_GUID property is set?

Am I missing something here? :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Raptor039
Posts: 4
Joined: Mon Dec 09, 2024 9:18 pm

Re: Set a registry key property value base on a MSI property dynamically generated

All seems to be OK but unfortunately, when the installer run, the registry key property value wich link to the HIN_GUID property is left blanck instead of beeing popuplate by the value generated by the Powershell CA.

I also tried to initialize the HIN_GUID property to 0 in the property view of Advanced Installer. This "0" is not updated by the powershell CA and setted to the registry key property as is.
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Set a registry key property value base on a MSI property dynamically generated

Hello,

This is indeed really strange.

if possible, could you please forward me a copy of your Advanced Installer Project file (AIP) by email at support at advancedinstaller dot com so I can investigate its' settings?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Raptor039
Posts: 4
Joined: Mon Dec 09, 2024 9:18 pm

Re: Set a registry key property value base on a MSI property dynamically generated

Hi @Catelin,

sure, email just has been sent to you.

Thanks for your help.

Have a nice day.
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Set a registry key property value base on a MSI property dynamically generated

Hello Jean,

This might be happening because you are setting the property quite late in the sequence.

Could you please try the following:

- go to "Custom Actions" page

- select your custom action --> right click on it --> Move After --> Execute Sequences --> "Path Resolution" --> "LaunchConditions"

Could you please try that and let me know if it helps?

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

Return to “Building Installers”