Posts

Showing posts with the label set property

How REINSTALLMODE=amus Works

In any of these installation transactions, viz. initial installation, repair, reinstallation, on-demand installation or patching an MSI, The REINSTALLMODE has an affect on it. Here is what "amus" means: * a - Force all files to be reinstalled, regardless of version * m - Rewrite all registry keys that go to HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT * u - Rewrite all registry keys that go to HKEY_CURRENT_USER or HKEY_USERS * s - Reinstall shortcuts and icons The mentioning of "a" in amus forces the reinstallation of files on your machine irrespective of the file version rules. Every file updated by REINSTALL property will be updated in this case. The sequence of events which happen actually depend on the authoring of your patch. If your patch contains the full file, the installer will not access the source to reinstall that file, but if your file is the delta of the file, like an update to say ini file, then the patch will access first the machine file ...

Using VBScript to Set Properties in MSI

We can easily use Set Property Custom Action to set Windows Installer Property, but sometimes we wish to set the property directly in VbScript, specially if we are taking an input from a user through VBScript. Hope this tip helps. To set property through VBScript we can use "Session" object like: Session.Property("ALLUSERS")="1" or we can directly use Property keyword like: Property("REBOOT")="ReallySuppress" The only catch here is that we cannot set INSTALLDIR property through the above method as the package uses Directory table to store the value of INSTALLDIR. We need to write the below VBScript to set INSTALLDIR: dim instpath instpath = "C:\newpath\newfolder" Session.TargetPath("INSTALLDIR")=instpath Remember to place this Custom Action after CostFinalize if you are changing the value of INSTALLDIR property in UI Sequence.

Why Custom Action Type 51 is Required

If you have always wondered why we need to anSet Property Custom action when there is already a Property table to handle it, then this is for you. Suppose we have to create a property based on the value of another property - in that case we cannot use the Property table to handle this. There will be a circular reference in which one property would be based on the other. In this scenario we use Set Property Custom Action. To affect a property used in a condition on a component or feature, the custom action must come before the CostFinalize action in the action sequence.