Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Huh? Default value when getting a registry Key

    Hi,

    On SUF 6, on the Read From Registry action there was a field name "default value". This value was put on the variable when the registry value was not found.

    IE: I try to read this value:

    Key: HKLM\Software\MyProgram
    Value: WindowPositionX

    In suf, I set the default value to ie 615 so when first installing the program this key don't exist in the registry and thus the 615 value was used in the setup program.


    Where is this field and how to use it in SUF 7 ?

    Now in Suf 7 this field has disappeared. How can I do the same thing:

    does this is correct:
    Code:
    MyVar = 615
    MyVar = Registry.GetValue("HKLM","Software\MyProgram","WindowPositionX",true);
    So if the Value WindowPositionX doesn't exist in the registry, does the value 615 will be overwritten ?

  2. #2
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    Hi, if I understand..try this as an example lua script of actions:

    Code:
    MyVar = "615"; --set your default value
    get_myvar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "WindowPositionX", true);
    if (get_myvar == "") then		
    	--in theory does not exist, so create your default entry 'valuename' and 'value'
    	Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "WindowPositionX", MyVar, REG_SZ);
    end
    hth

    PS: Reccomend consulting the help file - examples from the related action
    or when using the action wizard

  3. #3
    Join Date
    Nov 2005
    Posts
    2
    It's a very long procedure. I have about 20 settings to read.

    I prefered the old SUF 6 default value :(

Similar Threads

  1. Unable to find software?
    By NigelLacey in forum Visual Patch 2.0
    Replies: 4
    Last Post: 10-11-2005, 10:35 AM
  2. Cannot get data from (default) registry key value
    By Jeff_Rossiter in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 12-30-2003, 04:00 AM
  3. FYI: Registry key used for AMS File open HTTP:
    By kpsmith in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 10-28-2003, 08:47 AM
  4. How to merge registry key file?
    By morci in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 11-24-2002, 12:04 PM
  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