View Single Post
Old 30th April 2001, 17:37   #2
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

as the string in variable $x is empty when the inistring you try to read doesn't exist you should better (IMHO) use IfErrors.

and .. the way you did it in your script on win98 systems there would be always written both registry entries, after writing to the registry you should use GoTo to jump out.

try it like that:

Section "Driver 0.1"
SectionIn 12
IfFileExists $SYSDIR\drive.ax CheckFile InstFile

CheckFile:
CompareDLLVersions files\file.ax $SYSDIR\drive.ax InstFile\
SkipFile

InstFile:

SetOverwrite try
SetOutPath $SYSDIR
File files\drive.ax
RegDLL $SYSDIR\drive.ax
ReadINIStr $0 $WINDIR\system.ini 386enh ebios
IfErrors Win2000Reg Win98Reg

Win98Reg:
WriteRegStr HKLM "1..." "a..." "x..."
WriteRegStr HKLM "2..." "b..." "y..."
WriteRegStr HKLM "3..." "c..." "z..."
GoTo SkipFile

Win2000Reg:
WriteRegStr HKLM "4..." "d..." "v..."
WriteRegStr HKLM "5..." "e..." "w..."

SkipFile:
SectionEnd

i hope it works

btw:
justin, wouldn't it be fine to implement a constant in NSIS which holds the windows version ?

cu yzo
yazno is offline   Reply With Quote