Download: [download#2#size#nohits]

Have you ever needed the functionality to read the property values from an .ini file, every time a installation or repair is run?

This small script created for Windows installer, will do the job.

Purpose:  

Automatically reads a ini file located in the MSI SOURCEDIR property.
Each parameter in the ini file is read into the property that
have the same name.
ex. “DaysSerial”=”0100000” line is read in to property named
DaysSerial and setting the value to 0100000
System works both with “DaysSerial”=”0100000” ini format, or DaysSerial=0100000 ini format.

If you later change the ini file at the source, and do a repair of the msi on the client, the new settings will be used.

NB! I also tried to make a script that could use custom named ini file, based on the commandline parameters, but it is, as far as i know, not possible. If you have an idea of how to do it, please do not hesistate to comments this article.

The problem is that if you later do a repair on the package, it will use the default settings, instead of the custom named ini file. This is why i “hardcoded” the ini filename into the package.

Usage:  

Put into MSI package execute deferred after “InstallInitialize” and
“ResolveSource” actions. In this example i have used VBScript Embedded.
NB! You might have to insert the “ResolveSource” action, since it is not allways default.

image

Script:

Warning: 

This script was tested in a msi package created by Visual Studio 2008
and edited in Wise Package Studio.
Coretech A/S is not responsible for any damages the script could cause.