About Windows Installer Advertised Shortcuts Problem
We recently migrated a product to Visual Studio 2010 and came across a problem whereby the programs shortcuts kept triggering re-installation of the application, even though the product had just been installed. Windows Installer Advertised shortcuts ensure that the shortcuts always have an icon, even if users move from machine to machine. No matter what, we could not find the root cause of this issue, so we looked at disabling this mechanism in the MSI.
Editing Generated MSI’s Using Orca
We used Microsofts ‘Orca’ tool to edit the MSI and scripted this as a post build event in VS2010. To do this we performed the following steps:
- Install Windows 7 SDK
- Install Orca.msi contained within the SDK: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\Orca.Msi
- Set the following Visual Studio post build event for the installer project:
cscript “C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\sysmgmt\msi\scripts\WiRunSQL.vbs” “$(BuiltOuputPath)” “INSERT INTO Property(Property, Value) VALUES (‘DISABLEADVTSHORTCUTS’, ‘1’)”
This ensured every installer thereafter was generated with advertised shortcuts disabled. There are a plethora of options which can be set by the Orca tool, just look at the ‘scripts’ folder in the above post build event for examples of what you can do.