Old 26th October 2009, 14:57   #161
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally posted by Brewster333
Hello! I need to delete keys from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB key. Standard NSIS function can't do this.
Yes it can. You probably need administrative priviledges.
MSG is offline   Reply With Quote
Old 26th October 2009, 15:28   #162
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
Quote:
Originally posted by MSG
Yes it can. You probably need administrative priviledges.
I've test it (on Windows Vista). But user with administrative rights can't delete nodes in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\. Using RegSetKeySecurity (WinAPI) is needed to do this I suppose...
Brewster333 is offline   Reply With Quote
Old 27th October 2009, 09:52   #163
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
No ideas about my problem?

--- EDIT ---

I've found accidently found the problem.

I'm executing RestoreKey, logging a related status message and deleting the file used by the plug-in. If I don't delete the file or Sleep some ms, everything works fine.

Last edited by ChocJunkie; 27th October 2009 at 12:51.
ChocJunkie is offline   Reply With Quote
Old 29th October 2009, 09:16   #164
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
I came to notice no flag/constant indicates if the header file has already been included.
What's about include the !ifndef...!define comands in the plugin? Or does no one else need it?

CJ
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 11:13   #165
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
Unicode NSIS update

Would there be any chance to get an update of Registry.dll what works with Unicode NSIS ?

Thanx !
gringoloco023 is offline   Reply With Quote
Old 16th December 2009, 15:16   #166
carillan
Junior Member
 
Join Date: Dec 2009
Posts: 1
Multivalues in a REG_MULTI_SZ key

I'm trying to create a REG_MULTI_SZ key with several values, but i have no way to give it more than one value. How should I give the values? I've tried separating with "\n" and "\0" but it didn't work.

I use this instruction:
${registry::Write} "HKCU\${COMPANY_REGKEY}\Settings" "Name" "Generic Value" "REG_MULTI_SZ" $R0
Thaks in advance!
carillan
carillan is offline   Reply With Quote
Old 19th December 2009, 13:19   #167
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
REG_MULTI_SZ read/write

I've included some scripts which should do the job !

The reader I've used myself and works fine, but you'll have to make some modifications to store the value into a string !

The writer I haven't tried jet !
gringoloco023 is offline   Reply With Quote
Old 5th January 2010, 07:05   #168
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Has the 64bit problem been solved? Or are there any ideas for a workaround?

CJ
ChocJunkie is offline   Reply With Quote
Old 30th January 2010, 22:41   #169
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
Recompiled for Unicode NSIS

I recompiled it my self in the end !

Although I tested it thoroughly, there could still be some minor issues.
Let me know if there is any behavior difference compared with the ansi version.

portableapps.com/node/21879

By the way: MULTI_SZ needs '$\n'
gringoloco023 is offline   Reply With Quote
Old 20th December 2010, 08:47   #170
mj_blue
Junior Member
 
Join Date: Sep 2007
Posts: 13
open finding blank entry when further files exist

Hi,

I am trying to clean up the registry from some previous bad installations and have about 30 entries registry keys called:

HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\@antixlabs.com/npagp,version={VERSION}

where version varies.

I wanted to loop through and delete all these but currently when I do this it seems to find 9 entries and then find returns blank entry. If I run it again it find more entries until another blank entry is returned.

My code is below, am I doing something wrong?

