shipping ini file along with the MSI package during build
Posted 29 November 2001 - 11:07
Posted 24 January 2002 - 04:42
1) You can't get the location of the MSI file (and hence the INI file) until the ResolveSource action has taken place. If you need the INI file before this, you'll have to get it another way.
2) The INI file won't get copied across the the MSI cache ([WindowsFolder]\Installer). If any custom actions require it for maintenance/uninstall, you'll have to manually copy it across and figure out when to delete it.
I have to access my INI file very early in the installation process, so I've had to use a differnet method.
I've added a line to the Binary table in my Installshield project (ISM) file that drags in the INI file when compiling the MSI. This way the INI file is in a known place at all times.
I've then created a simple class which all is used by all my custom action functions. This class extracts data from the Binary table into a temp file, and then deletes the temp file when the class destructs.
My hack isn't the most efficient in the world, but it does ensure that the INI file is cleaned up if the install is aborted. The only thing it doesn't allow for is making changes to the INI file, but this generally isn't an issue.