;NSIS Modern User Interface version 1.63 ;MultiLanguage Example Script ;Written by Joost Verburg !define MUI_PRODUCT "Calc On" ;Define your own software name here !define MUI_VERSION "1.0" ;Define your own software version here !include "MUI.nsh" ;-------------------------------- ;Configuration ;General Name "Calc On" OutFile "calcon_setup.exe" SetOverwrite on ;Folder selection page InstallDir "$PROGRAMFILES\${MUI_PRODUCT}" ;Remember install folder InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" "InstallDir" ;Remember the installer language !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" !define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" ;-------------------------------- ;Data ;LicenseData "License.txt" ;LicenseData_sw "Licencia.txt" LicenseLangString myLicenseData ${LANG_SWEDISH} "Licencia.txt" ;LicenseLangString myLicenseData ${LANG_ENGLISH} "License.txt" ;LicenseLangString myLicenseData ${LANG_FRENCH} "License.txt" ;LicenseLangString myLicenseData ${LANG_GERMAN} "License.txt" ;LicenseLangString myLicenseData ${LANG_DUTCH} "License.txt" ;LicenseLangString myLicenseData ${LANG_RUSSIAN} "License.txt" ;LicenseLangString myLicenseData ${LANG_SPANISH} "License.txt" LicenseData "$(myLicenseData)" ;-------------------------------- ;Modern UI Configuration !insertmacro MUI_PAGE_LICENSE "$(myLicenseData)" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "Swedish" !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "Russian" ;-------------------------------- ; A multilingual message LangString DESC_StartDeskcalc ${LANG_SWEDISH} "Installation lyckades, starta Calc On?" LangString DESC_StartDeskcalc ${LANG_ENGLISH} "Setup was successfull, start Calc On ?" LangString DESC_StartDeskcalc ${LANG_FRENCH} "Setup was successfull, start Calc On ?" LangString DESC_StartDeskcalc ${LANG_GERMAN} "Die Installation war erfolgreich, wollen sie Calc On jetzt starten ?" LangString DESC_StartDeskcalc ${LANG_DUTCH} "Setup was successfull, start Calc On ?" LangString DESC_StartDeskcalc ${LANG_RUSSIAN} "Setup was successfull, start Calc On ?" LangString DESC_StartDeskcalc ${LANG_SPANISH} "Se completó la instalación, żDesea ejecutar Calc On?" LangString DESC_UnInstallDeskcalc ${LANG_SWEDISH} "Problem! Calc On kanske fortfarande körs?" LangString DESC_UnInstallDeskcalc ${LANG_ENGLISH} "Problem! Maybe CalcOn is still running ?" ;-------------------------------- ;Reserve Files ;Things that need to be extracted on first (keep these lines before any File command!) ;Only useful for BZIP2 compression !insertmacro MUI_RESERVEFILE_LANGDLL ;-------------------------------- ;Installer Sections Section "CalcOn.exe" SecCopyUI ;Add your stuff here SetOutPath "$INSTDIR" File "lizenz.txt" File "D:\Projects\DeskCalc.SIT\CalcOn_release\calcon.exe" SetOutPath "$INSTDIR\HELP" File "D:\PROJECTS\DeskCalc.sit\help\calcon_uk.chm" File "D:\PROJECTS\DeskCalc.sit\help\calcon_sw.chm" ;Add your stuff here WriteUninstaller "$INSTDIR\Uninstall.exe" SetOutPath "$INSTDIR" SectionEnd Section "Startmenu + Desktop Icon" SecCopyDesktop CreateDirectory "$SMPROGRAMS\CalcOn" CreateShortCut "$SMPROGRAMS\CalcOn\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\CalcOn\CalcOn.lnk" "$INSTDIR\CalcOn.exe" "" "$INSTDIR\calcon.exe" 0 CreateShortCut "$DESKTOP\CalcOn.lnk" "$INSTDIR\CalcOn.exe" "" "$INSTDIR\CalcOn.exe" 0 CreateShortCut "$SMPROGRAMS\CalcOn\Help UK.lnk" "$INSTDIR\help\CalcOn_uk.chm" "" "$INSTDIR\help\calcon_uk.chm" 0 CreateShortCut "$SMPROGRAMS\CalcOn\Help SW.lnk" "$INSTDIR\help\CalcOn_sw.chm" "" "$INSTDIR\help\calcon_sw.chm" 0 WriteINIStr "$SMPROGRAMS\CalcOn\CalcOn.url" \ "InternetShortcut" "URL" \ "http://www.pmasoft.net/CalcOn.htm" SectionEnd Function .onInit !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd ;-------------------------------- ;Descriptions ;-------------------------------- ;Installer Functions Function .onInstSuccess NoInstall: MessageBox MB_YESNO|MB_ICONQUESTION "$(DESC_StartDeskcalc)" IDNO NoReadme ExecShell open '$INSTDIR\CalcOn.exe' NoReadme: FunctionEnd Section -post ;Registry für Pfad WriteRegStr HKCU "SOFTWARE\${MUI_PRODUCT}" "InstallDir" $INSTDIR WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CalcOn" "DisplayName" '${MUI_PRODUCT}' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CalcOn" "UninstallString" '"$INSTDIR\uninstall.exe"' SectionEnd ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;Add your stuff here DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CalcOn" ; special uninstall section. ; remove files ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe ; remove shortcuts, if any. Delete "$SMPROGRAMS\CalcOn\*.*" Delete "$DESKTOP\Desktop\CalcOn.lnk" ; remove directories used. RMDir "$SMPROGRAMS\CalcOn" ; remove files used. Delete "$INSTDIR\help\*.*" Delete "$INSTDIR\*.*" ; remove directories used. RMDir "$INSTDIR\help" RMDir "$INSTDIR" DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}" SectionEnd ;-------------------------------- ;Uninstaller Functions Function un.onInit !insertmacro MUI_UNGETLANGUAGE FunctionEnd Function un.onUninstSuccess IfFileExists $INSTDIR\deskcalc.exe found Return found: Messagebox MB_OK "$(DESC_UnInstallDeskcalc)" Abort FunctionEnd ;eof