Question

I'm writing a basic MSI installer using installshield 2010. A different company would supply a .reg file that the installer would read in runtime and would update the registry accordingly.

I can't figure out how to accomplish this.

I manged to write a script using the Installscript that accomplish this, but when this script is running in Differed execution, I don't know how to get to the source directory where the setup.exe lays (and the .reg file).

MSIGetproperty doesn't work and all I get for SETUPEXEDIR is "".

Was it helpful?

Solution

During deferred execution you don't have access to most properties. You can either: 1. Use the CustomActionData property to pass the value you need. 2. Use an immediate custom action that updates the registry table with what it reads from the REG file. This way the Windows Installer engine will take care of rollback for you.

I can also suggest an alternative solution: The other company will supply an MST file with the registry table containing what was supposed to be in the REG file. The installation will then be performed with the TRANSFORMS property pointing at the MST. This way you get rollback and uninstall for free.

OTHER TIPS

You can use the Signature, DrLocator and AppSearch tables together to put the location of the registry file in some public property. We'll call it "MY_REG_FILE". Then you set the condition on your custom action to "MY_REG_FILE". If the file isn't actually there, then the property won't be set, the condition will evaluate to false, and the action won't run.

MSDN has an example of using the three tables together to find a file - http://msdn.microsoft.com/en-us/library/aa371552%28VS.85%29.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top