Kao
Kao

Reputation: 23

Performing rollbacks with Wix

I'm currently generating two msis using Wix let's call them A and B. I install A to a directory C:\test and then I install B to the same directory. Some of the files will be overwritten when the second installation happens.

So, how would I go about restoring A to its original installed state while removing every trace of B? I know msis can do rollbacks if for example, the installation of msi B fails, but I read that if the installation is successful, the rollback script etc is deleted.

Any help would be appreciated.

Thanks in advance.

Upvotes: 0

Views: 469

Answers (1)

Cosmin
Cosmin

Reputation: 21416

I don't think that your approach is correct. Why are your packages installing files in the same location? Are they shared files? If they are, you can use the Windows Installer component sharing mechanism:

  • make sure that these files use the same components in both installers
  • these components should have the same names and GUIDs in both installers
  • when package B installs over package A, Windows Installer will use a reference count for the shared components
  • the original files are not overwritten
  • the shared components are removed only when both products are uninstalled

If they are not shared files, why are you using the same location for different file versions?

Upvotes: 4

Related Questions