Search Parameter save variable - 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!

jetsmets
Posts: 6
Joined: Fri Dec 28, 2012 10:42 pm

Search Parameter save variable

When you do a search for a file using a file search how do you use the result of that do a certain action. So for example I want to search the hard drive for a particular file, if that file exists then run a setup.exe.

I have the search working, but not sure how to use the result of the search to run a custom action. I am saving into variable SEARCH_RESULT, but if the result fails or sucess the variable is not updated.

Thanks

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

Re: Search Parameter save variable

Hi Wayne,

When you go in the Search page and create a "File Search" its name is automatically set to "RESULT_PROPERTY". If you create another search its name is now automatically set to "RESULT_PROPERTY_1". You can change the name of those searches if you want.

Then, when you create a custom action in the Custom Action page, you can set your condition in the "Condition" text field from the right pane.

For example:
  • Condition: RESULT_PROPERTY (the custom action will run only if the file you searched for was found, in which case "RESULT_PROPERTY" contains the path to the file)
    Condition: NOT RESULT_PROPERTY (the custom action will run only if the file you searched for was not found, in which case "RESULT_PROPERTY" is empty)
Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jetsmets
Posts: 6
Joined: Fri Dec 28, 2012 10:42 pm

Re: Search Parameter save variable

Ok i must be missing something I have set a property called rubyFile. To look for an exe called ruby.exe. Then i have set a dialog to only display if NOT RUBY File. But whether the file exists or does not exist the dialog displays.

The search runs succesfully in both cases but one time the result comes back where it found the item the other case it does not.

Thanks

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

Re: Search Parameter save variable

Hi Wayne,

The problem may appear because of the name of your property (which must be written in upper-case letters). You can read about the difference between private and public properties in our Windows Installer Properties article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jetsmets
Posts: 6
Joined: Fri Dec 28, 2012 10:42 pm

Re: Search Parameter save variable

That worked. Thanks for the help
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Search Parameter save variable

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

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

Return to “Common Problems”