PDA

View Full Version : System Search???



tyacko
03-01-2006, 11:44 AM
OK, I've done quite a few system searches in my time, but I just can't understand how to look for a registry folder's existence in the system registry.

I've created the simplest app I could. It installs nothing. All I have it doing is checking for the existence of a folder in the registry.

Ex. HKEY_LOCAL_MACHINE\Software\TestApp

If the path exists, I would like to prevent the installation of the application via an install condition. If the path doesn't exist, I would like the setup to continue.

I've used the following system searches and neither has been successful for me.

1. File Path, as specified by registry entry.
2. Folder path, as specified by registry entry.

In both cases, I've left the "Registry Value (optional)" blank and I've even tried looking for "TestApp" as my "Registry Value (optional) in hopes of getting something to work here.

As I've said, I've done install conditions with system searches without issue up until now. One note, all of my system searches have always returned something (meaning a value). Since a registry folder doesn't really have a value, how do I check for its existence in an install condition? Meaning what is the "value" that is returned when it exists and when it doesn't?

The test app is a basic MSI project.

Any help (from me going crazy) is greatly appreciated.

SU-Nikolai
03-02-2006, 07:38 AM
I've had the same problem, which i solved this way:

I made a installscript custom action, that had among other lines of code, these:
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
if ( RegDBKeyExist ( "\\somefolder\\somekey ) = 1 ) then
....

Then you can set at property which you looks at in a condition and terminates your installation at a specific value

or you can terminate your installation in the custom action inself.

tyacko
03-02-2006, 07:50 AM
Thanks, I'll give that a try.

SU-Nikolai
03-02-2006, 08:03 AM
Note that "RegDBKeyExist" checks if a key exists

and "RegDBGetKeyValueEx" get a key value.