Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 15th June 2009, 18:37   #1
Jon889
Junior Member
 
Join Date: Jun 2009
Posts: 2
Install depending on registry value

It is an installer for a mod for a game.
The game has a registry value setting the language of the game.
And the mod has 2 different files, one of which must be installed depending on the registry value I said above.
But the two files must never be installed at the same time.
So if the registry value equals 1 then file A is installed but not file B
And if the registry value equals 2 then file B is installed but not file A.

Is this possible to do in NSIS script?
And how is it done?

Thanks,
Jon
Jon889 is offline   Reply With Quote
Old 15th June 2009, 19:26   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
code:

!include LogicLib.nsh
Section
ReadRegDWORD $0 HKLM "Software\foo\bar" "baz"
${If} $0 < 2
File A
${Else}
File B
${EndIf}
SectionEnd



And as a final note, I'd say RTFM

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th June 2009, 21:41   #3
Jon889
Junior Member
 
Join Date: Jun 2009
Posts: 2
Well I tried that and it didn't work.
If I use this code will the item appear checked in the page where the user selects what parts to install?

Jon
Jon889 is offline   Reply With Quote
Old 16th June 2009, 12:02   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
No you have to do more than that then. You need to select the correct section using the SelectSection macro in Sections.nsh. Make sure both sections are unselected by default (/o).

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp 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