开发者

Installshield - Update the registry according to a file given at runtime

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 "".


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