Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2007
    Location
    Another Planet
    Posts
    3

    Registry Path Confusion

    Changing from SUF 5 to v7 (trial), I'm having a tough time getting my head around the use of variables in locating an existing path on a user's sytem. The following is what I've tried thus far (in the Actions > On Startup box):

    Code:
    RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
    if RegVar ~= "" then
    SessionVar.Set("%AppFolder%", RegVar);
    end
    and...

    Code:
    RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
    result = Application.GetLastError();
    SessionVar.Set("%AppFolder%", RegVar);
    RegVar = SessionVar.Expand("%AppFolder%");
    Session Variables:

    Folder Defaults
    %RegVar% (entered in the right-side pane on the %AppFolder% line)

    When I run the resulting setup, the first code example returns "%RegVar%" into the path dialog, instead of the path taken from the registry. The second code example returns an empty field for the directory to be installed to. This was all fairly straight forward in SUF v5 and it worked fine, but I'm a bit lost in SUF v7.

  2. #2
    Join Date
    Jan 2000
    Posts
    2,002
    If RegVar is meant to be a session variable (one that is expanded in text) then you need to change your last line to:

    SessionVar.Set("%RegVar%", SessionVar.Expand("%AppFolder%"));

    I would suggest that you read Chapter 5 o fthe User's Guide to get a more clear understanding of Session Variables.

  3. #3
    Join Date
    Nov 2007
    Location
    Another Planet
    Posts
    3
    Thank you, but I still get a literal "%ReVar%" in the path dialog after the setup has been compiled:

    Code:
    RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\My Application", "EXE Path", true);
    SessionVar.Set("%RegVar%", SessionVar.Expand("%AppFolder%"));
    I realize I'm missing something, but clueless as to what.

  4. #4
    Join Date
    Nov 2007
    Location
    Another Planet
    Posts
    3
    Missed the double '\\' in the path, and finally got it working.

    Code:
    RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
    SessionVar.Set("%AppFolder%", RegVar);

Similar Threads

  1. Reading Install Path From Registry
    By Staggan in forum Visual Patch 2.0
    Replies: 33
    Last Post: 05-04-2006, 10:31 AM
  2. Search path in registry
    By User2004 in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 08-01-2004, 06:19 AM
  3. Replies: 7
    Last Post: 06-17-2003, 03:55 AM
  4. Replies: 2
    Last Post: 02-19-2003, 04:29 AM
  5. How to extract a file path from registry key?
    By skids in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 03-17-2002, 10:48 AM

Posting Permissions

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