UninstallPreviousVersions Custom Action Issue - Advanced Installer Community
kiranchauhan91
Posts: 24
Joined: Fri Jan 29, 2016 10:21 am

UninstallPreviousVersions Custom Action Issue

Hello,

We have used "UninstallPreviousVersions" action to uninstall previous version of the software. In our case, previous version & new version of the software is built using Advanced Installer and both are more or less same. Only difference is that we have some improvement in the DLL & EXE that we install using installer. The issue arises when it detects the older version and uninstalls it and then new version cannot be installed because all temp files extracted by new installer is deleted when old version is uninstalled and new version of the installer does not find them. Please note that old and new installer uses the same set of files extracted in %temp% folder. I would like to know if any other alternative or a workaround possible to overcome this issue.

Regards,

Kiran Chauhan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: UninstallPreviousVersions Custom Action Issue

Hello Kiran,

To avoid this limitation you should simply configure your new version of the setup to extract the setup files in a different location than the old one. Just go to "Builds page -> Configuration tab" and set the "Extract Location" field to a path which is unique for every setup version:

Code: Select all

[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install
Let us know if this helped, otherwise please give us more details about the related temp files which are extracted in the same location. Are they extracted by the installation process directly, or by a custom action, etc. ? From where could you change their extraction path?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kiranchauhan91
Posts: 24
Joined: Fri Jan 29, 2016 10:21 am

Re: UninstallPreviousVersions Custom Action Issue

Hi Daniel,

We have used Extract location to extract MSI files. The files in question are temporary files extracted in %temp% folder. These files are executable & config files for all CustomActions and SharePoint WSPs. They are used within installer via custom actions and deleted once installation is completes. These files are added using Files and Folders >> Target Computer >> Windows Volume >> Temporary section. Also, we have set rules for each temp files on based on OS version and SharePoint Version. I am not sure if all these possible using extract location.

Regards,

Kiran Chauhan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: UninstallPreviousVersions Custom Action Issue

Hello Kiran,

If the related files are Windows Installer temporary files, then in order to achieve what you need you should just make sure the "UninstallPreviousVersions" action is scheduled, in "Custom Actions" page, before the "Wizard Dialogs Stage -> Paths Resolution" action. This is because the themporary files are extracted during installation during "Paths Resolution -> CostFinalize" standard action.

Also, as another solution you can simply create in "Files and Folders" page a subfolder of the "Temporary" folder with the following name:

Code: Select all

[|ProductVersion]
Then add all of your temp files in the above subfolder. In this way your temp files will be always extracted in a unique temp folder.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kiranchauhan91
Posts: 24
Joined: Fri Jan 29, 2016 10:21 am

Re: UninstallPreviousVersions Custom Action Issue

Hi Daniel,

Thank you for your reply. I have tried to create a sub folder using the property name you mentioned. But, It does not find this property in the property selection dialog. Also, I created a new property under User Interface to test how it works, but if I use it to name the folder, the folder does not create in the %temp% folder and instead, it shows up at the " Target Computer" level. Any idea on why AI is behaving like this?

Regards

Kiran Chauhan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: UninstallPreviousVersions Custom Action Issue

Hello Kiran,

Just make sure you create the folder using the "New Folder > Regular" option and not the "New Folder > Property Based option".

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”