friseb123@17: ;NSIS Modern User Interface version 1.63 friseb123@17: ;MultiLanguage Example Script friseb123@17: ;Written by Joost Verburg friseb123@17: !define MUI_PRODUCT "KDiff3" ;Define your own software name here friseb123@22: !include "version.nsi" friseb123@17: !ifndef MUI_VERSION friseb123@22: !define MUI_VERSION "" ;Define your own software version here friseb123@17: !endif friseb123@17: !ifndef QTDIR friseb123@45: !define QTDIR "f:\qt\3.2.2" friseb123@17: !endif friseb123@17: !ifndef WINDOWS_DIR friseb123@17: !define WINDOWS_DIR "c:\windows" friseb123@17: !endif friseb123@17: !include "MUI.nsh" friseb123@17: friseb123@32: friseb123@32: friseb123@17: ;-------------------------------- friseb123@17: ;Configuration friseb123@17: InstallDir "$PROGRAMFILES\KDiff3" friseb123@17: InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}" "" friseb123@17: ;DirShow show ; (make this hide to not let the user change it) friseb123@17: ;DirText "Select the directory to install ${MUI_PRODUCT} in:" friseb123@17: friseb123@17: friseb123@17: ;General friseb123@47: !ifndef DEBUG friseb123@17: OutFile "KDiff3Setup_${MUI_VERSION}.exe" friseb123@47: !else friseb123@48: OutFile "KDiff3SetupDebug.exe" friseb123@47: !endif friseb123@22: setCompressor bzip2 friseb123@17: friseb123@17: friseb123@17: friseb123@17: ;Remember the installer language friseb123@17: !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" friseb123@17: !define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}" friseb123@17: !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" friseb123@17: ;Remember the Start Menu Folder friseb123@17: !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" friseb123@17: !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}" friseb123@17: !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${MUI_PRODUCT}" friseb123@17: !define TEMP $R0 friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Modern UI Configuration friseb123@17: friseb123@17: !define MUI_LICENSEPAGE friseb123@17: !define MUI_COMPONENTSPAGE friseb123@17: !define MUI_DIRECTORYPAGE friseb123@17: !define MUI_STARTMENUPAGE friseb123@17: friseb123@17: !define MUI_ABORTWARNING friseb123@17: friseb123@17: !define MUI_UNINSTALLER friseb123@17: !define MUI_UNCONFIRMPAGE friseb123@22: !define MUI_HEADERBITMAP "kdiff3.bmp" friseb123@17: ;-------------------------------- friseb123@17: ;Languages friseb123@17: friseb123@17: !insertmacro MUI_LANGUAGE "English" friseb123@17: !insertmacro MUI_LANGUAGE "French" friseb123@17: !insertmacro MUI_LANGUAGE "German" friseb123@17: !insertmacro MUI_LANGUAGE "Spanish" friseb123@17: !insertmacro MUI_LANGUAGE "SimpChinese" friseb123@17: !insertmacro MUI_LANGUAGE "TradChinese" friseb123@17: !insertmacro MUI_LANGUAGE "Japanese" friseb123@17: !insertmacro MUI_LANGUAGE "Korean" friseb123@17: !insertmacro MUI_LANGUAGE "Italian" friseb123@17: !insertmacro MUI_LANGUAGE "Dutch" friseb123@17: !insertmacro MUI_LANGUAGE "Danish" friseb123@17: !insertmacro MUI_LANGUAGE "Greek" friseb123@17: !insertmacro MUI_LANGUAGE "Russian" friseb123@17: !insertmacro MUI_LANGUAGE "PortugueseBR" friseb123@17: !insertmacro MUI_LANGUAGE "Polish" friseb123@17: !insertmacro MUI_LANGUAGE "Ukrainian" friseb123@17: !insertmacro MUI_LANGUAGE "Czech" friseb123@17: !insertmacro MUI_LANGUAGE "Slovak" friseb123@17: !insertmacro MUI_LANGUAGE "Croatian" friseb123@17: !insertmacro MUI_LANGUAGE "Bulgarian" friseb123@17: !insertmacro MUI_LANGUAGE "Hungarian" friseb123@17: !insertmacro MUI_LANGUAGE "Thai" friseb123@17: !insertmacro MUI_LANGUAGE "Romanian" friseb123@17: !insertmacro MUI_LANGUAGE "Macedonian" friseb123@17: !insertmacro MUI_LANGUAGE "Turkish" friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Language Strings friseb123@17: friseb123@17: ;Descriptions friseb123@17: LangString DESC_SecCopyUI ${LANG_ENGLISH} "Software: English description" friseb123@17: LangString DESC_SecCopyUI ${LANG_FRENCH} "Software: French description" friseb123@17: LangString DESC_SecCopyUI ${LANG_GERMAN} "Software: German description" friseb123@17: LangString DESC_SecCopyUI ${LANG_SPANISH} "Software: Spanish description" friseb123@17: LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "Software: Simplified Chinese description" friseb123@17: LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "Software: Traditional Chinese description" friseb123@17: LangString DESC_SecCopyUI ${LANG_JAPANESE} "Software: Japanese description" friseb123@17: LangString DESC_SecCopyUI ${LANG_KOREAN} "Software: Korean description" friseb123@17: LangString DESC_SecCopyUI ${LANG_ITALIAN} "Software: Italian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_DUTCH} "Software: Dutch description" friseb123@17: LangString DESC_SecCopyUI ${LANG_DANISH} "Software: Danish description" friseb123@17: LangString DESC_SecCopyUI ${LANG_GREEK} "Software: Greek description" friseb123@17: LangString DESC_SecCopyUI ${LANG_RUSSIAN} "Software: Russian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "Software: Portuguese (Brasil) description" friseb123@17: LangString DESC_SecCopyUI ${LANG_POLISH} "Software: Polish description" friseb123@17: LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "Software: Ukrainian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_CZECH} "Software: Czechian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_SLOVAK} "Software: Slovakian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_CROATIAN} "Software: Slovakian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_BULGARIAN} "Software: Bulgarian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "Software: Hungarian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_THAI} "Software: Thai description" friseb123@17: LangString DESC_SecCopyUI ${LANG_ROMANIAN} "Software: Romanian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "Software: Macedonian description" friseb123@17: LangString DESC_SecCopyUI ${LANG_TURKISH} "Software: Turkish description" friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Data friseb123@17: friseb123@18: LicenseData /LANG=${LANG_ENGLISH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_FRENCH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_GERMAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_SPANISH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_SIMPCHINESE} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_TRADCHINESE} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_JAPANESE} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_KOREAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_ITALIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_DUTCH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_DANISH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_GREEK} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_RUSSIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_PORTUGUESEBR} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_POLISH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_UKRAINIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_CZECH} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_SLOVAK} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_CROATIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_BULGARIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_HUNGARIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_THAI} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_ROMANIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_MACEDONIAN} "..\COPYING" friseb123@18: LicenseData /LANG=${LANG_TURKISH} "..\COPYING" friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Reserve Files friseb123@17: friseb123@17: ;Things that need to be extracted on first (keep these lines before any File command!) friseb123@17: ;Only useful for BZIP2 compression friseb123@17: !insertmacro MUI_RESERVEFILE_LANGDLL friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Installer Sections friseb123@17: friseb123@17: Section "Software" SecCopyUI 2 friseb123@17: SectionIn 2 RO friseb123@17: friseb123@17: SetOutPath "$INSTDIR" friseb123@17: ; add files / whatever that need to be installed here. friseb123@17: WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}" "" "$INSTDIR" friseb123@17: WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)" friseb123@17: WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" '"$INSTDIR\uninst.exe"' friseb123@32: DetailPrint "Writing files" friseb123@18: File "kdiff3.exe" friseb123@32: File "..\binaries\windows\diff.exe" friseb123@18: File "..\COPYING" friseb123@17: File "${WINDOWS_DIR}\system32\msvcp70.dll" friseb123@17: File "${WINDOWS_DIR}\system32\msvcr70.dll" friseb123@17: File "${QTDIR}\lib\qt-mt*.dll" friseb123@22: ; File "*.qm" friseb123@17: friseb123@17: !insertmacro MUI_STARTMENU_WRITE_BEGIN friseb123@17: friseb123@32: DetailPrint "Creating shortcuts" friseb123@17: CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}" friseb123@17: CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\KDiff3.lnk" "$INSTDIR\kdiff3.exe" friseb123@17: CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstal.lnk" "$INSTDIR\uninst.exe" friseb123@17: friseb123@17: !insertmacro MUI_STARTMENU_WRITE_END friseb123@17: friseb123@17: friseb123@17: ; write out uninstaller friseb123@17: WriteUninstaller "$INSTDIR\uninst.exe" friseb123@17: friseb123@17: friseb123@17: ;Store install folder friseb123@17: WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR friseb123@32: CreateShortCut "$QUICKLAUNCH\KDiff3.lnk" "$INSTDIR\kdiff3.exe" friseb123@32: friseb123@17: SectionEnd friseb123@17: friseb123@22: Section "Documentation" friseb123@22: friseb123@32: DetailPrint "Writing the documentation" friseb123@23: SetOutPath "$INSTDIR" friseb123@23: File /r tmp\kdiff3.sourceforge.net\doc friseb123@23: SetOutPath "$INSTDIR" friseb123@23: CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Documentation.lnk" "$INSTDIR\doc\index.html" friseb123@32: WriteRegStr HKCR "Application\kdiff3.exe\shell\open\command" "" '"$INSTDIR\kdiff3.exe" "%1"' friseb123@22: SectionEnd friseb123@22: friseb123@22: SubSection "Integration" friseb123@22: Section "WinCVS" friseb123@23: DetailPrint "Integration to WinCVS" friseb123@23: MessageBox MB_OK "Please close WinCVS" friseb123@38: WriteRegStr HKCU "Software\WinCvs\wincvs\CVS settings" "P_Extdiff" '$INSTDIR\kdiff3.exe' friseb123@23: WriteRegBin HKCU "Software\WinCvs\wincvs\CVS settings" "P_DiffUseExtDiff" 01 friseb123@20: friseb123@22: SectionEnd friseb123@32: Section "Explorer" friseb123@32: DetailPrint "Integration to Explorer" friseb123@38: ; WriteRegStr HKCR "Directory\shell}\KDiff3" "" '&KDiff3' friseb123@38: ; WriteRegStr HKCR "Directory\shell\KDiff3\command" "" '"$INSTDIR\kdiff3.exe" "%1"' friseb123@32: CreateShortCut "$SMPROGRAMS\..\..\SendTo\KDiff3.lnk" '"$INSTDIR\kdiff3.exe"' friseb123@32: SectionEnd friseb123@22: SubSectionEnd friseb123@17: friseb123@45: !ifdef DEBUG friseb123@49: Section "Debug" friseb123@49: DetailPrint "Writing the Source Code" friseb123@49: SetOutPath "$INSTDIR\" friseb123@49: File /r tmp\source friseb123@45: DetailPrint "Writing debug information" friseb123@45: SetOutPath "$INSTDIR" friseb123@45: File /oname=kdiff3.pdb kdiff3.pdb friseb123@45: SectionEnd friseb123@45: !endif friseb123@45: friseb123@17: ;Display the Finish header friseb123@17: ;Insert this macro after the sections if you are not using a finish page friseb123@17: !insertmacro MUI_SECTIONS_FINISHHEADER friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Installer Functions friseb123@17: friseb123@17: Function .onInit friseb123@17: ; SetOutPath $TEMP1 friseb123@17: ; File /oname=spltmp.bmp "promotion.bmp" friseb123@17: friseb123@17: ; optional friseb123@17: ; File /oname=spltmp.wav "my_splashshit.wav" friseb123@17: friseb123@17: ; advsplash::show 5000 600 40 0 $TEMP1\spltmp friseb123@17: friseb123@17: ; Pop $0 ; $0 has '1' if the user closed the splash screen early, friseb123@17: ; '0' if everything closed normal, and '-1' if some error occured. friseb123@17: friseb123@17: ; Delete $TEMP1\spltmp.bmp friseb123@17: ; Delete $TEMP1\spltmp.wav friseb123@17: friseb123@17: !insertmacro MUI_LANGDLL_DISPLAY friseb123@17: friseb123@17: FunctionEnd friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Descriptions friseb123@17: friseb123@17: !insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN friseb123@17: !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI) friseb123@17: !insertmacro MUI_FUNCTIONS_DESCRIPTION_END friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Uninstaller Section friseb123@17: friseb123@17: Section "Uninstall" friseb123@17: friseb123@17: ; add delete commands to delete whatever files/registry keys/etc you installed here. friseb123@17: ReadRegStr ${TEMP} "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" friseb123@17: StrCmp ${TEMP} "" noshortcuts friseb123@17: friseb123@17: RMDir /r "$SMPROGRAMS\${TEMP}" friseb123@17: friseb123@17: noshortcuts: friseb123@17: friseb123@17: RMDir "$INSTDIR" friseb123@17: Delete "$INSTDIR\uninst.exe" friseb123@32: DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" friseb123@32: friseb123@32: Delete "$QUICKLAUNCH\KDiff3.lnk" friseb123@32: RMDir /r "$INSTDIR" friseb123@32: DetailPrint "Integration to Explorer" friseb123@38: ; DeleteRegKey HKCR "Directory\shell\KDiff3\command" friseb123@38: ; DeleteRegKey HKCR "Directory\shell\KDiff3" friseb123@32: Delete "$SMPROGRAMS\..\..\SendTo\KDiff3.lnk" friseb123@32: friseb123@32: !insertmacro MUI_UNFINISHHEADER friseb123@17: friseb123@17: SectionEnd friseb123@17: friseb123@17: ;-------------------------------- friseb123@17: ;Uninstaller Functions friseb123@17: friseb123@17: Function un.onInit friseb123@17: friseb123@17: ;Get language from registry friseb123@17: ReadRegStr $LANGUAGE HKCU "Software\${MUI_PRODUCT}" "Installer Language" friseb123@17: friseb123@17: FunctionEnd friseb123@17: