Old 6th March 2006, 16:01   #1
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
Using If Statements

Hey guys

I need some help with NSIS. I'm reading some variables from registry and if the variable doesn't exists i need to read it from some other locations in registry.

i'm using ReadRegDWORD command to read registry and this is how my command looks like

ReadRegDWORD $PROGDIR HKCU "Software\Microsoft\Office\9.0\Word\Options" "PROGRAMDIR"

where $PROGDIR is a variable that i have defined in the script

ReadRegDWORD would set this variable as empty if it doesn't find it. so in that case i have to serach it from some other location. for this purpose i tried to use the following statement

${If} $PROGDIR == ""
ReadRegDWORD $PROGDIR HKCU "Software\Microsoft\Office\10.0\Word\Options" "PROGRAMDIR"
${ElseIf} $PROGDIR == ""
ReadRegDWORD $PROGDIR HKCU "Software\Microsoft\Office\11.0\Word\Options" "PROGRAMDIR"
${EndIf}

but while compiling this script i'm getting the error Invalid Command ${If}

Can someone help me to find what i'm doing wrong.

Thanks very much
sam20_78 is offline   Reply With Quote
Old 6th March 2006, 16:05   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Add the following at the top of your script:
code:
!include LogicLib.nsh

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 6th March 2006, 18:34   #3
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
It works now Thanks very much.
sam20_78 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