This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Saving [INSTALLDIR] in registry
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 01, 2016
07:19 AM
Saving [INSTALLDIR] in registry
Hi all.
Sorry if this is a very noobish question, but I'm new to this.
Anyway, I'm trying to save and load the last Installdir to/from the registry.
So I made an entry in the registry like: HKLM->Software->[company name]->[InstallDir] and added a string key: Name=InstallPath, Data=[INSTALLDIR].
When I install the program for the first time, the selected installdir is saved correctly into this registry key. On subsequent installs, the key does not change, even if I select another install folder. Even worse, even if i select another install folder, the program is always installed to the folder I selected on the very first install.
So I must be missing something obvious, but what?
In the InstallScript we have a function like this
//*********//
function SetDefaultInstallDir(hMSI)
string defaultInstallDir,value;
number buffer;
begin
defaultInstallDir = PROGRAMFILES + "UniLock 2.0\\\\";
MsiSetProperty(ISMSI_HANDLE, "DEFAULTINSTALLDIR", defaultInstallDir);
end;
//*********//
I'm not sure, if we added this, or it's a standard thing.
It's activated on "Install UI Sequence" -> "After MigrateFeatureStates".
Any help very appreciated.
Sincerely
Bjarne Nielsen
Sorry if this is a very noobish question, but I'm new to this.
Anyway, I'm trying to save and load the last Installdir to/from the registry.
So I made an entry in the registry like: HKLM->Software->[company name]->[InstallDir] and added a string key: Name=InstallPath, Data=[INSTALLDIR].
When I install the program for the first time, the selected installdir is saved correctly into this registry key. On subsequent installs, the key does not change, even if I select another install folder. Even worse, even if i select another install folder, the program is always installed to the folder I selected on the very first install.
So I must be missing something obvious, but what?
In the InstallScript we have a function like this
//*********//
function SetDefaultInstallDir(hMSI)
string defaultInstallDir,value;
number buffer;
begin
defaultInstallDir = PROGRAMFILES + "UniLock 2.0\\\\";
MsiSetProperty(ISMSI_HANDLE, "DEFAULTINSTALLDIR", defaultInstallDir);
end;
//*********//
I'm not sure, if we added this, or it's a standard thing.
It's activated on "Install UI Sequence" -> "After MigrateFeatureStates".
Any help very appreciated.
Sincerely
Bjarne Nielsen
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 28, 2016
07:55 AM
You can use RegDBsetKeyValueEx function to update registry entries.
Modify your code to pass your INSTALLDIR to this function during each install.
You can get more details about RegDBsetKeyValueEx function in installshield help
regards,
Pratik
Modify your code to pass your INSTALLDIR to this function during each install.
You can get more details about RegDBsetKeyValueEx function in installshield help
regards,
Pratik