Old 30th April 2001, 12:09   #1
dTomoyo
Junior Member
 
Join Date: Mar 2001
Location: South Korea
Posts: 26
Send a message via ICQ to dTomoyo
I need help...

code:

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
StrCmp $0 "*ebios" Win98Reg Win2000Reg
Win98Reg:
WriteRegStr HKLM "1..." "a..." "x..."
WriteRegStr HKLM "2..." "b..." "y..."
WriteRegStr HKLM "3..." "c..." "z..."
Nop
Win2000Reg:
WriteRegStr HKLM "4..." "d..." "v..."
WriteRegStr HKLM "5..." "e..." "w..."
Nop
SkipFile:
SectionEnd


------------------------------
(1) Installation success.
(2) but, Registry has Win98 and Win2000 both Reg entries.
(3) I'm using system.ini's '386enh-ebios' element for detecting Windows Version.
If exist 'ebios', it's Win9x. else Win2000.
(4) I want install a part of reg keys, Win98 or Win2000.

How do that?

Need help....


[Edited by dTomoyo on 04-30-2001 at 09:33 AM]
dTomoyo is offline   Reply With Quote
Old 30th April 2001, 16: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
Old 1st May 2001, 00:18   #3
dTomoyo
Junior Member
 
Join Date: Mar 2001
Location: South Korea
Posts: 26
Send a message via ICQ to dTomoyo
Thanks.

dTomoyo is offline   Reply With Quote
Old 1st May 2001, 02:36   #4
dTomoyo
Junior Member
 
Join Date: Mar 2001
Location: South Korea
Posts: 26
Send a message via ICQ to dTomoyo
Quote:
Originally posted by yazno
code:

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


Didn't work...
Registry has both settings.

I guess 'ReadIniStr' & 'IfErrors' command has some bug.


dTomoyo is offline   Reply With Quote
Old 1st May 2001, 03:37   #5
justin
Moderator Alumni
 
Join Date: Apr 2000
Location: USA
Posts: 315
You have to do a ClearErrors before the ReadINIStr, then do IfErrors after...

-Justin
justin 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