Storing the installation path in the registry

173 views
Skip to first unread message

Paul Gardiner

unread,
Aug 18, 2023, 6:43:07 AM8/18/23
to innosetup
I want to have my installer store the installation path in the registry, so that installers of add-ons can find where to put their payload. I've read about all sorts of problems with doing this on stack overflow, with answers I don't understand. My guess is that I should handle differently the two cases of installation for all users and installation for just the logged on user: store in HKLM if installing for all users and HKCU if for just the current user (Add-on installers could look for both, preferring HKCU if found). Would that work? What's the best way to handle this task?

Otomatic

unread,
Aug 19, 2023, 3:51:54 AM8/19/23
to innosetup
Hi,
In the Help, see Uninstallable and CreateUninstallRegKey
If you haven't used these two directives in the [Setup] section, the installation path is created in the Registry, because by default, these two directives are set to Yes.
Suppose in [Setup] AppId={{my_application}
But depending on whether you're dealing with a 32-bit application on a 32-bit Windows or a 64-bit Windows, the Registry values are different.

- 32 bits application (of course) on Windows 32 bits
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{my_application}_is1
InstallLocation = "path"

- 32bits application on Windows 64 bits
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{my_application}_is1
InstallLocation = "path"

- 64 bits application on Windows 64 bits
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{my_application}_is1'
InstallLocation = "path"

Widmer

unread,
Aug 19, 2023, 10:15:41 AM8/19/23
to 'Paul Gardiner' via innosetup

What I did:

- have for your SW product a HKLM as main installation entry

- have there a common string entry as HKLM or HKCU

- set this on first installation ONLY, as select-able form your installer GUI as Common (HKLM) or as Private (HKCU) string.
  And only shown if this string is not set otherwise hide this page.

- then, all Installer and App parts has to read the Common value and acts ...

Hp


On 18-Aug-23 11:43, 'Paul Gardiner' via innosetup wrote:
I want to have my installer store the installation path in the registry, so that installers of add-ons can find where to put their payload. I've read about all sorts of problems with doing this on stack overflow, with answers I don't understand. My guess is that I should handle differently the two cases of installation for all users and installation for just the logged on user: store in HKLM if installing for all users and HKCU if for just the current user (Add-on installers could look for both, preferring HKCU if found). Would that work? What's the best way to handle this task?
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/45cdda8d-27b5-4433-ae18-2ba91252555cn%40googlegroups.com.

Paul Gardiner

unread,
Aug 20, 2023, 5:10:58 AM8/20/23
to innosetup
Thank you both. That's very useful information. I thin I have a way forward now.
Reply all
Reply to author
Forward
0 new messages