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

Property containing path to installation directory?

Hello everyone.

I am trying to remove additional files/folders upon uninstall. I looked at http://www.advancedinstaller.com/user-g ... older.html but it seems alien to have to search for a folder when I already know that it resides in the installation directory. Also, when searching, I am afraid to find (and delete) the wrong folder.

It seems more logical to me that AI would provide a property which contains the application installation directory. Is that the case? What is the name of this property?

Thanks in advance.

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

Re: Property containing path to installation directory?

Sorry, I forgot to mention that I stumbled upon APPDIR in the help file:

"Application Folder - in this field you can specify the default path of the installation folder. This path is stored in the APPDIR property and it is represented by the "Application Folder" directory in the "Files and Folders" page."

I tried fetching this property in a .vbs script like this, in an uninstall action:

Code: Select all

Dim path
path = Session.Property("APPDIR")
MsgBox("APPDIR: " & path)
But the message box only shows "APPDIR: ".



Ciao

clemens
hoopoe
Posts: 6
Joined: Tue Jun 24, 2008 10:50 am

Re: Property containing path to installation directory?

try to add any component to this directory
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Property containing path to installation directory?

Hi,
it seems alien to have to search for a folder when I already know that it resides in the installation directory.
Note that the how-to explains a general situation. If you already have the path of the folder into a property, then you don't need a search (you can use the property directly). In your case, you can use the APPDIR property.
But the message box only shows "APPDIR: ".
Please note that only Immediate custom actions can access installer properties. Therefore, please make sure that the custom action which shows the value of APPDIR is set as Immediate.

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

Re: Property containing path to installation directory?

Hello Cosmin,

thank you, the immediate bit did the trick (although I thought that i used it already).

Can any of the "Scheduling Options" have a similar effect when used?


Ciao

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

Re: Property containing path to installation directory?

Hi,
Can any of the "Scheduling Options" have a similar effect when used?
No, the scheduling options control if the custom action runs during the installation. These options are explained in the Custom Action Properties article in the User Guide.

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

Re: Property containing path to installation directory?

Hello Cosmin,

thanks.


Ciao

clemens

Return to “Common Problems”