Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2007
    Posts
    32

    Creating Session Variables

    I am attempting to install certain files to a folder that I am trying to determine its location from the registry. On the On Pre-Install tab for Actions, I defined a variable that uses "Registry.GetValue" to find the path of the program. When I attempt to build, I receive a message that the file cannot be created in the directory. If you define a variable like I did using the On Pre-Install tab under Actions, how do you get the installer to recognize this variable? Are they the same as Session Variables?

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862
    Quote Originally Posted by gott View Post
    I am attempting to install certain files to a folder that I am trying to determine its location from the registry. On the On Pre-Install tab for Actions, I defined a variable that uses "Registry.GetValue" to find the path of the program. When I attempt to build, I receive a message that the file cannot be created in the directory. If you define a variable like I did using the On Pre-Install tab under Actions, how do you get the installer to recognize this variable? Are they the same as Session Variables?
    1. What is the exact error you get on build?
    2. what is the exact code you're using?
    3. define a variable "like I did" -- how did you define it?
    4. "lua" variables are not the same as session variables, if that's what you're asking...


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Sep 2007
    Posts
    32
    Here is the code:

    Code:
    HomeDir=Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Company Name\\Program", "Home", false);
    This is defined in the Pre-Install Action. There was no error code given when I received an error stating that the path could not be created. When I build the program and attempt to copy the files to the directory, the program states that it cannot since it cannot create the %HomeDir%\Program folder.

  4. #4
    Join Date
    Sep 2007
    Posts
    32
    I have made some progress with this as well. My current code appears as the following:

    Code:
    SessionVar.Set("ProgramHome", Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Company Name\\Program", "Home", false));
    It does appear to retrieve the correct home for the program folder from the registry. However, whenever I build an attempt to run the installer, it does seem to resolve the variable, but I receive the following error:

    "Could not create %C:\Program%\"

    It appears that the percentage signs are causing this. With my current code, how do I eliminate these?

  5. #5
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862
    Quote Originally Posted by gott View Post
    It appears that the percentage signs are causing this. With my current code, how do I eliminate these?
    Glad you discovered the difference between a lua variable and a session variable...

    Now, to your question -- the line which you keep quoting, would not cause an error at build time -- moreover -- I think when you say 'build' you mean install ??

    In order to find the offending line, you'll need to identify what is trying to make that call -- I suspect you have other places where you've confused a lua and session variable.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  6. #6
    Join Date
    Sep 2007
    Posts
    32
    I'm not certain if I understand. There doesn't appear to be any other line, just that the percentage signs are a part of the returned value for the variable. I don't know why these are stored in the %HomeDir% variable in the first place. Again, it is finding the correct path in the registry, just not concatenating the percentage signs from the resultant path.

  7. #7
    Join Date
    Sep 2007
    Posts
    32
    Using the Registry.GetValue action, I am able to successfully read the registry and then return a dialog box that contains the correct value:

    Code:
    HomeDir=Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Company Name\\Program", "Home", false);
    Dialog.Message("Registry Data", "The value read from the Registry is "..HomeDir..".");
    Whenever I set a SessionVar.Set action, I experience the problem where the installer cannot resolve the path, adding % signs to the beginning and the end of the path. The code for the SessionVar.Set line is the following:

    Code:
    SessionVar.Set("ProgramHome", "HomeDir");
    I cannot figure out why this is not resolving. Is there another way to determine a path based upon a registry setting, and then store that path into a session variable?

  8. #8
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    HomeDir is a (LUA) variable. “HomeDir” is a text string. I suggest following the correct syntax:

    Code:
    SessionVar.Set("%ProgramHome%", HomeDir);
    Then use the session variable %ProgramHome% in the proper way and everything is fine.

  9. #9
    Join Date
    Sep 2007
    Posts
    32
    That worked. Thanks for the reply! Also, I was only using "HomeDir" as an example in this case. The actual variable is something unique.

Similar Threads

  1. Registry.GetValue problem with session variables
    By Harris in forum Setup Factory 7.0
    Replies: 1
    Last Post: 06-12-2007, 01:21 PM
  2. session variables
    By ultraz57 in forum Setup Factory 7.0
    Replies: 3
    Last Post: 06-08-2007, 10:54 AM
  3. Session Variables
    By AlanNicoll in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-11-2007, 12:31 PM
  4. Session variables
    By maddrt01 in forum Setup Factory 7.0
    Replies: 4
    Last Post: 06-12-2005, 05:41 AM
  5. session variables in action strings
    By tkilshaw in forum Setup Factory 7.0
    Replies: 3
    Last Post: 04-21-2005, 12:58 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