- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to modify Path Variables in MSI
- 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 modify Path Variables in MSI
Hi,
I shall convert InstallAware scripting into true MSI tables. (Not just InstallScript.)
To determine the installation folder there is a script logic like
if Setup_Parameter_platform = 2 (
Set TARGETDIR to RegKey2
if TARGETDIR ="" (
Set TARGETDIR to RegKey1
if TARGETDIR ="" (
Set TARGETDIR to RegKey1b
if TARGETDIR =""
Set TARGETDIR to default
)))
How can I convert this into "true MSI"?
And if not really possible, can I build a small script function, receiving , modifying and returning a Path Variable property?
Best Regards,
Thomas
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @thomas64 ,
It can be achieved by adding a installscript custom action to set the INSTALLDIR with the Reg keyvalues.
You can refer the below link for the Basic MSI custom action to set the INSTALLDIR:
https://stackoverflow.com/questions/6037154/updating-the-installdir-from-installscript-in-basic-msi
Apart from the above, you can create system search to set the INSTALLDIR:
Below steps describe how to configure INSTALLDIR to a custom predefined folders:
1- Create a Basic MSI project.
2- Go to the System Search view
3- Add a "Registry entry" system search by clicking "Add.." from the right click context menu in the system search view.
4- Enter the details in the system search wizard from where you want to read the path, below keys read the program files ARM path:
Registry Root: HKEY_LOCAL_MACHINE
Registry Key: SOFTWARE\Microsoft\Windows\CurrentVersion
Registry Value: ProgramFilesDir (Arm)
Search the 64-Bit Portion of the Registry : Select this option
[ Click Next Button in wizard to move to next page]
Store the values in this property : PROGRAMFILESARM
Just store the value in the property: Select this option
[ Click Finish Button in wizard to close wizard and add the system search]
5- Got to "General Information" view, and update the "INSTALLDIR" with the property defined in Step 4 (PROGRAMFILESARM)
Like:- INSTALLDIR = [PROGRAMFILESARM]My Company Name\My Product Name
6- Add files to your project, Build the msi, and check the run time behavior whether the pay loads are copied to the selected INSTALL DIR path.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)