2002-09-24 20:05:19 +00:00
;NSIS Modern Style UI version 1.20b
2002-09-09 16:33:44 +00:00
;Multilanguage & LangDLL Example Script
2002-08-29 10:31:13 +00:00
;Written by Joost Verburg
!define NAME " Test Software " ;Define your own software name here
!define VERSION " 1.0 " ;Define your own software version here
!verbose 3
2002-09-25 18:46:36 +00:00
!include " ModernUI.nsh "
2002-08-29 10:31:13 +00:00
!verbose 4
;--------------------------------
2002-09-22 13:33:53 +00:00
;Configuration
2002-08-29 10:31:13 +00:00
;Language Files
LoadLanguageFile " ${NSISDIR} \Contrib\Language files\English.nlf "
LoadLanguageFile " ${NSISDIR} \Contrib\Language files\Dutch.nlf "
;General
2002-09-26 18:00:16 +00:00
Name /LANG = ${LANG_ENGLISH} " ${NAME} ${VERSION} "
Name /LANG = ${LANG_DUTCH} " ${NAME} ${VERSION} "
2002-08-29 10:31:13 +00:00
OutFile " Multilanguage.exe "
SetOverwrite on
;User interface
2002-09-25 18:46:36 +00:00
!insertmacro MUI_INTERFACE " modern.exe " " adni18-installer-C-no48xp.ico " " adni18-uninstall-C-no48xp.ico " " modern.bmp " " smooth " " $9 " ;$9 is the variable used to store the current page, do not use this var!
2002-09-02 19:50:25 +00:00
2002-08-29 10:31:13 +00:00
;License dialog
2002-09-26 18:00:16 +00:00
LicenseText /LANG = ${LANG_ENGLISH} " Press Page Down to see the rest of the agreement. "
LicenseText /LANG = ${LANG_DUTCH} " Druk op Page Down om de rest van de overeenkomt te zien. "
LicenseData /LANG = ${LANG_ENGLISH} " License.txt "
LicenseData /LANG = ${LANG_DUTCH} " License.txt "
2002-08-29 10:31:13 +00:00
;Component-select dialog
2002-09-26 18:00:16 +00:00
ComponentText /LANG = ${LANG_ENGLISH} " Check the components you want to install and uncheck the components you don't want to install. Click Next to continue. "
ComponentText /LANG = ${LANG_DUTCH} " Selecteer de onderdelen die u wilt installer en deselecteer de onderdelen die u niet wilt installeren. Klik Volgende om verder te gaan. "
2002-08-29 10:31:13 +00:00
;Folder-select dialog
InstallDir " $PROGRAMFILES \${NAME} "
2002-09-26 18:00:16 +00:00
DirText /LANG = ${LANG_ENGLISH} " Setup will install ${NAME} in the following folder.$\r$\n$\r$\nTo install in this folder, click Install. To install in a different folder, click Browse and select another folder. " " "
DirText /LANG = ${LANG_DUTCH} " Setup zal ${NAME} in de volgende map installeren.$\r$\n$\r$\nOm in een deze map te intalleren, klik Installeer. Om in een andere map te installeren, klik Bladeren en selecteerd een andere map. " " "
2002-08-29 10:31:13 +00:00
;Uninstaller
2002-09-26 18:00:16 +00:00
UninstallText /LANG = ${LANG_ENGLISH} " This will uninstall ${NAME} from your system. "
UninstallText /LANG = ${LANG_DUTCH} " Dit programma zal ${NAME} verwijderen van uw systeem. "
2002-09-02 19:50:25 +00:00
2002-09-22 13:33:53 +00:00
;Things that need to be extracted on startup (keep these lines before any File command!)
ReserveFile " ${NSISDIR} \Plugins\LangDLL.dll "
2002-08-29 10:31:13 +00:00
;--------------------------------
;Installer Sections
Section " Modern.exe " SecCopyUI
;Add your stuff here
SetOutPath " $INSTDIR "
File " ${NSISDIR} \Contrib\UIs\modern.exe "
SectionEnd
Section " Create uninstaller " SecCreateUninst
2002-09-25 18:46:36 +00:00
;Write the language to the registry (for the uninstaller)
WriteRegStr HKCU " Software\${NAME} " " Installer Language " " $LANGUAGE "
2002-08-29 10:31:13 +00:00
;Add your stuff here
WriteUninstaller " $INSTDIR \Uninstall.exe "
SectionEnd
Section " "
;Invisible section to display the Finish header
2002-09-19 15:50:37 +00:00
!insertmacro MUI_FINISHHEADER SetPage
2002-09-02 19:50:25 +00:00
2002-08-29 10:31:13 +00:00
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
2002-09-26 18:00:16 +00:00
LangDLL :: LangDialog " Installer Language " " Please select a language. " " 2F " " English " " ${LANG_ENGLISH} " " Nederlands " " ${LANG_DUTCH} " " 8 " " Tahoma " ;2 is the number of lanugages, F means change font
2002-09-22 12:52:32 +00:00
2002-09-26 18:00:16 +00:00
Pop $LANGUAGE
StrCmp $LANGUAGE " cancel " 0 + 2
Abort
2002-08-29 10:31:13 +00:00
2002-09-26 18:00:16 +00:00
StrCmp $LANGUAGE ${LANG_DUTCH} " " + 2
2002-08-29 10:31:13 +00:00
SectionSetText ${SecCreateUninst} " De<EFBFBD> nstallatie programma "
FunctionEnd
Function .onInitDialog
!insertmacro MUI_INNERDIALOG_INIT
!insertmacro MUI_INNERDIALOG_START 1
2002-09-26 18:00:16 +00:00
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_ENGLISH} 1040 " If you accept all the terms of the agreement, choose I Agree to continue. If you choose Cancel, Setup will close. You must accept the agreement to install ${NAME}. "
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_DUTCH} 1040 " Als u de overeenkomt accepteert, kies Akkoord om verder te gaan. Als u Annuleren kiest zal Setup sluiten. U moet met de overeenkomst acceptren om ${NAME} te installeren. "
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_STOP 1
!insertmacro MUI_INNERDIALOG_START 2
2002-09-26 18:00:16 +00:00
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_ENGLISH} 1042 " Description "
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_ENGLISH} ${LANG_DUTCH} " Hover your mouse over a component to see it's description. "
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_DUTCH} 1042 " Beschrijving "
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_DUTCH} ${LANG_DUTCH} " Beweeg uw muis over een onderdeel om een beschrijving te zien. "
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_STOP 2
!insertmacro MUI_INNERDIALOG_START 3
2002-09-26 18:00:16 +00:00
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_ENGLISH} 1041 " Destination Folder "
!insertmacro MUI_INNERDIALOG_TEXT ${LANG_ENGLISH} 1041 " Installatie Map "
2002-08-29 10:31:13 +00:00
!insertmacro MUI_INNERDIALOG_STOP 3
!insertmacro MUI_INNERDIALOG_END
FunctionEnd
Function .onNextPage
2002-09-19 15:50:37 +00:00
!insertmacro MUI_NEXTPAGE SetPage
2002-09-02 19:50:25 +00:00
2002-08-29 10:31:13 +00:00
FunctionEnd
Function .onPrevPage
2002-09-20 20:21:00 +00:00
!insertmacro MUI_PREVPAGE SetPage
2002-08-29 10:31:13 +00:00
FunctionEnd
2002-09-19 15:50:37 +00:00
Function SetPage
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_INIT
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 1
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " License Agreement " " Please review the license terms before installing ${NAME}. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Licentie Overeenkomst " " Lees de licentie overeenkomst voordat u ${NAME} installeerd. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 1
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 2
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Choose Components " " Choose the components you want to install. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Kies Onderdelen " " Kies de onderdelen die u wilt installeren. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 2
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 3
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Choose Install Location " " Choose the folder in which to install ${NAME}. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Kies Installatie Locatie " " Kies de map waarin u ${NAME} in wilt installeren. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 3
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 4
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Installing " " Please wait while ${NAME} is being installed. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Bezig met installeren " " Een ogenblik geduld terwijl ${NAME} wordt geinstalleerd. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 4
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 5
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Finished " " Setup was completed successfully. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Gereed " " De installatie is succesvol verlopen. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 5
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_END
2002-08-29 10:31:13 +00:00
FunctionEnd
Function .onMouseOverSection
!insertmacro MUI_DESCRIPTION_INIT
2002-09-26 18:00:16 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${LANG_ENGLISH} ${SecCopyUI} " Copy the modern.exe file to the application folder. "
!insertmacro MUI_DESCRIPTION_TEXT ${LANG_ENGLISH} ${SecCreateUninst} " Create a uninstaller which can automatically delete ${NAME}. "
2002-08-29 10:31:13 +00:00
2002-09-26 18:00:16 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${LANG_DUTCH} ${SecCopyUI} " Kopie<EFBFBD> r modern.exe naar de programma map. "
!insertmacro MUI_DESCRIPTION_TEXT ${LANG_DUTCH} ${SecCreateUninst} " Maak een de<64> nstallatie programma dat ${NAME} automatisch kan verwijderen. "
2002-08-29 10:31:13 +00:00
!insertmacro MUI_DESCRIPTION_END
FunctionEnd
Function .onUserAbort
2002-09-26 18:00:16 +00:00
!insertmacro MUI_ABORTWARNING ${LANG_ENGLISH} " Are you sure you want to quit ${NAME} Setup? "
!insertmacro MUI_ABORTWARNING ${LANG_DUTCH} " Weet u zeker dat u ${NAME} Setup wilt afsluiten? "
2002-08-29 10:31:13 +00:00
!insertmacro MUI_ABORTWARNING_END
2002-09-02 19:50:25 +00:00
2002-08-29 10:31:13 +00:00
FunctionEnd
;--------------------------------
;Uninstaller Section
Section " Uninstall "
;Add your stuff here
Delete " $INSTDIR \modern.exe "
Delete " $INSTDIR \Uninstall.exe "
RMDir " $INSTDIR "
2002-09-24 20:05:19 +00:00
;Security - do not delete anything if ${NAME} is empty
StrCmp " ${NAME} " " " + 2
DeleteRegKey HKCU " Software\${NAME} "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_FINISHHEADER un.SetPage
2002-08-29 19:48:16 +00:00
2002-08-29 10:31:13 +00:00
SectionEnd
;--------------------------------
;Uninstaller Functions
2002-09-24 20:05:19 +00:00
Function un.onInit
2002-09-26 18:00:16 +00:00
Push ${MUI_TEMP1}
2002-09-24 20:05:19 +00:00
;Get the language from the registry (save by uninstaller)
2002-09-26 18:00:16 +00:00
ReadRegStr ${MUI_TEMP1} HKCU " Software\${NAME} " " Installer Language "
StrCmp ${MUI_TEMP1} " " + 2
StrCpy $LANGUAGE ${MUI_TEMP1}
2002-09-24 20:05:19 +00:00
2002-09-26 18:00:16 +00:00
Pop ${MUI_TEMP1}
2002-09-24 20:05:19 +00:00
FunctionEnd
2002-08-29 10:31:13 +00:00
Function un.onNextPage
2002-09-19 15:50:37 +00:00
!insertmacro MUI_NEXTPAGE un.SetPage
2002-09-02 19:50:25 +00:00
2002-08-29 10:31:13 +00:00
FunctionEnd
2002-09-19 15:50:37 +00:00
Function un.SetPage
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_INIT
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 1
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Uninstall ${NAME} " " Remove ${NAME} from your system. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " De<EFBFBD> nstalleer ${NAME} " " Verwijder ${NAME} van uw system. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 1
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 2
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Uninstalling " " Please wait while ${NAME} is being uninstalled. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Bezig met de<64> nstalleren " " Een ogenblik gedult terwijl ${NAME} van uw system wordt verwijderd. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 2
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_START 3
2002-09-26 18:00:16 +00:00
!insertmacro MUI_HEADER_TEXT ${LANG_ENGLISH} " Finished " " ${NAME} has been removed from your system. "
!insertmacro MUI_HEADER_TEXT ${LANG_DUTCH} " Gereed " " ${NAME} is verwijderd van uw systeem. "
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_STOP 3
2002-08-29 10:31:13 +00:00
2002-09-19 15:50:37 +00:00
!insertmacro MUI_PAGE_END
2002-08-29 10:31:13 +00:00
FunctionEnd
2002-09-02 19:50:25 +00:00
;eof