问题
I am using the Visual Studio 2010 setup to create an installer for my application. From the File system Editor i have selected one of the two primary output files that have been created in my solution. I have right clicked and created a shortcut for my executable. I have dragged and droped the shortcut into the User's Program Menu. I build the installer and everything completes successfully. I run the installer and everything runs successfully. Now i proceed to double click on the shortcut and the installer re-runs and fails!!!. I have checked the shortcut and it is different from the one i have manually created to compare. The Target is greyed out. Any help would be greatly appreciated!!!
回答1:
When launching an application through an advertised shortcut, Windows Installer verifies if the application resources are intact. If one or more resources are missing, Windows Installer reinstalls them automatically using the cached MSI. This is why the second installation is performed.
Shortcuts created in Visual Studio are advertised, so a repair is triggered if some of your installed files are missing.
To determine what triggers the repair you can try this:
- after receiving a “preparing to install” message open Event Viewer (you can search it in the Start menu or launch “eventvwr.msc”)
- go to “Windows Logs” -> “Application”
look for “MsiInstaller” information messages which have this form:
Event Type: Warning Event Source: MsiInstaller Event ID: 1001 Description: Detection of product '{1F7D16F0-836D-4CE4-9123-D30B2F24A17B}', feature 'FeatureId' failed during request for component '{068153F4-B9E0-4745-9A47-833764D9D60C}'
The GUIDs will be different on your machine, but they can help you identify which component is causing the problem. The first GUID is your package ProductCode and the second one is for the problematic component. Try creating an installation log and see why the component is not installed correctly.
回答2:
This ended up being an issue with the registry hive. The Visual Studio 2010 Registry editor would allow me to specify values in 'HKEY_USERS(64)\S-1-5-20\Fileopen. This however was the reason for the error above. That is, you can't have values in this part of the registry when it is being generated using setup and deployment from Visual Studio 2010. I moved the values to exist under local_Machine and the short cut work like a charm.
来源:https://stackoverflow.com/questions/10215458/installed-shortcut-causing-install-to-rerun-visual-studio-2010