views:

52

answers:

4

I have an program that gets installed via an msi. The msi was built using a VS2008 deployment project and has a custom action to run the program once the install is complete.

Once the msi has been run, I can simply update the version number, generate a new product code and the msi can be run again on the same PC. However, what I want is to be able to run the msi a second time on that same PC (without using msi repair) and have it re-install the software again (even if nothing has changed). Is this possible?

A: 

EDIT: I read this wrong.

OneSHOT

OneSHOT
A: 

No, this is not possible. Even if you change the ProductCode and the ProductVersion, the second time it runs it will always run in repair mode. Even the patching method is implementing the repair mode and basically using the patch file as a transform.

The only way to accomplish this would to somehow prevent any entry of the application in ARP, but I suspect that will break the resiliency of the application in which case you probably do not want to use MSI as your delivery system.

I have accomplished this in the past using a pure InstallScript setup. Once the setup has completed I remove the registry entries related to ARP so another install will act like a new install.

+2  A: 

You can accomplish this by removing the RegisterProduct Action, RegisterUser Action, PublishProduct Action, and PublishFeatures Action from the InstallExecuteSequence Table. By removing these standard actions, the application will not get registered in system's MSI database and you can run and re-run the install over and over as if it were a first-time install.

MSDN:
Adding and Removing an Application and Leaving No Trace in the Registry

William Leara
Thanks, that worked great! There's also some entries in the AdvtExecuteSequence Table that need removing, too.
pm_2
A: 

use an instance transform for a second installation http://msdn.microsoft.com/en-us/library/aa367797(VS.85).aspx

Steffen Horn