"Registry Search" and "Test Search" - 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!

McKool
Posts: 113
Joined: Wed Jan 19, 2011 12:35 pm
Location: Darmstadt, Germany
Contact: Website

"Registry Search" and "Test Search"

Hello,

I'm trying to search the registry for a path to a file. In the documentation I can read the following:
"You should choose the “The value contains a path to a directory” or “The value contains a path to a file” option only if you are sure that the folder/file is present on the target machine. Otherwise, if the path cannot be resolved, Windows Installer will set the new value for the property to null. In this case use the “Retrieve the raw value” option."
The path I'm using to test is the launch path for the Windows-Explorer (which is of course present on the machine). Here is the data I'm giving in the Registry Location Properties:

Root: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Classes\Folder\shell\open\command
Name: [~] (Inserted automatically --> I assume, this is because the value to read is the default value)
Type: The value contains a path to a file

Well, the content of this reg-value is: %SystemRoot%\Explorer.exe, but when executing the Search Test I'm getting "1: C:\Windows\". Is this a bug or am I understanding something wrong? I'm expecting to get a value like "1: C:\Windows\Explorer.exe" :?

Thanks in advance,
Keneth
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: "Registry Search" and "Test Search"

Hi Keneth,

The search returns the correct value. The "Type" combo is used just to tell the search what is looking for in that registry value, not what to return.

I shall ask our technical writing team to explain more on this in the user-guide.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
McKool
Posts: 113
Joined: Wed Jan 19, 2011 12:35 pm
Location: Darmstadt, Germany
Contact: Website

Re: "Registry Search" and "Test Search"

Hello bogdan,
Bogdan wrote:The search returns the correct value. The "Type" combo is used just to tell the search what is looking for in that registry value, not what to return.
why is that a correct value if the search is not returning the complete text? The search is truncating the information of the value .... An example:
  1. Using as Type "Retrieve the raw value" returns: "1: C:\Windows\Explorer.exe" (the actual stored value)
  2. Using as Type "The value contains a path to a directory" returns: "1: " (empty, since this is not a path to a folder, i.e. the path doesn't exist)
  3. Using as Type "The value contains a path to a file" returns: "1: C:\Windows\"(why only the folder extracted from the actual stored value?)

According with the help quote I did before (so is my interpretation ), the selection of a type is used to get the value of a registry entry and to check for the existence of a file or path. If this is true, I should get the same value for cases a and c, since it is a path to a file and the file exists. If this is wrong, how should I understand this? :?

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

Re: "Registry Search" and "Test Search"

Hi Keneth,

I'm afraid I was not explanatory enough, the search specifically searches for a file but it is designed to return only its parent folder path. As I said
this is not completely explained in the user-guide.

This is useful usually when people want to install files next to another file they are searching for, so the search returns the exact directory where the file is found
not including its name in the path. This makes it very easy for them to create a property based folder using the search.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
McKool
Posts: 113
Joined: Wed Jan 19, 2011 12:35 pm
Location: Darmstadt, Germany
Contact: Website

Re: "Registry Search" and "Test Search"

:oops: Sorry, now I understand. Thanks for the clarification.

So, if I look for a registry entry which contain a path to a file, then I can assume that the file exists only when the property returned by the search is not empty, right?

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

Re: "Registry Search" and "Test Search"

Hi,

Exactly, if the search contains a path it means the file exists in that location.

Rgards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: "Registry Search" and "Test Search"

Hi Keneth,

EDIT:
Exactly, if the search contains a path it means the file exists in that location.
It seems MSDN contradicts me, this search will also return a path if the file does not exists, but the path exists.

My above statement is valid only for a "File Search". Sorry for the confusion. I talked to my colleagues and this should be included in the user-guide immediately.

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

Return to “Common Problems”