Hi,
The only solution for this is to manually edit the MSI file with Orca. Here are the steps:
- in the "Organization" page make sure that the COM is the only resource in it's component
- in the custom actions page create the custom actions that register and unregister the COM
- for the custom actions you use these conditions:
$myCOM.dll=3 (for the register COM custom action)
(($myCOM = 2) AND (?myCOM = 3)) (for the unregister COM custom action)
where "myCOM.dll" is the component of your COM in the "Organization" page
- save and build the project
- open the MSI with Orca and go to the "InstallExecuteSequence" table
- order the actions in the table by their Sequence by clicking on the "Sequence" tab
- create the "InstallExecute" action right before the "InstallFinalize" action (you can set the Sequence of the "InstallExecute" action to the sequence of the "InstallFinalize" action minus 100)
- go to the "RemoveExistingProducts" action and set it's sequence to be between the "InstallExecute" and "InstallFinalize" actions
This way the last three actions are scheduled right after one another:
InstallExecute,
RemoveExistingProducts, and
InstallFinalize.
In this case the updated files are installed first and then the old files are removed. However, if the removal of the old application fails, then the installer rolls back both the removal of the old application and the install of the new application.
You can read about the other available options here:
http://msdn2.microsoft.com/en-us/library/aa371197.aspx
But if the COM object version are the same (the user already has latest version) I should avoid all this hassle and upgrade my software without unregistering/rebooting/re-registering.
Please note that if the COM already exists on the target computer and it has the same version like the one in the MSI package, then the one in the MSI will not be installed.
To see in what cases the file in the MSI will be installed over the file on the target computer please see this page:
http://msdn2.microsoft.com/en-us/library/aa368599.aspx
Regards,
Cosmin