markoc
Posts: 11
Joined: Fri May 28, 2021 9:22 am

Path of persisted registry values

Tue Nov 23, 2021 2:18 pm

Hi everyone,

We have an installer solution in which we use persisted parameters to be able to use them in repair and upgrade actions. We would like to programmatically acquire the path of those registry keys in order to be able to manipulate them in some custom actions, most likely Powershell inline ones.

Is there a way to achieve this?

Kind regards,
Marko

Catalin
Posts: 4527
Joined: Wed Jun 13, 2018 7:49 am

Re: Path of persisted registry values

Tue Nov 23, 2021 4:58 pm

Hello Marko,

You can find the registry entries for the persistent properties under the following node (for a 32-bit, per-machine installation)

HKLM:\SOFTWARE\WOW6432Node\[Manufacturer]\[UpgradeCode]


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

markoc
Posts: 11
Joined: Fri May 28, 2021 9:22 am

Re: Path of persisted registry values

Wed Nov 24, 2021 10:28 am

Hi Catalin,

Thank you for the fast answer but I do have some follow-up questions.

What about 64-bit machines? Does the path change then?
Also, will the path stay the same for different versions of Windows OS (e.g. Windows 8/10/11, Windows Server 2012/2016/2019/2022)?

And my last question: how can I use the [Manufacturer] and [UpgradeCode] properties inside of a inline Powershell script custom action? Just by using the AI_GetMsiProperty Manufacturer/AI_GetMsiProperty UpgradeCode calls?

Kind regards,
Marko

Catalin
Posts: 4527
Joined: Wed Jun 13, 2018 7:49 am

Re: Path of persisted registry values

Wed Nov 24, 2021 12:04 pm

Hello Marko,
Also, will the path stay the same for different versions of Windows OS (e.g. Windows 8/10/11, Windows Server 2012/2016/2019/2022)?
The path is not dependant on the OS, it should be the same on all OSs.
And my last question: how can I use the [Manufacturer] and [UpgradeCode] properties inside of a inline Powershell script custom action? Just by using the AI_GetMsiProperty Manufacturer/AI_GetMsiProperty UpgradeCode calls?
Yes, you can do that through the AI_GetMsiProperty cmdlet. For instance, you can take the value of the property and save it in a variable, e.g.:

Code: Select all

$var = AI_GetMsiProperty YOUR_PROPERTY
What about 64-bit machines? Does the path change then?
Please note that I acutally referred to the 64-bit machines in my previous post.

On a 64-bit machine, a 32-bit process (like our installation) will redirect its registry entries under the WOW6432Node. This is the default behavior of the OS.

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

markoc
Posts: 11
Joined: Fri May 28, 2021 9:22 am

Re: Path of persisted registry values

Wed Nov 24, 2021 1:01 pm

Hi Catalin,

Thanks again for your quick reply.
Please note that I acutally referred to the 64-bit machines in my previous post.

On a 64-bit machine, a 32-bit process (like our installation) will redirect its registry entries under the WOW6432Node. This is the default behavior of the OS.
Then, just to be on the safe side here, will the installation redirect its registry entries under the WOW6432Node even when it's run on a 32-bit machine?

Kind regards,
Marko

Catalin
Posts: 4527
Joined: Wed Jun 13, 2018 7:49 am

Re: Path of persisted registry values

Thu Nov 25, 2021 9:15 am

Hello Marko,

Please note that the WOW6432Node does not exist on a 32-bit machine.

It only exists on a 64-bit machine and its purpose is to basically differentiate between 32-bit and 64-bit apps.

You can read more about it in the following article:

Wow6432Node Registry Key

Registry Redirector

While looking for the above articles, I have also found this one which you might find useful:

Registry key WOW6432Node may be listed in system registry in 32 bit (x86) version of Windows 7

The above looks to be a bug in Windows 7 that led to the node being present on 32-bit machine as well. Normally, it should not.

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

Return to “Building Installers”