Old 11th November 2014, 08:30   #201
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 172
Hi!

I had the following problem. In my script I delete a registry key (with NSIS commands), then later in my script I check if the key exists, using registry::_KeyExists. Normally the check comes very near after the deletion. The problem is that the result from _KeyExists is 0 that means the key exists, but it doesn't exist anymore (I can see this with Regedit). But if I put "sleep 5000" before the check the results is correct, the plug-in returns -1. What is the explanation about this?

[edit #1]
I see that the information from me is not good enough. Actually I delete the registry key in separate installer, called in silent mode. I call it with ExecWait command and when it exists, I check if the registry key exists. Only in this situation I have a problem.

[edit #2]
Some additional information. I call the integrated installer (this one that I call in silent mode) several times. I saw that once (probably, because it opens some cmd-windows for short time) that the script runs after ExecWait, but my integrated installer is still working... This can explain the behavior that I mentioned before, but how I can be sure that the installer, called in silent mode (also compiled with NSIS) is finished? I thought that it is enough to call it with ExecWait...
TrifonovS is online now   Reply With Quote
Old 11th November 2014, 14:51   #202
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 172
I understood what is the reason. The integrated installer/uninstaller is copied to temp-folder and started from there (typical behavior). ExecWait exist after the started of the second executable. If I already know the problem, Google can help me to fin a solution.
TrifonovS is online now   Reply With Quote
Old 16th November 2014, 21:49   #203
JaysonPrichard
Junior Member
 
Join Date: Nov 2014
Posts: 2
Registry plugin v4.1 triggers AVG virus

Just downloaded the NSIS registry plugin (http://nsis.sourceforge.net/Registry_plug-in). Tried to install it, and AVG alerted it was infected with a virus (Trojan horse Generic_s.CNY).

Anybody else have this?
JaysonPrichard is offline   Reply With Quote
Old 16th November 2014, 23:06   #204
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
Quote:
Originally Posted by JaysonPrichard View Post
Just downloaded the NSIS registry plugin (http://nsis.sourceforge.net/Registry_plug-in). Tried to install it, and AVG alerted it was infected with a virus (Trojan horse Generic_s.CNY).

Anybody else have this?
"Generic" means it is probably a false positive. Try uploading the plugin to VirusTotal to ease your mind...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th March 2015, 16:39   #205
piaranda
Junior Member
 
Join Date: Mar 2015
Posts: 3
CRASH in VERSION 4.1 with NSIS 2.3

Hello, I´m executing a script with Registry.dll (Windows 8) to look for some keys under HKU node, but for some reason, application crashes in a find call (when some nodes have already been found). I have tried to run RegistryTest.exe with the example of "Search for value 'Content Type'", but replacing HKEY_CURRENT_USER with HKEY_USERS and the result is the same: at some point, app crashes.

Anyone has the same problem or can provide some info about this??

Thank you in advance...
piaranda is offline   Reply With Quote
Old 12th March 2015, 16:56   #206
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
Quote:
Originally Posted by piaranda View Post

Anyone has the same problem or can provide some info about this??
Are you sure you are using NSIS v2.3? That is very old, try upgrading to 2.46...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th March 2015, 09:12   #207
piaranda
Junior Member
 
Join Date: Mar 2015
Posts: 3
Plugin crash....

Excuse me, yes, I´m using NSIS 2.46, but if I open "About" window in MakeNsisW.exe it tells me version 2.3...
piaranda is offline   Reply With Quote
Old 23rd March 2015, 15:39   #208
piaranda
Junior Member
 
Join Date: Mar 2015
Posts: 3
Registry plugin crash

Has anyone experienced this problem with registry plugin when trying to search in HKEY_USERS node???

Thanks in advance.
piaranda is offline   Reply With Quote
Old 11th July 2015, 20:54   #209
mikhail78
Junior Member
 
Join Date: Jul 2015
Posts: 2
registry::KeyExists returns invalid results

Hello,

For some reason, the KeyExists function of the registry plugin returns -1 on registry keys that exist.

For example, here are 4 registry keys that I've copied from my registry. Out of those, registry::KeyExists returns 0 for the first two keys, and -1 for the last two keys (wrong, should also be 0).

code:

${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Fontcore" $8
MessageBox MB_OK "$8" # Prints 0
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX" $8
MessageBox MB_OK "$8" # Prints 0

${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CCleaner" $8
MessageBox MB_OK "$8" # Prints -1
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Loki" $8
MessageBox MB_OK "$8" # Prints -1



I'm using NSIS v3.0b0, and the latest version of the plugin (v4.1) available.
Also, the installer is a Unicode one.

Any help or suggestions would be greatly appreciated.
mikhail78 is offline   Reply With Quote
Old 11th July 2015, 23:16   #210
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
Quote:
Originally Posted by mikhail78 View Post
For some reason, the KeyExists function of the registry plugin returns -1 on registry keys that exist.
Is this a 64-bit system?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th July 2015, 16:43   #211
mikhail78
Junior Member
 
Join Date: Jul 2015
Posts: 2
Quote:
Is this a 64-bit system?
Anders, thank you for your response. The problem was indeed related to 64-bit Windows, and went away after I had re-read this thread, and figured out that I needed to add SetRegView 64 to the script.

If I may make a suggestion to those who maintain the documentation for the registry plugin - you might want to consider adding some explanations regarding the 32/64-bit modes, as some users (as myself) might be unaware of the SetRegView command, or believe (falsely) that it only affects the built-in NSIS commands (EnumRegValue, etc.)

Again, thank you for your help.
mikhail78 is offline   Reply With Quote
Old 5th September 2015, 06:24   #212
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
Quote:
Originally Posted by rvintonyak View Post
Does this plugin support unicode or it is for ANSI only?
Yes, last version (4.1 at the moment) fully unicode compatible (ofcourse you should use unicode NSIS).
Quote:
Originally Posted by piaranda View Post
Hello, I´m executing a script with Registry.dll (Windows 8) to look for some keys under HKU node, but for some reason, application crashes in a find call (when some nodes have already been found). I have tried to run RegistryTest.exe with the example of "Search for value 'Content Type'", but replacing HKEY_CURRENT_USER with HKEY_USERS and the result is the same: at some point, app crashes.
Not reproduced. In RegistryTest.nsi specified HKEY_LOCAL_MACHINE not HKEY_CURRENT_USER. Do you sure you use original RegistryTest.nsi code?
Instructor is offline   Reply With Quote
Old 30th May 2016, 14:31   #213
Carl_Zeiß
Junior Member
 
Join Date: Feb 2016
Posts: 5
Does it work with NSIS 3?
Carl_Zeiß is offline   Reply With Quote
Old 30th May 2016, 14:36   #214
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
Quote:
Originally Posted by Carl_Zeiß View Post
Does it work with NSIS 3?
The plug-in API has not changed at all for NSIS 3.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 31st May 2016, 09:06   #215
Carl_Zeiß
Junior Member
 
Join Date: Feb 2016
Posts: 5
Ok, thanks.
I get an errormessage while compiling my script with NSIS 3.0rc1, and i have no idea:

code:

[...]
!include: "C:\Program Files (x86)\NSIS\Include\Registry.nsh" (ACP)
!define: "registry::Open"="!insertmacro registry::Open"
...
!define: "registry::Unload"="!insertmacro registry::Unload"
!include: closed: "C:\Program Files (x86)\NSIS\Include\Registry.nsh"
[...]
!insertmacro: registry::KeyExists
Plugin not found, cannot call registry::_KeyExists
Error in macro registry::KeyExists on macroline 1
[...]



this ist the code within the script:

code:

${registry::KeyExists} "HKEY_LOCAL_MACHINE\....\PendingFileNameOperations" $R0

Carl_Zeiß is offline   Reply With Quote
Old 31st May 2016, 10:38   #216
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
It says it right there ...Plugin not found... Put the plugin in the correct subfolder under NSIS\Plugins\...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th December 2016, 15:10   #217
ConnivingCritic
Junior Member
 
Join Date: Dec 2016
Posts: 3
Registry plugin v4.1 reading past 3rd subkey.

Hello,
This beginner doesn't know what I'm possibly doing wrong, but I cannot get the KeyExists to recognize a key past the third sub key? or read a value past a third key. Can anyone help me? I'm modifying the RegistryTest example from the example to test.

${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server" $R0
$RO = -1

${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products" $R0
$RO = 0

${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Btrieve Requester\Version 11\Settings" $R0
$RO = -1

I also get no value info past the third subkey reg_sz value.
${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server\InstallInfo" "ProductVersion" $R0 $R1
MessageBox MB_OK 'registry::Read$\n$\n\
$$R0 "string" =[$R0]$\n\
$$R1 "type" =[$R1]$\n'
ConnivingCritic is offline   Reply With Quote
Old 30th December 2016, 01:07   #218
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
Quote:
Originally Posted by ConnivingCritic View Post
I cannot get the KeyExists to recognize a key past the third sub key?
That sounds very strange. Is this a 64-bit version of Windows? If so, you have to remember that there are two views of the registry, 64-bit and 32-bit and they are not always the same. What you see in Regedit might not be the same as what a 32-bit program sees. You could run %windir%\syswow64\regedit.exe to get the 32-bit version or maybe try Process Monitor to see if the key is really there or not. Or simply add a WriteRegStr first so you know the data is there.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th January 2017, 20:52   #219
ConnivingCritic
Junior Member
 
Join Date: Dec 2016
Posts: 3
Registry plugin not reading

I agree this is very strange and makes no sense. The plugin will not read for me the Pervasive.SQL NT Server. I have tested the below code with the below registry on a 64bit win8 and win10. I double checked that I have the plugin registry.dll and Include Registry.nsh. Here is the registry I'm trying to read: and below its the code I'm using. I have no idea what I am doing wrong. I really would like the ability to read the registry keys below. Can you help me?
Thank you!
------------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\OneTwoThree]
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\OneTwoThree\InstallInfo]
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL Client]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL Client\InstallInfo]
"ProductVersion"="12.00.160"
@=""
"InstallData"="C:\\ProgramData\\Actian\\PSQL\\"
"InstallDir64"="C:\\Program Files\\Actian\\PSQL\\"
"InstallDir"="C:\\Program Files (x86)\\Actian\\PSQL\\"
"VersionLevel"="12.00"
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server]
[HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server\InstallInfo]
"ProductVersion"="12.11.011"
@=""
"InstallData"="C:\\ProgramData\\Actian\\PSQL\\"
"InstallDir64"="C:\\Program Files\\Actian\\PSQL\\"
"InstallDir"="C:\\Program Files (x86)\\Actian\\PSQL\\"
"VersionLevel"="12.11"
-------------------------------------
;NSIS code
!define PRODUCT_NAME "Configure PSQL 12.11"
!define PRODUCT_VERSION "PSQL 12.11 "
!include "LogicLib.nsh"
!include "Registry.nsh"
Page instfiles
;---------------------------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Configure PSQL 12.11.exe"
InstallDir "$DESKTOP"
ShowInstDetails nevershow
Section "MainSection" SEC01
;--------------
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\OneTwoThree\InstallInfo" $R0
MessageBox MB_OK "registry::KeyExists$\n$\n\
Errorlevel: [$R0] OneTwoThree exists"
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL Client\InstallInfo" $R0
MessageBox MB_OK "registry::KeyExists$\n$\n\
Errorlevel: [$R0] Client exists"
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server\InstallInfo" $R0
MessageBox MB_OK "registry::KeyExists$\n$\n\
Errorlevel: [$R0] Server exists"
${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL Client\InstallInfo" "ProductVersion" $R0 $R1
MessageBox MB_OK 'registry::Read$\n$\n\
$$R0 "string" =[$R0]$\n\
$$R1 "type" =[$R1]$\n'
${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Pervasive Software\Products\Pervasive.SQL NT Server\InstallInfo" "ProductVersion" $R0 $R1
MessageBox MB_OK 'registry::Read$\n$\n\
$$R0 "string" =[$R0]$\n\
$$R1 "type" =[$R1]$\n'

SectionEnd
Attached Files
File Type: nsi Configure PSQL 12v2.nsi (1.5 KB, 50 views)
File Type: txt registrykey.txt (2.1 KB, 76 views)
ConnivingCritic is offline   Reply With Quote
Old 9th January 2017, 17:01   #220
ConnivingCritic
Junior Member
 
Join Date: Dec 2016
Posts: 3
Solved - SetRegView 64 solved my problem with using the Registry Plugin. Thank you Anders for clueing me in to how the plugin was reading. The registry keys I wanted were only found in the x64bit registry and not in the x86bit. Which the Registry Plugin was reading only the 32bit by default. By using the SetRegView 64 the Registry Plugin reads it correctly.
ConnivingCritic is offline   Reply With Quote
Old 22nd November 2017, 19:42   #221
GustavoHennemann
Junior Member
 
Join Date: Nov 2017
Posts: 2
Hi guys,
I'm very new in NSIS and I'm trying to find a string in the windows registry that identifies my application, but I'm facing problems with win32 and win64.
In my pc (Win10 64bits) I have the following registries:
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QUANT MetaTrader 5
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QUANT MetaTrader 5 TRIAL
and
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MetaTrader 5
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MetaTrader 5 Terminal
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MetaTrader XP
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QUANT MetaTrader 5 TRIAL

I'm using this function to find the regs:
* APP_NAME_MT5 = "Metatrader"

Function SearchValueReg
Var /GLOBAL schHandle
Var /GLOBAL schPath
Var /GLOBAL schValue
Var /GLOBAL schString
Var /GLOBAL schType
Var /GLOBAL insFullPath
Var /GLOBAL insPath

SetRegView 32
${registry::Open} "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" "/K=0 /V=1 /S=0 /B=1 /NI=${APP_NAME_MT5}" $schHandle

${Do}
${registry::Find} "$schHandle" $schPath $schValue $schString $schType
${If} $schType != ""
MessageBox MB_OK "$schValue"
${EndIf}
${LoopUntil} $schType == ""

${registry::Close} "$srcHandle"
${registry::Unload}

FunctionEnd

if I use SetRegView 32, I got 2 registries.
But, if I use SetRegView 64, I got nothing.

What I'm doing wrong?

Thanks in advance.
GustavoHennemann is offline   Reply With Quote
Old 23rd November 2017, 15:54   #222
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,811
"/K=0 /V=1 ..." means you are searching for values, not keys. If you want to search for values then make sure all the DisplayName values actually contain your string.

If it still does not work, make sure you are using the latest version of the plug-in and watch it access keys with Process Monitor to see where it actually reads.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 28th November 2017, 11:17   #223
GustavoHennemann
Junior Member
 
Join Date: Nov 2017
Posts: 2
Thanks @Anders, I changed the search to "/K=1 /V=0" and works very well!

Thanks
GustavoHennemann 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