Usage of installation path in custom action - Advanced Installer Community
Aleksey
Posts: 2
Joined: Thu Dec 12, 2013 11:50 am

Usage of installation path in custom action

Hello!

I'm trying to check if the installation path is empty, if it's not i use custom action "Display error message" which stops the installation. To achieve this i use APPDIR property in "Search" tab and make folder search for [APPDIR]data\base. This folder is made after the installation, so it's not deleted after uninstall. I just don't want my user to intall product in non emty folder. I put my custom action after "Path resolution" in "Install execution page". The problem is that it's unable to find existing folder in installation folder. Furthermore, when i use [APPDIR]data (it is in "Files and Folders") it is found even though it is missing on the file system. What i discovered is when i use every folder from my "Files and Folders" tab it is found even it is missing, but i expect Search with APPDIR to look for folders on file system not in package.

What do i do wrong?
Thanks in advance!

Aleksey.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Usage of installation path in custom action

Hi Aleksey and welcome to Advanced Installer forums.

Please note that the correct path (i.e. [ProgramFilesFolder][Manufacturer]\[ProductName]) is set for the [APPDIR] property after the searches are done, more specifically, right before the "Wizard Dialog Sequence -> Paths Resolutions -> CostInitialize" standard action.

So, when the searches are made the [APPDIR] property contains only a default path (i.e. C:\) and that is why when you search for your folders, you always get a return of "true".

In order to achieve what you want, you can create your own custom action that searches for the folder you want, and place it after the "Wizard Dialogs Stage -> User Selection" action group. It is recommended to place your custom action at that point because, during the "User Selection" actions (when the dialogs are displayed), the user may change the path where the application will be installed.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Aleksey
Posts: 2
Joined: Thu Dec 12, 2013 11:50 am

Re: Usage of installation path in custom action

That worked! Thank you!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Usage of installation path in custom action

You're welcome. I'm glad you got this working.

Just let us know anytime you need help.

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

Return to “Common Problems”