windows-installermajor-upgradeinstallscript-msi

Force .msi to skip deletion of some files


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?


Solution

  • 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>