Announcement

Collapse
No announcement yet.

Registry plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #76
    With v2.7:
    code:
    Name "Output"
    OutFile "Output.exe"

    !include "Registry.nsh"

    Section
    StrCpy $R0 "HKEY_LOCAL_MACHINE" #Root
    StrCpy $R1 "SOFTWARE\Microsoft" #Subkey

    ${registry::Open} "$R0\$R1" "/K=1 V=0 /S=0 /N='Key1' /B=1" $0
    StrCmp $0 -1 0 loop
    MessageBox MB_OK "Error" IDOK close

    loop:
    ${registry::Find} $1 $2 $3 $4

    StrCmp $4 '' close
    ${registry::SaveKey} "$R0\$1\$2" "C:\keys.reg" "/A=1 /B=1" $0
    goto loop

    close:
    ${registry::Close}
    ${registry::Unload}

    Exec '"notepad.exe" C:\keys.reg'
    SectionEnd

    my functions

    Comment


    • #77
      Fixed: separate registry::Find and registry::SaveKey stacks. Now possible use them
                together.


      "Registry" plugin v2.7
      Attached Files
      my functions

      Comment


      • #78
        Updated: "StackFunc.h" to v1.8
        Added: handles for search


        "Registry" plugin v2.8
        Attached Files
        my functions

        Comment


        • #79
          Cool! Awesome plugin, and getting even better,
          thanks Instructor.
          BTW a more detailed documentation would be great :-)
          Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
          Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

          Comment


          • #80
            Updated: "StrFunc.h" to v1.7
            Updated: "StackFunc.h" to v1.9
            Updated: "ConvFunc.h" to v1.7


            "Registry" plugin v2.9
            Attached Files
            my functions

            Comment


            • #81
              Added: registry::Open options
                          "/NS=[name]" - sensitive search for a part of name
                          "/NI=[name]" - insensitive search for a part of name


              "Registry" plugin v3.0
              Attached Files
              my functions

              Comment


              • #82
                Multiple key Regsearch

                Instructor,

                First thanks for the help, I am sorry it took so long to get back to you.

                Second, I am having the same problem, What I need is for my search algorithm to search the registry for a specific keyword. If found save the key to a reg file, then from that point, the regkey it just wrote, continue to search the rest of the registry for that keyword. If another is found then save, start from that point and continue, and so on until it hits the end of the registry.

                Here is my search function:

                code:

                !define RegSearch `!insertmacro RegSearch`

                !macro RegSearch rootKey searchWord

                ${registry::Open} "${rootKey}" "/K=1 /V=0 /S=0 /B=0 /N='${searchWord}'" $0
                StrCmp $0 0 0 +2
                MessageBox MB_OK "Error" IDOK +9
                ${registry::Find} "$0" $1 $2 $3 $4
                StrCmp $4 '' +7
                StrCmp $4 'REG_KEY' 0 +4
                StrCpy $REGKEY "${rootKey}\$1\$2\$3"
                ${Registry::SaveKey} "$REGKEY" "${SETDIR}\Settings.reg" "/A=1 /G=1" $R0
                StrCpy $RC "1"
                goto -7

                ${registry::Close} "$0"
                ${registry::Unload}
                !macroend

                After the 'StrCpy $RC "1"' line it should jump back to the registry::find line and continue to search the registry for the next key.

                What it is doing it going back to the beginning of the opened root key and starting again, So it hits the already saved key and appends it to the regfile.

                Basically it creates a loop that creates a file that will keep writing the same info over and over again, until I kill it in the task manager.

                Is it possible for me to do this with your plugin? If so, how should I change the code above to make it work?

                thanks for all your help with this.

                Deuce

                Comment


                • #83
                  You use relative jumps through macros.
                  my functions

                  Comment


                  • #84
                    How would I go about coding something like that?

                    Right now, That is my macro. I call that macro from within my main prog script. It is my regsearch function pretty much.

                    Comment


                    • #85
                      Something like this:
                      code:
                      Function RegSearch
                      !define RegSearch `!insertmacro RegSearchCall`

                      !macro RegSearchCall rootKey searchWord
                      Push `${rootKey}`
                      Push `${searchWord}`
                      Call RegSearch
                      !macroend

                      Exch $R1
                      Exch
                      Exch $R0
                      Exch
                      Push $0
                      Push $1
                      Push $2
                      Push $3
                      Push $4
                      Push $5

                      ${registry::Open} "$R0" "/K=1 /V=0 /S=0 /B=0 /N='$R1'" $0
                      StrCmp $0 0 0 +2
                      MessageBox MB_OK "Error" IDOK end

                      find:
                      ${registry::Find} "$0" $1 $2 $3 $4
                      StrCmp $4 '' end
                      StrCpy $REGKEY "$R0\$1\$2\$3"
                      ${registry::SaveKey} "$REGKEY" "${SETDIR}\Settings.reg" "/A=1 /G=1" $5
                      StrCpy $RC "1"
                      goto find

                      end:
                      ${registry::Close} "$0"
                      ${registry::Unload}

                      Pop $5
                      Pop $4
                      Pop $3
                      Pop $2
                      Pop $1
                      Pop $0
                      Pop $R1
                      Pop $R0
                      FunctionEnd

                      my functions

                      Comment


                      • #86
                        Registry.dll left in Temp

                        I noticed while using your plugin in some of my code, that after the registry plugin is copied to the temp directory, it still is there even after the program is shutdown.

                        My point is, after running the program ten times say, I have ten temp folders all containing the registry.dll file. They add up after a time.

                        Is this something that can be fixed?

                        Thanks, Deuce.

                        PS. thanks for the help on the above function, I am still trying to find the time to try it out.

                        Comment


                        • #87
                          Hi Deuce199!

                          It seems that you don't execute the 'unload'-function by the time you've finished using the plugin.

                          Have a look at the excellent readme.txt for further information.

                          code:

                          ; **** Unload plugin ****

                          ${registry::Unload}

                          Cheers

                          Bruno

                          Comment


                          • #88
                            Unable to use plug-in, please help !

                            Both Registry.dll and PPC-Registry.dll were copied to NSIS plugin directory, but when I try to use them in my nsi file I get compilation errors:

                            When I call either Registry::Open or PC-Registry::CeRapiInit
                            both generate an invalid command error.

                            I am able to use other plugins, such as nsislog.dll, so I don't undesrtand what's different with Registry.dll and PPC-Registry.dll. Does anybody know what I am missing ? Do I need to include anything in my nsi code to use these plugins?

                            Comment


                            • #89
                              You have to:[list=1][*]Get the DLLs moved to the plugins folder (which sounds like you have)[*]Move REGISTRY.NSH to the include folder[*]Add !Include 'REGISTRY.NSH' to the top of your script.[*]Make your calls using the built-in defines rather than regular plugin calls. (Example: Use ${registry::Open}, not Registry::Open)[/list=1]
                              See the README.TXT file included with the plugin along with the included sample script.

                              Comment


                              • #90
                                Thank you very much ! It's working now !

                                Comment

                                Working...
                                X