I have a bit of a weird and wonderful bespoke application which we've packaged as an MSI. I'm looking for some advice on the best approach for the following.

What I'd like the latest MSI to do is:

Check whether a previous versions of the application (MSI) has been installed. If so then do the following:

1) Backup up key elements of the program, unfortunately user/program data is stored in with program, in [INSTALLDIR]. A 'Backup' subdirectory would be created and then certain files would be copied to that subdirectory.

2) Uninstall all the previous version of the application.

3) Continue with the install of the new install.

A patch/upgrade approach isn't really suitable as the original MSI (2 versions) has a number of issues, so we'd like to start clean, i.e. remove it completely. The options I'd been playing with were a) a script (WiseScript or VBS) which would search for the product codes of the two previous products and if they existed run a file backup routine and then kick off a Windows Installer uninstall of the product it had detected.
The other option was to use System Search to check for the key EXE. The results of that, i.e. the property value would determine what a Custom Action would do; i.e. Nothing or the Backup and Uninstall.

If there's a better approach then I'd welcome the advice.

0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


- Your scripted back-up idea is sound.

- Use VBS. WiseScript is tortuous at best and examples of good, robust code are hard (read: impossible) to find. Maintenance will also likely be an issue if the original coder gets knocked down by a bus, whereas most decent packagers - and many support staff - know VBS.

- You won't be able to execute an MSI inside another MSI. My choice - given that you want to just get rid totally - would be to use the RemoveFile and RemoveRegistry tables. These are well documented on MSDN and, of course, help is at hand here. Remember, though, to include the WI installation data in the registry.

Good luck!
Answered 04/21/2011 by: VBScab
Red Belt

Please log in to comment