SWarnberg
Posts: 3
Joined: Mon Dec 02, 2013 4:27 pm

Temporary files removed during upgrade

It seems like there is a bug in Advanced Installer when you use temporary files and upgrading a previous version.

The problem is that when you add temporary files to the project, for instance to use in custom actions, Advanced Installer creates three custom actions; AI_ExtractTempFiles, AI_RemoveAllTempFiles and AI_RemoveTempFiles (which are undocumented?!). However, since AI_ExtractTempFiles is sequenced before RemoveExistingProducts, the temporary files are installed first, and then during the removal of the previous version, the temporary files are removed with the AI_RemoveAllTempFiles action. Once the installation of the new version continues the files doesn't exist anymore and the custom actions fails.

Possible solutions/workarounds are to either sequence AI_ExtractTempFiles to after InstallInitialize, or to set a condition on the AI_Remove* actions.

/Staffan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Temporary files removed during upgrade

Hi Staffan,

Indeed, the custom actions that you mentioned are not documented (however their names are quite suggestive). We will try to document them in the future, thank you for bringing it to our attention.

Please note that the sequence of those actions is correct, but the files are removed because they are placed in the same folder and have the same names. As a workaround you can implement the solution discussed in the Installer uninstalling temporary files on upgrade thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SWarnberg
Posts: 3
Joined: Mon Dec 02, 2013 4:27 pm

Re: Temporary files removed during upgrade

OK, thanks for info, I will try that. However, I still don't think this is a good design and it will cause much confusion in future as well if this behavior is kept.

Also, if I create a sub-folder in the Temporary folder, that will be persisted after install, right?

/Staffan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Temporary files removed during upgrade

Hi Staffan,

This behavior is normal as long as the temporary file from the upgraded version replaces the file from the old version. In this case when the file from the old version needs to be removed it is not found, but the file from the new version is deleted instead (because it is identical). However, the workaround I suggested to you was used for many years and it didn't cause any problems.
Also, if I create a sub-folder in the Temporary folder, that will be persisted after install, right?
Indeed, the folder will remain after install, but it will be removed after the uninstall.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”