3

I have run into an issue while going through the process of getting Updating to work.

The update method used is to do an uninstall and then install.

My problem is as follows:

  • I have several custom actions which rely on files in the Temp folder, and these all run perfectly well on a clean install.
  • When it comes to updating however, the custom actions fail, as it seems the Temp files have been removed as part of the AI_RemoveAllTempFiles action

This action seems to be getting done after install initialize and after install finalize. Is there a way to turn off the removal of temp files on updating, or should I just remove the AI_RemoveAllTempFiles action that is being done at install initialize?

I have attempted to use the OLDPRODUCTS property to try and stop the AI_RemoveAllTempFiles action but it doesn't seem to have worked. By this I mean I have modified the InstallExecuteSequence table to have a condition of OLDPRODUCTS ="" for AI_RemoveAllTempFiles entry

Thewads
  • 4,953
  • 11
  • 55
  • 71

1 Answers1

2

What I suspect that happens is that the old version of your application removes the temporary files, not the new one. i.e. it does this when its uninstall is triggered by the standard action RemoveExistingProducts from the new package. You can see this in a verbose log easily.

To avoid this problems during updates, you should have the temporary files added in a subfolder from Temporary folder. This subfolder should have a unique name for each version, for example you can set it to be [|ProductCode].

In your custom actions, to make sure you always get the correct path of the temporary files use their corespondent properties, i.e. each temporary file has associated a unique property, visible in the dialog appearing when you double click the file in Files and Folders page, this property resolves to the full path of the file.

Bogdan Mitrache
  • 10,536
  • 19
  • 34