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
- :
- Re: Setting a public property based on an external INI file
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
Nov 23, 2010
12:10 PM
Setting a public property based on an external INI file
Hi,
Is there any way to get InstallShield to set the value for a public property by reading the value from an external INI file? I know you can use command-line parameters to pass in values for public properties, but for a variety of reasons, we prefer to have an INI outside of Setup.EXE that our clients can edit in order to set values for a few properties.
If this isn't something you can do through the Installation Designer (on a Basic MSI project), would it be possible to do with InstallScript? I've never written any InstallScript since we've been using InstallShield Express, but we're looking at upgrading to InstallShield Pro.
If the only way to do this is with InstallScript, can anyone point me to the functions that I should be looking at which can open and read an external file and then set a public property?
Thanks,
Jay
Is there any way to get InstallShield to set the value for a public property by reading the value from an external INI file? I know you can use command-line parameters to pass in values for public properties, but for a variety of reasons, we prefer to have an INI outside of Setup.EXE that our clients can edit in order to set values for a few properties.
If this isn't something you can do through the Installation Designer (on a Basic MSI project), would it be possible to do with InstallScript? I've never written any InstallScript since we've been using InstallShield Express, but we're looking at upgrading to InstallShield Pro.
If the only way to do this is with InstallScript, can anyone point me to the functions that I should be looking at which can open and read an external file and then set a public property?
Thanks,
Jay
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 24, 2010
04:24 AM
Windows Installer has built in functionality to read from INI files, but it is restricted to INI files in the Windows folder, so that won't help you.
So you will need to create a custom action for this purpose. This could be a DLL, a VBScript or an InstallScript. For InstallScript look at the functions GetProfString() to read the value and MsiSetProperty to store the value in a property.
SETUPEXEDIR is a property that holds the path where setup.exe is located. You can read this value using MsiGetProperty (be sure to initialize the size parameter before calling the function)
So you will need to create a custom action for this purpose. This could be a DLL, a VBScript or an InstallScript. For InstallScript look at the functions GetProfString() to read the value and MsiSetProperty to store the value in a property.
SETUPEXEDIR is a property that holds the path where setup.exe is located. You can read this value using MsiGetProperty (be sure to initialize the size parameter before calling the function)
Stefan Krueger
InstallSite.org
InstallSite.org
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)