views:

1047

answers:

3

Hi,

I have a standard Visual Studio (2008) application setup project, which generates an msi containing a few files. I noticed however that: 1) When the msi installs and some of the files already exist, it simply silently ignores these files. This is the behaviour that I don't want, because of obvious reasons. 2) When I uninstall the msi, it doesn't delete my main dll file.

How can I fix these two things? Together they make it impossible to automatically upgrade my software.

+2  A: 

I had the exact same problem and eventually gave up. Getting it to work is a horrible, complicated process involving lots of GUIDs. You'll feel very dirty afterward (assuming you ever get it to work).

My advice is to switch to Inno Setup which is much more suited to people like you and me.

Leave .msi to people who do "corporate rollouts" instead of "installs".

Jimmy J
Heh, that what I was worried about. I already wasted 2 weeks on these msis. Eh, just another thing M$ f..ed up completely.
Grzenio
+1  A: 

Have you incremented the version number in your setup project? Incrementing the version number will also ask you to create a new product id. You should confirm this question with yes.

0xA3
+1  A: 

Insofar as not removing all the files, check the reference count under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs]

If you've used MSIZAP aka the "Windows Installer Cleanup Utility" you've basically put your machine into an unknown state and you'll need to manually remove everything from the registry (in my company we have a utility that removes all known registry entries from the last 10 releases of the product, basically consisting of a 1000 line .reg file and some other tools) before you can reliably test your setup again.

See http://robmensching.com/blog/posts/2009/3/6/More-on-Haacks-Troubleshooting-Windows-MSI-Installers for a bit more information about what happens when you get your machine into an "unsupported state" and how you'll need to manually clean up things or reformat before continuing.

We came across this problem as Installshield automatically defaults to setting components as shared components, so we'd end up with weird reference counting bugs, files left behind, etc, etc. A really ugly solution.

For your upgrades, try doing major upgrades rather than minor upgrades (patches) as this is a lot easier to get your head around when you're first getting into Windows Installer. But first, you'll need to get your app uninstalling correctly, then you can move onto the upgrade. If it won't uninstall properly, it won't upgrade properly.

sascha
Either that or use an installer that doesn't need all that.
Jimmy J