Announcement

Collapse
No announcement yet.

Reading from the Registry

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading from the Registry

    I need to set a variable based on if a "Value Name" exists (not the key, which is a feature of SF6). Any ideas? Unfortunately, the value (binary) is not readable, so I can't use something like if %value% <> FALSE.

    Thanks!

  • #2
    Re: Reading from the Registry

    There's probably an easier way to do this that is more integral to SF6, but it eludes me at the moment (Mark?)...in any case, here's one way that would work:

    Export the registry key to a .reg file, and then (using string actions) parse the file to determine the presence of that value.

    Tip: use regedit's /e arg (or /a in 2k/XP), along with the /s arg to make it run silently...
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: Reading from the Registry

      Hi,

      I think Lorne's right, it wouldn't be that hard either, simply export the registry key to a temporary directory. Then read the information from the file into a variable using a Read Text File action. Once have done that simply use a Find String action to search the variable for the Value you are looking for.

      You action list would look something like this:

      Execute Program (Regedit.exe) (pass it something like: /s /ea %TempDir%\Reg.txt "HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts")
      Read Text File (%RegFile% = Contents of %TempDir%\Reg.txt
      Find String (%Value% = position of ValueName in %RegFile%)

      mark.
      MSI Factory The Next Generation Intelligent Setup Builder

      Comment


      • #4
        Re: Reading from the Registry

        Is it possible that some systems would not allow regedit to be run?

        Comment


        • #5
          Re: Reading from the Registry

          Yes, I think so -- at least on 2k/XP, if the user was explicitly denied access to it.
          --[[ Indigo Rose Software Developer ]]

          Comment

          Working...
          X