Wednesday 15 February 2012

Wix CopyFile before uninstall and restore after uninstalltion -


Before upgrading to the new version I am upgrading large and uninstalling the existing product. But I want to maintain the current config file.

As the previous version was not permanent, "Yes", it removes the config file on the uninstallation.

And how can I do something like before applying 'app.config.bak' as a copy of 'app.config'. After uninstallation it was reverted from 'app.config.bak' to 'app.config'.

  & lt; DirectoryRef id = "INSTALLDIR" & gt; & Lt; Component ID = "Backup Config Comonent" Gise = "87368 AF 7-4BA2-4302-891A-B163 ADDB 7E 9C" & gt; & Lt; CopyFile ID = "backup config file" source directory = "INSTALLFOLDER" SourceName = "app.config" destination directory = "INSTALLFOLDER" destination name = "app.config.bak" /> & Lt; / Component & gt; & Lt; / DirectoryRef & gt; & Lt; DirectoryRef Id = "INSTALLDIR" & gt; & Lt; Component ID = "Configure Restore Config" GUID = "87368AF7-4BA2-4302-891A-B163 ADDB 7E 9C" & gt; & Lt; CopyFile ID = "Restore ConfiFile" source directory = "INSTALLFOLDER" source name = "app.config.bak" destination directory = "INSTALLFOLDER" destination name = "app.config" /> & Lt; / Component & gt; & Lt; / DirectoryRef & gt; & Lt; InstallExecuteSequence & gt; & Lt; After the custom action = "backup config file" = "install start" / & gt; & Lt; After RemoveExistingProducts = "InstallInitialize" /> & Lt; After custom action = "restoreconfigfile" = "install start" / & gt; & Lt; / InstallExecuteSequence & gt;   

thanks

All you have to do is & Lt; Custom action = "restoreconfigfile" = "install" /> to & lt; After the custom action = "restoreconfigfile" = "Remove Available Products" />

This is just a time issue that you are doing. After you install these three actions, you are asking to start, so it is very possible that they are not living in the order that is written. It is always a better idea that in which order you want them, it is clearly listed. A better, complete fix will be:

  & lt; Custom Action = "Backup Configfile" = "InstallInitialize" /> After; & Lt; After RemoveExistingProducts = "BackupConfigFile" /> & Lt; Edit = "Deleted products" />   

after custom action = "restoreconfig file" (to make a comment based on the comment) To create a custom action in the MSI, you need a custom action element Will need to be created. The back code is also necessary to create a custom action. However, if you are trying to copy only one file, then I would recommend using the element. Whatever I am thinking is very easy and cleaner by going through all the custom action steps.

No comments:

Post a Comment