Page 1 of 1

Registry read InstallLocation

Posted: Tue Feb 23, 2021 10:35 am
by Jenny
Hi all,

We need to read the InstallLocation of main software to be able to install additional features.
I tried this command
Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3FFEDCC8-20DB-4361-8E21-68DB28A81539}\InstallLocation into INSTALL_LOCATION

But result is always empty.
Is there an other solution for detecting installation directory of a software.

Thanks for your help
Best regards

Re: Registry read InstallLocation

Posted: Tue Feb 23, 2021 12:25 pm
by FrancescoT
Did you check "manually" if this exists?
Are you querying the reg-key of a x64 target OS?

Re: Registry read InstallLocation

Posted: Tue Feb 23, 2021 4:46 pm
by Jenny
Hi thanks for your answer,

It exists manually.
It is a x64 system and I tried
Read Registry Key HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\product name\InstallLocation into INSTALL_LOCATION
which works.

Thanks for your help.
Best regards

Re: Registry read InstallLocation

Posted: Wed Feb 24, 2021 6:45 am
by FrancescoT
I would recommend you to not use such approach. Because this may compromise the default registry key redirection operated by the target operating system.

By default, the setup engine runs in 32 bit mode (if not forced to 64 bit explicitly via “Set 64 Bit mode”).

Consequently, any script command used to query a “know System Folder” or to query/manuìpulate a "Registry Key", due native OS redirection, this will return the respective x86 or x64 system path, depending on the currently active "processor architecture" defined with the script.

https://www.installaware.com/forums/viewtopic.php?f=2&t=10813

Hope this helps you.