Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Make APPDIR persistent across installs

Wed Feb 21, 2018 4:19 pm

Hello,

If I install in a non-default directory, uninstall and start the installer again, the directory shown is the default APPDIR. Is there a possibility to remember the last setting of APPDIR?

I already tried to add APPDIR as a persistent property in "Install Parameters" -> "Properties", but this is not possible, since AI tells me that "this property name is reserved".

I also tried to write APPDIR into the registry and read it from there through a search, but this failed as well - the registry value is not written, although the setting is as follows:

Image

(By the way, the default registry keys you have added (AI_InstallLanguage etc.) are not written to the registry as well. AI 14.5.2)

Kind regards,

Alexander

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Make APPDIR persistent across installs

Thu Feb 22, 2018 11:35 am

Hi Alexander,

In order to preserve the installation path during the upgrade, you can check the "Use original installation path when upgrading" option from the "Upgrades" page.

However, if you first uninstall the old version manually and then install the new version, all the resources and information from the old version are removed and the new version will not be able to retrieve its installation path from anywhere.

For this, you can, indeed, store its path into a registry value, set the "Persistent" flag for its related component from the "Organization" page, then search that value in the "Search" page and put it in the "APPDIR" property.
I also tried to write APPDIR into the registry and read it from there through a search, but this failed as well - the registry value is not written, although the setting is as follows
Please keep in mind that by default the registry entries are written under the "Wow6432Node" key on a 64-bit machine if the "Mark component as 64-bit" option is not checked. Did you search under the "Wow6432Node" key, too?

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

Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Re: Make APPDIR persistent across installs

Fri Feb 23, 2018 1:31 pm

Thank you. I checked and found that I am indeed reading from the 64 bit part and writing to the 32bit part of the registry (or was it the other way around?). I hardcoded everything to 64bit (we only support 64 bit systems) and now it works.

The issue is that we are not doing manual uninstall, but we have "uninstall if same version found" checked, so the uninstall happens automatically before wizard dialog stage when we install the same version again.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Make APPDIR persistent across installs

Mon Feb 26, 2018 1:14 pm

Hi Alexander,

Since you use the "Uninstall a package with the same version (if found)" option, the solution to preserve the installation path is the one I described in my previous post (store the path to a persistent registry value).

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

Return to “Building Installers”