Results 1 to 3 of 3

Thread: Check if a registry key exists

  1. #1
    ag_shah Guest

    Check if a registry key exists

    Hi,
    I have a Basic MSI project. I want to be able to check if a certain registry key exists and make this check an install condition. i.e. if the key does not exist, I want to display a message and not let the installation proceed.

    I used the system search view and selected "Registry entry that contains...". However, it does not check if the key exists but rather retrieves values under a registry key.

    Is there anything available in InstallShield that simply checks for the existence of a registry key.

    thanks,
    Ash

  2. #2
    Join Date
    Jan 2002
    Location
    Oakland, CA, USA
    Posts
    5,416
    System Search cannot be used to check for existence of registry key. The behavior is dictated by RegLocator table. You will want to read up on this thread. For further information, please look up RegLocator in the forums and MSDN.

    As a workaround, you can write a custom action to check for existence of registry key.
    Tsung-Huang Hsieh
    "A problem well stated is a problem half solved." --Charles F. Kettering

  3. #3
    erickantoniorp Guest

    Try this

    Why don't you use a simple installscript that checks if your reg-key exist. You can use RegDBKeyExist and abort installation if you can find it. Something like this in your script.

    if (RegDBKeyExist ( szRoot )< 0) then
    MessageBox ("Error", SEVERE);
    abort;
    endif;
    where szRott is your key... You can find more information in your installshield help.
    Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •