How to uninstall a previous version as part of msi installation?

I have a product that is packaged as MSI. When my customers install a new version of my product on top of an existing version, it doesn’t work well due to the custom VBS action, as described below. My question is: how can I change my MSI so that installing on top will always completely remove any existing version in advance?

Details:

I have a product with different versions deployed in different companies. About once a year, each of my clients received a new version of their product and deployed them to their workstations. The people responsible for the deployment will prefer that they can install the new version over the old version, instead of including the uninstall package in it.

The msi installation creates and writes some files to the [CommonApplicationData] \ MyApp folder. At run time, the application creates more files in the [CommonApplicationData] \ MyApp folder. During uninstall, I need to delete all these files. Since they are not installed in msi, they are not deleted automatically, so I created a vbs script that deletes this folder and something else in it. I set the command to execute this vbs in ExecuteDeferred:

...
RemoveFiles
RemoveFolders
CreateFolders
MoveFiles
InstallFiles
PatchFiles
If REMOVE="ALL" Then
    REM line below is my custom script
    call VBScript From Installation (MyApp_UninstallCleanup)  
End
DuplicateFiles
BindImage
CreateShortcuts
...

So far, so good, and it works great when installing and uninstalling. However, if I install a new version of my product on top of an existing version, everything happens in the following order: a) install a new version, create various files in the [CommonApplicationData] \ MyApp folder and in [Program Files] \ MyApp ... overwrite the old version files b) start my vbs by deleting the [CommonApplicationData] \ MyApp folder

GUID , Upgrade MSI, script , , .

, , . , , . , , , .

MSI, ?

, , MSI, vbs. , , msi.

Wise Installation Express 7.0 MSI.

!!

( )

+5
2

RemoveExistingProducts InstallInitialize :

, . , .

+5

EdT Symantec

Wise , RemoveExistingProducts InstallExecute. "" , UpgradeSync , .

, RemoveExistingProducts, InstallValidate InstallInitialize. , .

"RemoveExistingProducts" MSI.CHM .

+1

All Articles