File Search property - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

brianhudson
Posts: 7
Joined: Tue Jul 28, 2009 9:59 pm

File Search property

This topic may exist but the keyworks are too common for the search. I am evaluating this installer.

I have created a File Search and given it a property of INI_FOUND and a location of [APPDIR]. When I try to use INI_FOUND I am not sure what the value of this will be if it does find the file.

If I simply check if the property is "defined" I don't get the results I expect. I am trying to set a checkbox if the file is found.
brianhudson
Posts: 7
Joined: Tue Jul 28, 2009 9:59 pm

Re: File Search property

I am running the Test feature of the Application Search. I have one search for an INI and another for an application EXE file.

The [APPDIR] property is used as the location to search. If I increase the depth to 3 then I can get a path to a file but it is not always in the Application Folder. Also sometimes the result is a "1:" and other times it is a "C:\".

Since the file is in the [APPDIR] then I should only need a depth of 1.

Brian
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: File Search property

Hi,
I have created a File Search and given it a property of INI_FOUND and a location of [APPDIR]. When I try to use INI_FOUND I am not sure what the value of this will be if it does find the file.
If the search find the file it will return in its property the path of the file. To check the search you can use a New Custom Action → Script Inline and set the field Script Text to :

Code: Select all

MsgBox Session.Property(“INI_FOUND”)
This should display o message box with the value of the search.
I am running the Test feature of the Application Search. I have one search for an INI and another for an application EXE file. Also sometimes the result is a "1:" and other times it is a "C:\".
Please keep in mind that the values of the installer properties are resolved at runtime. So, if you test your search with [APPDIR] set this will work only when running the MSI file.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
brianhudson
Posts: 7
Joined: Tue Jul 28, 2009 9:59 pm

Re: File Search property

It also appears that the installer does not set [APPDIR] until after the searches are done.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: File Search property

Hi,

This happens because you've made the search in the InstalUISequence. Please note that the installer properties are available during the entire installation process. However, custom actions have some limitations for accessing these properties.

If you set your search in the InstallExecuteSequence the [APPDIR] property will be set correctly before the search starts.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”