jafa
Posts: 51
Joined: Fri Feb 23, 2007 7:13 pm

Search, Registry Location - type "path and file"

Hi,

Under Search, Registry Location, the type field has the following options:

"The value contains a path to a directory" - AI validates that the path exists.

"The value contains a path to a file" - AI strips the filename and validates that the path exists.

"Retrieve the raw value" - AI does as stated.

It would be useful to have another option for obtaining the path+filename when a value that contains a path+filename.

This would differs from "retrieve the raw value" in two ways:
1) AI would expand and clean up the path+filename.
2) AI would verify that the file exists.

In our situation we need to add a firewall exception if a third party service is installed. We can retrieve the raw path+filename from the registry but the path+filename is stored with quotes around it. This causes the firewall insertion to fail.

We are using a work around using "the value contains a path to a file" and then appending the known filename, however we should really be using the actual filename from the registry.

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

Hi,

Please note that this is how Windows Installer handles the registry searches and it is considered a normal behavior.

If you need the complete path then you can append the filename to the path (like you are doing now) or you can retrieve the raw value (in this case the validation will not be performed).
We can retrieve the raw path+filename from the registry but the path+filename is stored with quotes around it. This causes the firewall insertion to fail.
I cannot reproduce this behavior on my test machine. If you use the "Retrieve the raw value" option then the property of the search will contain the path of the file (without any quotes).

What is the actual value of the registry entry which shows this behavior? Can you please give me more details about how to reproduce this?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jafa
Posts: 51
Joined: Fri Feb 23, 2007 7:13 pm

Hi,

Example of a normal service ImagePath registry value:

Code: Select all

C:\WINDOWS\eHome\ehRecvr.exe
Example of the SageTV service ImagePath registry value:

Code: Select all

"C:\Program Files\SageTV\SageTV\SageTVService.exe"
If I retrieve the raw value then the installer throws a run-time error attempting to add a firewall exception reporting that it can't find the file.

I figured this feature would also be useful when the registry value contains a computed path that needs to be resolved/expanded.

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

Hi,

Please note that in order to use the path stored in the registry, that path must not be enclosed by quotation marks ("). Since the registry entry you are using contains quotes, the behavior you encountered is normal.

We will consider including this feature in a future version of Advanced Installer. Thank you for your suggestion.

Until then, you can eliminate the quotation marks by using a custom action. You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ischafer
Posts: 8
Joined: Fri Dec 06, 2013 12:03 pm

Re: Search, Registry Location - type "path and file"

I have a similar problem here. I read a path to an exe-file from the registry, which has quotation marks around it.

How can I use a custom action to execute the exe-file? The custom action "LaunchFileFromProperty" doesn't work, as it does not cope correctly with the quotation marks. Maybe it is possible to use cmd.exe, but then the command-line window stays open in the background as long as the exe-file is running...

Regards,
Iwan
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Search, Registry Location - type "path and file"

Hello Iwan and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can use a temporary BAT file to launch the related EXE file. Here are the steps to proceed:
- create a BAT file (e.g. run.bat) like this:

Code: Select all

%1
and add it in "Files and Folders" page as a temporary file
- go to "Search" page and add your registry search (e.g. MY_SEARCH)
- go to "Custom Actions" page and add "Launch file" custom action like this:
  • File To Launch: [&run.bat]
    Command Line: [MY_SEARCH]
    Hide program's window: enabled
- build and run your project

Also, please keep in mind that the "Launch File" custom action should be scheduled after "Paths Resolution" actions group.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ischafer
Posts: 8
Joined: Fri Dec 06, 2013 12:03 pm

Re: Search, Registry Location - type "path and file"

Hi Daniel

Thanks for your nice welcome and your answer. It works as expected! What is a bit strange though, is that [&run.bat] in the "Launch file" custom action is underlined and marked as invalid identifier. Is it maybe because I configured the custom action as a custom action without sequence? Because I am calling it from a dialog, when clicking a button.

Best regards
Iwan
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Search, Registry Location - type "path and file"

You're always welcome Iwan.

Currently, the related string is marked as "Invalid Identifier" due to an Advanced Installer limitation. We'll try to add an improvement regarding this in a future version of Advanced Installer.

If you have any question just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”