goldendict-ng/tools/nsis/GoldenDict.nsi

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

146 lines
4.6 KiB
Plaintext
Raw Normal View History

2010-12-03 14:51:53 +00:00
!include "MUI2.nsh"
Name "GoldenDict"
OutFile "GoldenDict-ng-v23-Installer.exe"
2010-12-03 14:51:53 +00:00
InstallDir "$PROGRAMFILES\GoldenDict"
RequestExecutionLevel admin
SetCompressor /final lzma
Var StartMenuFolder
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
2022-05-12 14:01:56 +00:00
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
2010-12-03 14:51:53 +00:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU GDApplication $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Esperanto"
;--------------------------------
;Installer Sections
Section
SetOutPath "$INSTDIR"
2022-05-12 14:01:56 +00:00
File /r *.*
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\GoldenDict "Install_Dir" "$INSTDIR"
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldenDict" "DisplayName" "GoldenDict"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldenDict" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldenDict" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldenDict" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
CreateDirectory "$SMPROGRAMS\GoldenDict"
CreateShortcut "$SMPROGRAMS\GoldenDict\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortcut "$SMPROGRAMS\GoldenDict\GoldenDict.lnk" "$INSTDIR\GoldenDict.exe"
2010-12-03 14:51:53 +00:00
SectionEnd
!define PROGRAM_NAME "GoldenDict"
2022-05-12 14:01:56 +00:00
; Uninstaller
2010-12-03 14:51:53 +00:00
Section "Uninstall"
2022-05-12 14:01:56 +00:00
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldenDict"
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Remove registry keys
DeleteRegKey HKLM SOFTWARE\GoldenDict
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Remove files and uninstaller
Delete $INSTDIR\GoldenDict.nsi
Delete $INSTDIR\GoldenDict.exe
Delete $INSTDIR\uninstall.exe
Delete $INSTDIR\*.*
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Remove shortcuts, if any
Delete "$SMPROGRAMS\GoldenDict\*.lnk"
2010-12-03 14:51:53 +00:00
2022-05-12 14:01:56 +00:00
; Remove directories
RMDir "$SMPROGRAMS\GoldenDict"
2010-12-03 14:51:53 +00:00
RMDir "$INSTDIR"
2022-05-12 14:01:56 +00:00
SectionEnd