- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to change the value of INSTALLDIR at runtime?
- 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
How to change the value of INSTALLDIR at runtime?
We have a Basic MSI project which needs to copy its files to a location which differs at runtime.
I have tried setting INSTALLDIR's value at runtime with a Custom Action. This works in the debugger, but not if the MSI file is moved to another folder and run from there, outside of the debugger.
Is there a specific event at which point INSTALLDIR can be programmatically set?
The code we are using is as follows
function AfterXXX(hMSI)
// To Do: Declare local variables.
STRING szMsg;
NUMBER nResult;
begin
if (!SetXXXFolders()) then
szMsg = "Unable to retrieve XXX install path. The installation will not continue.";
MessageBox(szMsg, SEVERE);
return ERROR_INSTALL_FAILURE;
endif;
// Change the value of INSTALLDIR
INSTALLDIR = szPrograms;
return ERROR_SUCCESS;
end;