- NSIS Discussion
- how to make a common file with two choices
Archive: how to make a common file with two choices
ras french
4th December 2006 11:59 UTC
how to make a common file with two choices
hi ,
first, sorry for my bad english... i'm french but on french forum i do not find help for this ...
i have made a game and i would put online for the end of this year, so i have choose NSIS to make my installer because i want use my owne skins...
my pb is that i do not know nsis script and it is difficult for me to be ready in two weeks !
ok , my game can be installed in two languages : English and French , so i have 3 folders :
1 commun with all the game
1 french with files for french language
1 english " " " english "
;Installer Sections
Section "MOD_Version_FR" SecDummy
SetOutPath "$INSTDIR"
i have made two choice for installing this game in FR or EN but i do not want take two times the common file with the game because is very heavy !
i would that the choice "MOD_Version_EN" include only the english langage more the common file
and the same for french choice....
thanks
Red Wine
4th December 2006 12:43 UTC
I'm not sure if I got you clearly :-)
Anyway, I guess you're looking for something like this:
Create a hidden section that is always installed with the common files, one section for the english lang and one for the french lang, and ask users make their choise from your components page.
ras french
4th December 2006 13:00 UTC
thx to answers so quickly !
u have good anderstand me.
common files must be always installed , just add with langage choise the files for FR or EN lang
Red Wine
4th December 2006 13:08 UTC
There are several ways to make your installer. One could be by setting up a custom page e.g. with radio buttons and ask users for their choise. I think the proper way should be with the components page. Take a look at the included NSIS examples to find out how you'd manage it.
Red Wine
4th December 2006 15:09 UTC
OK, here comes a minimal working example, modify it to suit your needs.
I hope it is going to help you :-)
name 'sections test'
outfile 'sectest.exe'
!include "Sections.nsh"
Insttype "/CUSTOMSTRING=Please make your choise"
Insttype "English Interface"
Insttype "French Interface"
page components
page instfiles
Section "Common FIles (Required)"
SectionIn RO
# common files here
SectionEnd
Section "English Language Files" SEC_ENG
SectionIn 1
# ENG files here
SectionEnd
Section /o "French Language Files" SEC_FRA
SectionIn 2
# FRA files here
SectionEnd
Function .onInit
StrCpy $1 ${SEC_ENG}
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${SEC_ENG}
!insertmacro RadioButton ${SEC_FRA}
!insertmacro EndRadioButtons
FunctionEnd
onad
4th December 2006 17:46 UTC
Red Wine, your are always so nice to NSIS beginners, great!
ras french
5th December 2006 10:00 UTC
Thx u very much ... Red Wine
with u'r help i will be ready to distribute this game for the 25 december..... happy Chrismas and new year....
Red Wine
5th December 2006 10:14 UTC
@ onad:
Thanks, it is just that I feel beginner my self too :-)
@ ras french:
Thanks, best wishes for you too!
compmaniac
22nd February 2007 21:44 UTC
How do I make it so that on the components page, only one of the choices can be selected, and not none or all?
############################################################################################
# NSIS Installation Script created by NSIS Quick Setup Script Generator v1.09.18
# Entirely Edited with NullSoft Scriptable Installation System
# by Vlasis K. Barkas aka Red Wine Sep 2006
############################################################################################
!define APP_NAME "asdf"
!define COMP_NAME "asdf"
!define WEB_SITE "http://www.domain.com"
!define VERSION "00.00.00.00"
!define COPYRIGHT "asdf"
!define DESCRIPTION "asdf"
!define LICENSE_TXT "readme.txt"
!define INSTALLER_NAME "setup.exe"
!define INSTALL_TYPE "SetShellVarContext current"
!define REG_ROOT "HKCU"
######################################################################
VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
######################################################################
SetCompressor ZLIB
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${UNINSTALL_PATH}" "UninstallString"
InstallDir "$PROGRAMFILES\"
######################################################################
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!ifdef LICENSE_TXT
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
######################################################################
Section "1"
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
CopyFiles "$EXEDIR\files1\*.*" "$INSTDIR\files"
SectionEnd
Section "2"
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
CopyFiles "$EXEDIR\files2\*.*" "$INSTDIR\files"
SectionEnd
Section "3"
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
CopyFiles "$EXEDIR\files3\*.*" "$INSTDIR\files"
SectionEnd
Red Wine
22nd February 2007 21:49 UTC
See the included example one-section.nsi
compmaniac
22nd February 2007 22:33 UTC
Thanks, but how do I make the installer set a specific choice to be already ticked off?
Red Wine
22nd February 2007 22:39 UTC
Section /o is unchecked by default.
Please edit your post above and remove my e-mail address from there!
compmaniac
22nd February 2007 22:44 UTC
Originally posted by Red Wine
Section /o is unchecked by default.
Please edit your post above and remove my e-mail address from there!
Oh, sorry. What a coincidence! You're Red Wine!
Red Wine
22nd February 2007 22:48 UTC
Thanks! There is no need to feed spammers ;)
Predatorian
27th August 2013 19:42 UTC
Hello, I know this is an old post, but I followed a Wiki post to this page, and I am having problems understanding all the options and being able to select more than just one check box. Is it even possible?