PHP Code:
${registry::Open"HKLM\SOFTWARE\MozillaPlugins" '/K=1 /V=0 /S=0 /NS="@antixlabs"' $0
    StrCmp 
$0 0 0 loopkey
    MessageBox MB_OK 
"Error" IDOK closemozillakeyfind
    
goto closemozillakeyfind

    loopkey
:
    ${
registry::Find"$0" $$$$4
    StrCmp 
$'' closemozillakeyfind 0
        
${registry::DeleteKey"HKEY_LOCAL_MACHINE\$1\$2" $R1
        
goto loopkey

        closemozillakeyfind
:
    ${
registry::Close"$0"
    
${registry::Unload
Thanks for any help in this

Mark
mj_blue is offline   Reply With Quote
Old 6th February 2011, 11:02   #171
sentromed
Junior Member
 
Join Date: Feb 2011
Posts: 4
Instructor,

Please add support of "SetRegView 64" or something similar to it. I used v3.6.
I am running 32-bit installer on 64-bit Windows system. My issue is that value is wirtten to "Software\Wow6432Node\" instead of "Software\"

Thanks,
Valery.
sentromed is offline   Reply With Quote
Old 6th February 2011, 22:11   #172
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
This plug-in needs updating.
Quote:
For NSIS plug-ins, the extra_parameters->g_exec_flags->alter_reg_view field will be set to KEY_WOW64_64KEY if the calling script used SetRegView 64. The plug-in would need to use this field accordingly. I do not know if the Registry plug-in does this, but if not it needs to be modified to do so.
Stu
Afrow UK is offline   Reply With Quote
Old 31st July 2011, 21:14   #173
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
using NSIS Unicode version

Did any of you used this plugin with the Unicode version of NSIS?
I don't know why but it doesn't work. Could someone give me a clue in this?

Thanks,
Isawen

isawen is offline   Reply With Quote
Old 1st August 2011, 09:14   #174
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
You will need a unicode version of the plug-in

... to use in Unicode Nsis

On the following web page their are a few converted plug-ins, including the Registry one:
http://portableapps.com/node/21879
gringoloco023 is offline   Reply With Quote
Old 1st August 2011, 15:50   #175
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
Quote:
Originally Posted by gringoloco023 View Post
... to use in Unicode Nsis

On the following web page their are a few converted plug-ins, including the Registry one:
http://portableapps.com/node/21879
Thanks gringoloco023, you did a good job with it.
At a first try the plugin methods are working. Is there any drawback in this unicode plugin?

isawen is offline   Reply With Quote
Old 2nd August 2011, 07:32   #176
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
No drawbacks that I know of.

I done a basic test on every function after I converted it.

That said, we only used it in the portableapps.com launchers.
The launchers basically only use the following functions:
  1. CopyKey
  2. MoveKey
  3. SaveKey
  4. RestoreKey
And that on Windows XP to Windows 7 and Wine.

So using any other function you'd wanna be a little bit more carefull, but it should be fine.

regards
gringoloco023 is offline   Reply With Quote
Old 7th August 2011, 12:02   #177
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
Added: full unicode support on NSIS Unicode.
Added: support for SetRegView 64.
Added: export key contents to the file in unicode "Windows Registry Editor Version 5.00" format.


Registry plugin v4.0
Instructor is offline   Reply With Quote
Old 11th August 2011, 22:26   #178
vicokoby
Junior Member
 
Join Date: Jun 2011
Posts: 15
The version 4 convert string to hex different to version 3.5, this is a bug?
vicokoby is offline   Reply With Quote
Old 12th August 2011, 19:06   #179
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
Added: separate functions:
  • ${registry::StrToHexA} - convert string to ansi hex values;
  • ${registry::StrToHexW} - convert string to unicode hex values.
    For backward compatibility: ${registry::StrToHex} is the same as ${registry::StrToHexA}.
Added: separate functions:
  • ${registry::HexToStrA} - convert ansi hex values to string;
  • ${registry::HexToStrW} - convert unicode hex values to string.
    For backward compatibility: ${registry::HexToStr} is the same as ${registry::HexToStrA}.

Registry plugin v4.1
Instructor is offline   Reply With Quote
Old 12th August 2011, 20:11   #180
vicokoby
Junior Member
 
Join Date: Jun 2011
Posts: 15
Thanks!
vicokoby is offline   Reply With Quote
Old 13th August 2011, 18:04   #181
vicokoby
Junior Member
 
Join Date: Jun 2011
Posts: 15
The Version 4 always need elevation?, The gringoloco modified version allow make changes in hkcu root key without elevation, the new version 4.x not allow make changes in any key without elevation.
vicokoby is offline   Reply With Quote
Old 14th August 2011, 07:44   #182
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
vicokoby
Quote:
Originally Posted by Readme.txt
Note:
${registry::RestoreKey} simply exec regedit: regedit /s "[file]"
gringoloco023 wrote own "registry::RestoreKey" implementation without regedit execution.
Instructor is offline   Reply With Quote
Old 14th August 2011, 09:08   #183
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
${registry::RestoreKey}

Quote:
gringoloco023 wrote own "registry::RestoreKey" implementation without regedit execution.
We had a few reasons for that.
In the ANSI days we never used ${registry::RestoreKey} cause it doesn't wait for regedit to finish it's job and somehow (I can't remember now) it was preferable to use Reg.exe.
Like this:
PHP Code:
 nsExec::ExecToStack `"$SYSDIR\reg.exe" import "${_FILE}"
The main reason I rewrote the ${registry::RestoreKey} was that Wine has a bug in regedit / Reg.exe with Windows Registry Editor Version 5.00 files. It crashes Wine.

Still, I'm not really certain that vicokoby was refering to the ${registry::RestoreKey} function.

Ps. : Do not be to impressed by the code, it was basically my first C project .

Edit: another bug we found was, when trying to MoveKey from HKLM to HKCU without the needed privileges, MoveKey returned an error, but copied the whole key to HKCU anyway while not being able to delete the HKLM key.
We made a quick fix for it in our launcher code. see: http://portableapps.hg.sourceforge.n...f2d5a0f#l1.130

regards

Last edited by gringoloco023; 14th August 2011 at 11:18.
gringoloco023 is offline   Reply With Quote
Old 26th August 2011, 09:25   #184
DraGula0
Junior Member
 
Join Date: Mar 2008
Posts: 13
Hello !
This script is amazing for registry manipulation.

But on the research I can not process the results.
I would find keys "Desktop Integration" in many places (in the hive Key Users), and then modify a String value that can be found here "\Desktop Integration \ 1 \ URL"
How can I get the result of "Desktop Integration" and then add the key "1" to finally fulfill my pre-field "URL"?
Is it possible?

Thank you ... I'm lost!
DraGula0 is offline   Reply With Quote
Old 16th September 2011, 00:17   #185
highend
Junior Member
 
Join Date: Sep 2011
Posts: 12
@gringoloco023

So your modified version of the registry plugin automatically waits until a command (savekey, restorekey, etc.) is fully executed (and I don't have to use sleep commands after such a command)?

Apart from that, thanks for providing it, I just stumbled upon the issue (with the original plugin) that I can't use restorekey with RequestExecutionLevel user. It won't import a .reg file even if it contains only hkcu entries and because I use NSIS to make portable setups this is a big showstopper...
highend is offline   Reply With Quote
Old 11th October 2011, 12:37   #186
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
Delete
Instructor is offline   Reply With Quote
Old 18th October 2011, 03:06   #187
ChristianGeek
Junior Member
 
Join Date: Oct 2011
Posts: 1
Can't read MachineGuid

I'm attempting the following but just getting blank strings for the value and type:

${registry::Read} "HKLM\SOFTWARE\Microsoft\Cryptography" "MachineGuid" $MACHGUID $1

However the following returns 0, indicating the key exists:

${registry::KeyExists} "HKLM\SOFTWARE\Microsoft\Cryptography" $2

Is this key not readable for some reason?

TIA.
ChristianGeek is offline   Reply With Quote
Old 17th November 2011, 15:39   #188
David Pi
Junior Member
 
Join Date: Sep 2011
Posts: 5
Hi Instructor! I love your plugin! Would you add support of 64-bit keys? 'SetRegView 64' don't work. I need to use ${registry::movekey} on some 64-bit keys.

Thanks!

Regards,
David Pi

Add: I've just download the version 4.1. And found it works perfect with 'SetRegView 64'. I've been using an old version before. Sorry for this post!
David Pi is offline   Reply With Quote
Old 8th January 2012, 22:20   #189
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
solved
Brummelchen is offline   Reply With Quote
Old 8th August 2012, 10:55   #190
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Quote:
Originally Posted by David Pi View Post
Hi Instructor! I love your plugin! Would you add support of 64-bit keys? 'SetRegView 64' don't work. I need to use ${registry::movekey} on some 64-bit keys.

Thanks!

Regards,
David Pi

Add: I've just download the version 4.1. And found it works perfect with 'SetRegView 64'. I've been using an old version before. Sorry for this post!

thank you.. i hadn't noticed there was a newer version...
works great under 64-bit..

however.. now it's incompatible with XP?
i have to make two separate launchers for my portableapps
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 8th August 2012, 11:21   #191
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What have you found that suggests that it isn't compatible with XP? The flag that is set by SetRegView 64 is ignored on non 64-bit OS's.

Stu
Afrow UK is offline   Reply With Quote
Old 8th August 2012, 12:06   #192
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Thumbs up

Quote:
Originally Posted by Afrow UK View Post
What have you found that suggests that it isn't compatible with XP? The flag that is set by SetRegView 64 is ignored on non 64-bit OS's.

Stu
i was just logging in to edit my comment..
it's not the registry plugin..
it was my fault..
the portableapp was already installed on the host machine i was testing and didn't realize.

Sorry about that..

Setregview 64 works great with 4.1..
no complaints here.
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 8th January 2013, 04:41   #193
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Something wrong with Hex?

anyone know why i can't save hex from the registry?

PHP Code:
[HKEY_CURRENT_USER\Software\App\Preferences]
"Language"="en_US"
"Preferences"
=hex:01
"Version"=hex:03,00,00,00
"Window"=hex(7):62,00,72,00,69,00,64,00,67,00,65,00,3a,00,6c,00,69,00,62,00,\
  
72,00,61,00,72,00,79,00,3a,00,2f,00,00,00,62,00,72,00,69,00,64,00,67,00,65,\
  
00,3a,00,66,00,73,00,3a,00,66,00,69,00,6c,00,65,00,3a,00,2f,00,2f,00,2f,00,\
  
3a,00,3a,00,7b,00,32,00,30,00,44,00,30,00,34,00,46,00,45,00,30,00,2d,00,33,\
  
00,41,00,45,00,41,00,2d,00,31,00,30,00,36,00,39,00,2d,00,41,00,32,00,44,00,\
  
38,00,2d,00,30,00,38,00,30,00,30,00,32,00,42,00,33,00,30,00,33,00,30,00,39,\
  
00,44,00,7d,00,00,00,62,00,72,00,69,00,64,00,67,00,65,00,3a,00,66,00,73,00,\
  
3a,00,66,00,69,00,6c,00,65,00,3a,00,2f,00,2f,00,2f,00,43,00,3a,00,2f,00,55,\
  
00,73,00,65,00,72,00,73,00,2f,00,44,00,4a,00,25,00,32,00,30,00,52,00,55,00,\
  
44,00,45,00,42,00,4f,00,59,00,53,00,45,00,53,00,00,00,62,00,72,00,69,00,64,\
  
00,67,00,65,00,3a,00,73,00,70,00,65,00,63,00,69,00,61,00,6c,00,3a,00,64,00,\
  
65,00,73,00,6b,00,74,00,6f,00,70,00,00,00,62,00,72,00,69,00,64,00,67,00,65,\
  
00,3a,00,66,00,73,00,3a,00,66,00,69,00,6c,00,65,00,3a,00,2f,00,2f,00,2f,00,\
  
43,00,3a,00,2f,00,55,00,73,00,65,00,72,00,73,00,2f,00,44,00,4a,00,25,00,32,\
  
00,30,00,52,00,55,00,44,00,45,00,42,00,4f,00,59,00,53,00,45,00,53,00,2f,00,\
  
44,00,6f,00,63,00,75,00,6d,00,65,00,6e,00,74,00,73,00,00,00,62,00,72,00,69,\
  
00,64,00,67,00,65,00,3a,00,66,00,73,00,3a,00,66,00,69,00,6c,00,65,00,3a,00,\
  
2f,00,2f,00,2f,00,43,00,3a,00,2f,00,55,00,73,00,65,00,72,00,73,00,2f,00,44,\
  
00,4a,00,25,00,32,00,30,00,52,00,55,00,44,00,45,00,42,00,4f,00,59,00,53,00,\
  
45,00,53,00,2f,00,50,00,69,00,63,00,74,00,75,00,72,00,65,00,73,00,00,00,00,\
  
00 

but there is more in the registry..
no matter what i try. .. it refuses to save the rest..?

is this a glitch or am i missing something?

What's werid.. is if i import first.. it saves correctly..


By the way.. here's my code:
PHP Code:
    StrCpy $R0 0 
    
${Do}
        
EnumRegKey $R1 `${_ROOT}` `${_KEY}` $R0
        
;MessageBox MB_OK `DEBUG: $R1`
        ${If} 
$R1 != ""
            
registry::_SaveKey /NOUNLOAD `${_ROOT}\${_KEY}\$R1` `$SETTINGSDIRECTORY\${APPNAME}.reg` `/A=1`
            
Pop $0
            IntOp $R0 $R0 
1
        
${EndIf}
    ${
LoopWhile$R1 != "" 

Last edited by PoRtAbLe_StEaLtH; 8th January 2013 at 05:19. Reason: Added Code
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 8th January 2013, 05:59   #194
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Maybe related to NSIS_MAX_STRLEN?
MSG is offline   Reply With Quote
Old 8th January 2013, 06:09   #195
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Quote:
Originally Posted by MSG View Post
Maybe related to NSIS_MAX_STRLEN?
thank you.. im starting to believe this is the case.

i believe it's due to "null terminating strings".

As you can see in the example above..
Each Value has multiple "null terminating strings".
NSIS stops at the first "null".

is it possible to bypass this restriction ?
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 8th January 2013, 13:04   #196
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
RegOpen Error

just tried RegOpen:

PHP Code:
    ${registry::Open"HKCU\SOFTWARE\App\Preferences" "/K=0 /V=1 /S=1" $0
    StrCmp 
$0 0 0 loop
    MessageBox MB_OK 
"Error" IDOK close

    loop
:
    ${
registry::Find"$0" $$$$4

    MessageBox MB_OKCANCEL 
'$$1    "path"   =[$1]$\n\
                $$2    "value" =[$2]$\n\
                $$3    "string" =[$3]$\n\
                $$4    "type"   =[$4]$\n\
                                $\n\
                Find next?' 
IDOK loop
    close


the first value is read correctly..
but the rest are shown as [] for value, string, and type.


from my research.. MULTI_SZ seems to be very hard for NSIS to handle.
I've found reading & writing MULTI_SZ routines..
but those are for specific keys.

Last edited by PoRtAbLe_StEaLtH; 8th January 2013 at 13:39. Reason: added screen
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 12th January 2013, 06:17   #197
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Found Solution

unbelievably.. using MS-DOS is the solution for MULTI_SZ that exceed MaxLengthStr

To export/save:
PHP Code:
ExpandEnvStrings `$0` %COMSPEC%
nsExec::Exec `"$0" /c reg export "HKCU\Software\App\Preferences" "$SETTINGSDIRECTORY\settings.reg"
To import file:
PHP Code:
ExpandEnvStrings `$0` %COMSPEC%
nsExec::Exec `"$0" /c reg import "$SETTINGSDIRECTORY\settings.reg"
To import specific values:
PHP Code:
@reg.exe add "HKCU\Software\App\Preferences" /"MySoftware" /"Software1"\0"Software2"\0"Software3"\/t REG_MULTI_SZ /
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 25th October 2013, 10:09   #198
highend
Junior Member
 
Join Date: Sep 2011
Posts: 12
Is there any chance that the bug (at least I call it a bug...) that it's unable to import .reg files to HKEY_CURRENT_USER without elevation will get fixed?

Apart from that it's a perfect addon!
highend is offline   Reply With Quote
Old 16th July 2014, 16:05   #199
rvintonyak
Junior Member
 
Join Date: Jul 2014
Posts: 3
Hi Instructor,

Does this plugin support unicode or it is for ANSI only?
rvintonyak is offline   Reply With Quote
Old 16th July 2014, 16:33   #200
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,844
Quote:
Originally Posted by rvintonyak View Post

Does this plugin support unicode or it is for ANSI only?
If there is only one .dll in the .zip file then it is most likely ANSI only...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
plug-in, registry

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump