Old 10th January 2006, 11:06   #1
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
readRegSTr not working

Section
ReadRegStr $W HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test UninstallString
IfErrors 0 +2
ExecWait '$W /S'
SectionEnd

is there anything incorrect in this?
goab is offline   Reply With Quote
Old 10th January 2006, 11:14   #2
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
cannot compile it
Usage: ReadRegStr $(user_var: output) rootkey subkey entry
root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)
Error in script "C:\save\nsis-2.12\test.nsi" on line 41 -- aborting creation process
goab is offline   Reply With Quote
Old 10th January 2006, 11:20   #3
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Do you have
code:

Var W


definition?
Takhir is offline   Reply With Quote
Old 10th January 2006, 11:32   #4
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
i dont have,,
do i need it?
goab is offline   Reply With Quote
Old 10th January 2006, 11:33   #5
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
yep, you do.

Var W
should be placed BEFORE you use $W the first time.

but you may also just use register variables, like $0.
they are already defined by nsis itself.
Comm@nder21 is offline   Reply With Quote
Old 10th January 2006, 11:36   #6
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
ReadRegStr $0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test UninstallString
IfErrors 0 +2
ExecWait '$0 /S'
SetOutPath "$INSTDIR"
------------------------------------------------------------

is this ok?
but seems not working very well
goab is offline   Reply With Quote
Old 10th January 2006, 11:48   #7
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
my installer does not ExecWait '$0 /S'

the reg entry is exist
goab is offline   Reply With Quote
Old 10th January 2006, 12:20   #8
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
code:
ExecWait '"$0" /S'
Instructor is offline   Reply With Quote
Old 10th January 2006, 14:17   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
And your IfErrors logic is incorrect.

IfErrors [jump_if_errors] [jump_if_no_errors]

So, you are only executing the ExecWait instruction if ReadRegStr fails.
Another problem with your code (unless you have just missed it from your code snippet) is that you are not using ClearErrors before ReadRegStr. Therefore if ReadRegStr was successul and something else before caused an error then your ExecWait instruction will still not be executed.

code:

Section
ClearErrors
ReadRegStr $0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test UninstallString
IfErrors +2
ExecWait '"$0" /S'
SectionEnd


[/code]

-Stu
Afrow UK is offline   Reply With Quote
Old 10th January 2006, 17:01   #10
goab
Junior Member
 
Join Date: Jan 2006
Posts: 12
thanks for the help!
goab is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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