Web setup project removes files after upgrade from

2020-03-31 03:38发布

I have a web setup project built using VS2008. I've converted my solution to VS2010 and now when I build my new installer and run the install from the MSI it installs fine, then at the last step, removes all the files it's just installed.

I have RemovePreviousVersions set to true. If I turn this off the files remain in place (but I get multiple instances in the Programs and Features in the control panel).

If I run the install again, the files reappear. From then on, the files always remain, even when installing another version. So, the problem seems to be with running an installer built using VS2008 and then running the same installer built by VS2010. The upgrade GUIDs on each installer are the same.

What is the cause and how can I fix this?

4条回答
ら.Afraid
2楼-- · 2020-03-31 03:54

What I've discovered is that changing the UpgradeCode will prevent the files from being removed, however it's then treated as a separate installed program - i.e. in the control panel (Programs and Features) my program appears twice. Logically, I think, this is because it's not the same program.

My only option seems to be to programmatically uninstall the old version in the installer of the new version by writing a custom action.

查看更多
Animai°情兽
3楼-- · 2020-03-31 04:09

I've submitted a bug to Microsoft Connect and they've confirmed it's reproducible.

查看更多
时光不老,我们不散
4楼-- · 2020-03-31 04:10

I haven't tried porting a setup from VS2008 to 2010, but having the same upgrade code for different build versions will cause problems; simple explanation is the msiexec installer fails when it tries to remove the old components because the older components have the same upgrade version as the newer components being installed. There is a VS project setting where you can automatically generate a new upgrade code each time you rebuild your .msi; I generally select this and saves a lot of these versioning headaches.

  • Uninstall all copies of your app using add/remove programs

  • Delete the contents of your %TEMP% folder ( to get rid of any "old" (VS2008) copies of your .msi)

  • Update the GUID for the VS2010 version (I think you do this by right clicking on the GUID in the properties window and clicking "genereate new GUID")

  • rebuild the project and try again!

查看更多
爷的心禁止访问
5楼-- · 2020-03-31 04:17

I just encountered this error. Had the exact problem when upgrading. I tried the solution at:

https://connect.microsoft.com/VisualStudio/feedback/details/559575

I edited my MSI-file in Orca resequenced RemoveExistingProducts right after InstallInitialize (sequence number 1501). This was found in the InstallExecuteSequence table. This was originally sequence number 6550.

That solved my problem.

查看更多
登录 后发表回答