canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Vista: Incorrect APPDIR at deinstallation?

Hello everyone.

I have a problem with the APPDIR attribute at time of deinstallation with Windows Vista.

The deinstallation log shows APPDIR to be set to the correct value ("Property(S): APPDIR = C:\Users\SNAP\Your Application\").

In a custom action (InstallExecuteSequence/CostInitialize, MsgBox Session.Property("APPDIR")) shows a different value ("C:\Program Files\Your Application").

(Note: "C:\Program Files\Your Application" is the default installation folder for the application, but I chose to install to "C:\Users\SNAP\Your Application".)

On Windows XP the same project/installer has the correct value in APPDIR in the deinstallation log as well as the MsgBox.

This problem exists for me with Advanced Installer 6.4 and 6.4.1.

Can any of you reproduce this problem?


With best regards

Clemens Anhuth
Attachments
Test_APPDIR.zip
AI project to reproduce the problem, install to a different folder than suggested by installer, for example C:\Users\<yourusername>.
(2.65 KiB) Downloaded 284 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Vista: Incorrect APPDIR at deinstallation?

Hi,

Please note that the APPDIR property is set during the CostFinalize standard action.

For your project, APPDIR was already set by the "InstallUISequence" custom action. Therefore, the change is also visible in the InstallExecuteSequence, before "CostFinalize". However, when uninstalling the package through "Add or Remove Programs", there is no UI. Therefore, the custom action in "InstallUISequence" does not run and APPDIR is set during "CostFinalize".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: Incorrect APPDIR at deinstallation?

Hello Cosmin,

does that mean that APPDIR is only set to a meaningful value (unless set by me) at deinstallation after ConstFinalize?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Vista: Incorrect APPDIR at deinstallation?

Hi Clemens,
does that mean that APPDIR is only set to a meaningful value (unless set by me) at deinstallation after ConstFinalize?
When the installation starts, APPDIR is set to the default value specified in the Install Parameters page. During the "CostFinalize" standard action, the final value of APPDIR is set from "FolderDlg" during installation or from the registry during maintenance (uninstall).

I'm not sure to what you are referring by "meaningful value", but APPDIR always has a value during the install/uninstall process.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: Incorrect APPDIR at deinstallation?

Hello Cosmin,
When the installation starts, APPDIR is set to the default value specified in the Install Parameters page. During the "CostFinalize" standard action, the final value of APPDIR is set from "FolderDlg" during installation or from the registry during maintenance (uninstall).

I'm not sure to what you are referring by "meaningful value", but APPDIR always has a value during the install/uninstall process.
The test case project that I attached to this thread shows that APPDIR is not set in the custom action at InstallUISequence/AppSearch when running on Windows XP.

But accessing APPDIR after CostFinalize I get the correct/actual path, so all is fine. Thank you.



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Vista: Incorrect APPDIR at deinstallation?

Hi Clemens,

In my previous posts I tried to explain what happened for your test case. I apologize if I wasn't explicit enough. Generally, here is how this works:
- right after you launch the package, APPDIR is empty
- after the ValidateProductID standard action, there is an Advanced Installer custom action which sets APPDIR to the value in the "Install Parameters" page
- during the CostFinalize standard action, the paths of all the folders are resolved (the path of APPDIR is retrieved from "FolderDlg" or it remains to the default value)

The path used for APPDIR during installation is the one set during CostFinalize. The default path is set through an Advanced Installer custom action to make sure that APPDIR contains a valid path during "CostFinalize" (for example, in a silent installation the path cannot be retrieved from "FolderDlg" and if APPDIR is empty the installation will not work).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: Incorrect APPDIR at deinstallation?

Hello Cosmin,

thank you for the additional information.


With best regards

Clemens Anhuth

Return to “Common Problems”