Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Grin Get %AppFolder% from registry

    Hi all,

    I'm working on an installer for an expansion module.

    The installer should determine if the main application is already installed on the system by searching for a registry value in:

    "HKEY_LOCAL_MACHINE\\Software\\My Product"

    The value in question is stored in "Installed Path"

    -------------------

    What i'm looking for is an if statement that will check to see if the value exists in the registry. If it does not exist, it will popup a message box then exit. If it DOES exist, it will set %AppFolder% as the registry value.

    Here's what i want:

    SessionVar.Set("%AppFolder%", Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Product", "Installed Path", true));

    I've tried some different IF statements but so far unsuccessful.

    Any help would be much appreciated!

    Thanks alot!

  2. #2
    Join Date
    Jun 2005
    Posts
    470
    maybe something like this

    Code:
    myPath = Registry.GetValue(....);
    if Folder.DoesExist(myPath) then
    	SessionVar.Set("%AppFolder%",myPath);
    else
    	Dialog.Message("Error", "Installation not found");
    	Application.Exit();
    end;

  3. #3
    Join Date
    Aug 2009
    Posts
    3
    Excellent pww thanks for that, however is there a way to expand that code to check if the registry value exists? NOTE: not the registry key, the value itself (Installed Path)

    Thanks for your help

  4. #4
    Join Date
    Jun 2005
    Posts
    470
    if myPath is not an empty string, value exists.
    If it is an empty string, value either does not exist or contains no data.

    if myPath=="" then
    Dialog.Message("oops", "Value does not exist");
    end

  5. #5
    Join Date
    Aug 2009
    Posts
    3
    thanks alot mate, much appreciated

Tags for this Thread

Posting Permissions

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