tom5870
Posts: 7
Joined: Wed Jul 26, 2017 4:00 pm

Determine location of installed prerequisite

Mon Jun 18, 2018 9:47 pm

Is there a way to get the installed location of a prerequisite? Or is there a way to pass a registry value to a custom action? I am trying to copy a config file to the prerequisite (Tomcat).

Catalin
Posts: 4527
Joined: Wed Jun 13, 2018 7:49 am

Re: Determine location of installed prerequisite

Tue Jun 19, 2018 1:04 pm

Hello,

Yes, this can be done. If Tomcat saves its Path into a registry file, then you can use our predefined "Search" support.

In order to do that, you can follow these steps :
1) go to Search page in the Custom Behavior group and press the New Search button from the toolbar. The name of each Search from the Search page is an Installer Property and, at Install time, its value will be saved in the Search associated property.
2) Right click on the new search we've just created -> Add Search Location -> Registry.
3) Configure your search in order to match your needs.

Now you can pass the search property to your custom action as a parameter.

If you have any further question or doubts, don't hesitate to contact us.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tom5870
Posts: 7
Joined: Wed Jul 26, 2017 4:00 pm

Re: Determine location of installed prerequisite

Tue Jun 19, 2018 2:31 pm

Thank you. However, I put the search result as the command line to a batch file using the "Launch File" action. If I put the parameter in double quotes (i.e. "[TOMCAT]"), the batch file does not seem to run. If I do not quote it, I get "C:\program" in the batch file. What is the proper way to pass a variable whose value might have spaces?

Catalin
Posts: 4527
Joined: Wed Jun 13, 2018 7:49 am

Re: Determine location of installed prerequisite

Fri Jun 22, 2018 12:48 pm

Hello,

This could be caused by the fact that you have the "Run as Administrator" option ticked in the "Properties" tab of your "LaunchFile" custom action. This is an Advanced Installer's limitation.

A workaround for this is to untick the "Run as Administrator" option from the "LunchFile" custom action and, instead of that, run the whole project as Administrator by ticking "Run as Administrator" option from the "Install Parameters" page --> "Installation Options" tab.

As another workaround, you can follow the steps presented in the "Re: Launch File custom action command line error".

Hope this helps!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”