Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005
    Posts
    3

    Help with Registry.SetValue and Session Variables

    Hello,

    I am trying to use the %AppPath% value in the registry because I want to add my program to the registry startup for Windows. I contacted support and they gave me the following result but the value for %AppPath% was not there.

    The following lines was placed in the On Post Install because I assume the session var would be set already:

    Code:
    AppPath = SessionVar.Expand("%AppPath%");
    Registry.SetValue(HKEY_LOCAL_MACHINE, "software\\microsoft\\Windows\\CurrentVersion\\Run", "MyProgram", AppPath.."\\services.exe", REG_SZ);
    When I run the install and look in the registry, the value for this is:

    %AppPath%\services.exe

    The %AppPath% variable was never filled in.

    Can anyone help? I would GREATLY appreciate it!

    Thanks

  2. #2
    Join Date
    Jan 2002
    Location
    Nashville TN
    Posts
    328
    Codes looks right, is this on the POST Install event?

  3. #3
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    i) Correct syntax (as far as I can see)
    ii) The code is in the right place (after the install procedure)

    So far, so good, but your resulting registry entry is %AppPath%\services.exe. That means there is no value assigned to %AppPath%. In a case like this, I would have used the debug function.

    Code:
    AppPath = SessionVar.Expand("%AppPath%");
    Debug.ShowWindow(true);
    Debug.Print("The registry valus is: "..AppPath.."\\services.exe".."\r\n");
    -- Registry.SetValue(HKEY_LOCAL_MACHINE, "software\\microsoft\\Windows\\CurrentVersion\\Run", "MyProgram", AppPath.."\\services.exe", REG_SZ);
    (Or 2) use a dialog message or 3) write to the setup log).

    Check the variable list (Ctrl-B). I don't think you have %AppPath%. The default variable is %AppFolder%. Change the variable name and you will have success.
    Last edited by csd214; 03-23-2005 at 11:19 PM.

  4. #4
    Join Date
    Mar 2005
    Posts
    3
    I just looked and your right - it is AppFolder. This has been driving me crazy for over a day!

    Thanks alot everyone!

    Warren

Similar Threads

  1. Variables in message dialogs now broken?
    By Tek in forum Setup Factory 7.0
    Replies: 2
    Last Post: 03-14-2005, 02:09 AM
  2. Lovely Custom Variables for Videos
    By eric_darling in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 01-24-2003, 04:57 PM
  3. Menu in session2 to play audio tracks in session 1, cd player?
    By MartinUK in forum AutoPlay Menu Studio 3.0
    Replies: 1
    Last Post: 03-20-2002, 05:35 PM

Posting Permissions

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