I want to make the .msi to not delete some files when upgrading. I saw that I can add files to be deleted but I am not finding any information ot how to say to the .msi "Don't delete this (when upgrading)".
Can someone help me with that?
I want to make the .msi to not delete some files when upgrading. I saw that I can add files to be deleted but I am not finding any information ot how to say to the .msi "Don't delete this (when upgrading)".
Can someone help me with that?
It's a major upgrade, right? That's a whole new MSI file containing all the files you need. So just make sure that they are also in the new MSI file. That's what everyone does. If your older MSI contains files A,B,C and D and you want the upgrade to "keep" A,B,C so that they are not removed, put them in the upgrade. To be safe, make sure they have the same component IDs. I suspect that you have some assumption about the way these things work that we are not aware of.
I managed to achieve this.
I created two custom actions: one to make backup and one to retrieve the backup.
<CustomAction Id="BackupCurrentUserConfig"
BinaryKey="Utility"
DllEntry="BackupUserConfig"
Execute="firstSequence" />
<CustomAction Id="RetrieveUserConfigFromBackup"
BinaryKey="Utility"
DllEntry="RetrieveUserConfig" />
And I did scheduled them as follows:
<InstallUISequence>
...
<Custom Action="BackupCurrentUserConfig" Before="ExecuteAction"></Custom>
</InstallUISequence>
<InstallExecuteSequence>
...
<Custom Action="VM_RetrieveUserConfigFromBackup" After="InstallFiles"></Custom>
</InstallExecuteSequence>