views:

120

answers:

2

I released a beta version of a dll driver a while ago that used a script based installer called Inno Setup, which did three things.

1) copied the dll file to a specific directory on the target file system
2) performed COM registration
3) executed a custom registration method that is contained in the dll

For the next release of this software I have switched to using a Setup Project in Visual Studio for the installer. In this Installer I want to be able to check if the target has the beta version installed, and undo the three steps above. What is the best way to achieve this?

+2  A: 

Consider the use of a Windows Installer Custom Action.

Check the examples on MSDN and adapt them to your needs:

Creating a Custom Action

Using a Custom Action to Display a Message at Installation

Using a Custom Action to Pre-Compile an Assembly at Installation

João Angelo
+1  A: 

You may be able to set the ids of your setup project so that the old installer is detected as a previous version of the new installer - I haven't worked with inno setup so I'm not sure it will work, but it's worth looking into.

If that approach doesn't work you'll likely need to set up some sort of custom action, either running the beta uninstaller or deleting the old files directly.

Tom Clarkson