Posts

Everything You Want to Know About Properties

Ever wondered how many properties are set or can be set during an installation? Here is a great page which you can refer to for all the properties you ever wish to hear about Windows installer. http://helpnet.acresso.com/robo/projects/helplibdevstudio9/IHelpPropReference.htm

Installation of MSP File in Silent Mode

The best way to install an MSP file in silent installation is with the following command line: msiexec /p patchfile.msp REINSTALL=ALL REINSTALLMODE=omus But if you do not give the command line options of REINSTALL and REINSTALLMODE then it will not patch the existing installation package. What it will do is update the locally cached copy of the MSI database. You can also use following command line to install patches like for Adobe etc.: msiexec /update patchfile.msp /qb! If you run the MSP in UI mode then it will patch the installation and will also update the locally cached copy of the installation, because when the dialogs are run they in turn set REINSTALL and REINSTALLMODE. For installation of MSU, which is used as update in Windows Vista and above, please follow this new post on my blog: http://msiworld.blogspot.com.au/2012/04/silent-install-and-uninstall-of-msu.html

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.

Easy way of Copying Condition in Custom Action

Image
I have learnt an easy way of copying condition directly in one Custom Action from other. This is totally on my experience, and I have not found any material for it on net too. So here it goes... Suppose you are making a CustomAction2 and have added it in the sequence as shown : And now you have to mention the condition same as that of CustomAction1, which in this case is "NOT Installed AND NOT PATCH", you have to click on CustomAction1 in the sequence and it will be like this: You can see the Condition in the greyed area. You cannot copy it directly, but what you have to do is: go to any of the other tab from this situation, be it Properties or Details tab. All you have to do next is to come back to your Location tab. And here you see the result.The Condition is automatically copied to the CustomAction2. Go ahead and try this out. It is really fun and easy. It will save you some time too.

Exclusion List

Exclusion List • Manual Checks: Exclude (delete) any unwanted files and folders. Some common file extensions that should usually be excluded are listed below. If the resource you are deleting is a keypath (indicated by the key symbol) you must ensure the related component has been assigned a new keypath. If the component is now empty it can be deleted. Common Items: HKEY_USER_SELECTABLE\Software\Shortcuts Event log registries. All VCache Entries Shutdown Entries Uninstall Entries Your Username if Captured *.log-app specific services / hosts – These must be handled appropriately Folders/ Files referring to Wise Folders/ Files referring to InstallShield Any cookies Any file from the dependency applications that has got captured must be excluded. Cache Temp Tmp Bag Log – Examine in notepad to see if they are relevant or not. • Files *.REG files _isreg32.dll setup.exe install.log install.exe install.ini unwise.exe Uninstall.xml Upgrade.exe Update.exe uninstall.cif uninstall.cfg / uninstall...

Troubleshooting Unnecessary Repairs

Sometimes you may encounter the problem of unnecessary repairs of MSI while launching the shortcut in the same logged in user. Here is the way to troubleshoot this problem. You can go to eventviewr (by typing eventvwr in Run command) then to applications and check the latest error message after repair. It will tell you which component is missing and because of which MSI went for self heal. You can now check out this component in your package and see what the problem is. Maybe your keypath is a moving target for that component. There are other methods too which can be used in case the above does not work. These are Logs/Gap capture. More on this later.

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.