easytag-win32-installer.nsi.in 18.7 KB
Newer Older
1 2 3 4 5
; NSIS script for EasyTAG mingw
;
; TODO: Write better introductory text (do not _need_ to agree to the GPL, not
;       necessary to quit other applications before installing).

6
!define PREFIX @PREFIX@
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
!define PRODUCT_NAME @PACKAGE_NAME@
!define PRODUCT_EXE_NAME @PACKAGE_TARNAME@.exe
!define PRODUCT_VERSION @PACKAGE_VERSION@
!define PRODUCT_PUBLISHER "EasyTAG project"
!define PRODUCT_WEB_SITE @PACKAGE_URL@
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_EXE_NAME}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"

SetCompressor /SOLID lzma
ShowInstDetails show
ShowUninstDetails show

; Modern UI
22 23
!include "MUI2.nsh"
!include "FileFunc.nsh"
24 25 26 27

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_COMPONENTSPAGE_SMALLDESC
28
!define MUI_ICON "data/icons/win32/easytag.ico"
29
;!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ;"data/pixmaps/EasyTAG.ico"
30 31 32 33

; Modern UI Configuration
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "data/nsis/easytag-header.bmp"
34 35
!define MUI_WELCOMEFINISHPAGE_BITMAP "data/nsis/easytag-sidebar.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "data/nsis/easytag-sidebar.bmp"
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Version resource
VIProductVersion "0.0.0.0"
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "LegalCopyright" ""
VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer"

; Welcome page
!insertmacro MUI_PAGE_WELCOME

; License page
!insertmacro MUI_PAGE_LICENSE "./COPYING"

; Components page
!insertmacro MUI_PAGE_COMPONENTS

; Directory page
!insertmacro MUI_PAGE_DIRECTORY

; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES

; Finish page
75
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
76
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
77
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
!define MUI_FINISHPAGE_LINK "${PRODUCT_NAME} Web site"
!define MUI_FINISHPAGE_LINK_LOCATION ${PRODUCT_WEB_SITE}
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Welsh"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "easytag-${PRODUCT_VERSION}-setup.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY ; Open the language selection window
FunctionEnd


;------------------------------------
; EasyTAG executable install Section
;------------------------------------
Section "Core ${PRODUCT_NAME} Files" SecProgram
  SectionIn 1 RO ; User cannot unselect it!

  ; Fedora mingw paths. FIXME: Find these automatically.
168 169 170
  SetOutPath "$INSTDIR\bin"
  File "${PREFIX}/bin/iconv.dll"
  File "${PREFIX}/bin/libatk-1.0-0.dll"
171
  File "${PREFIX}/bin/libbz2-1.dll"
172
  File "${PREFIX}/bin/libcairo-2.dll"
173
  File "${PREFIX}/bin/libcairo-gobject-2.dll"
174
  File "${PREFIX}/bin/libepoxy-0.dll"
175
  File "${PREFIX}/bin/libexpat-1.dll"
176 177
  File "${PREFIX}/bin/libFLAC-8.dll"
  File "${PREFIX}/bin/libffi-6.dll"
178 179
  File "${PREFIX}/bin/libfontconfig-1.dll"
  File "${PREFIX}/bin/libfreetype-6.dll"
180
  File "${PREFIX}/bin/libgcc_s_sjlj-1.dll"
181
  File "${PREFIX}/bin/libgdk-3-0.dll"
182 183 184 185 186
  File "${PREFIX}/bin/libgdk_pixbuf-2.0-0.dll"
  File "${PREFIX}/bin/libgio-2.0-0.dll"
  File "${PREFIX}/bin/libglib-2.0-0.dll"
  File "${PREFIX}/bin/libgmodule-2.0-0.dll"
  File "${PREFIX}/bin/libgobject-2.0-0.dll"
187
  File "${PREFIX}/bin/libgtk-3-0.dll"
188 189
  File "${PREFIX}/bin/libid3-3-8-3.dll"
  File "${PREFIX}/bin/libid3tag-0.dll"
190 191
  File "${PREFIX}/bin/libintl-8.dll"
  File "${PREFIX}/bin/libogg-0.dll"
192 193
  File "${PREFIX}/bin/libopus-0.dll"
  File "${PREFIX}/bin/libopusfile-0.dll"
194 195 196
  File "${PREFIX}/bin/libpango-1.0-0.dll"
  File "${PREFIX}/bin/libpangocairo-1.0-0.dll"
  File "${PREFIX}/bin/libpangowin32-1.0-0.dll"
197
  File "${PREFIX}/bin/libpcre-1.dll"
198 199 200 201 202 203 204 205
  File "${PREFIX}/bin/libpixman-1-0.dll"
  File "${PREFIX}/bin/libpng16-16.dll"
  File "${PREFIX}/bin/libstdc++-6.dll"
  File "${PREFIX}/bin/libspeex-1.dll"
  File "${PREFIX}/bin/libtag.dll"
  File "${PREFIX}/bin/libvorbis-0.dll"
  File "${PREFIX}/bin/libvorbisfile-3.dll"
  File "${PREFIX}/bin/libwavpack-1.dll"
206
  File "${PREFIX}/bin/libwinpthread-1.dll"
207
  File "${PREFIX}/bin/glib-compile-schemas.exe"
208
  File "${PREFIX}/bin/gspawn-win32-helper.exe"
209
  File "${PREFIX}/bin/gtk-update-icon-cache.exe"
210
  File "${PREFIX}/bin/zlib1.dll"
211 212

  SetOutPath "$INSTDIR\etc"
213
  File /r "${PREFIX}/etc/fonts"
214
  File /r "${PREFIX}/etc/gtk-3.0"
215 216

  SetOutPath "$INSTDIR\lib"
217
  File /r "${PREFIX}/lib/gdk-pixbuf-2.0"
218
  File /r "${PREFIX}/lib/gtk-3.0"
219

220 221 222
  SetOutPath "$INSTDIR\etc\gtk-3.0"
  FileOpen $0 settings.ini w
  FileWrite $0 "gtk-theme-name = $\"win32$\" $\r$\n"
223
  FileWrite $0 "gtk-toolbar-style = GTK_TOOLBAR_ICONS$\r$\n"
224 225 226 227 228
  FileClose $0

  SetOutPath "$INSTDIR\share\icons\hicolor"
  File "/usr/share/icons/hicolor/index.theme"

229 230 231
  SetOutPath "$INSTDIR\share\icons"
  File /r "/usr/share/icons/Adwaita"

232
  SetOutPath "$INSTDIR\share\icons\hicolor\32x32\apps"
233
  File "${DESTDIR}${PREFIX}/share/icons/hicolor/32x32/apps/easytag.png"
234
  SetOutPath "$INSTDIR\share\icons\hicolor\48x48\apps"
235 236
  File "${DESTDIR}${PREFIX}/share/icons/hicolor/48x48/apps/easytag.png"

237
  SetOutPath "$INSTDIR\share\glib-2.0\schemas"
238 239
  File "${DESTDIR}${PREFIX}/share/glib-2.0/schemas/org.gnome.EasyTAG.enums.xml"
  File "${DESTDIR}${PREFIX}/share/glib-2.0/schemas/org.gnome.EasyTAG.gschema.xml"
240 241
  File "${PREFIX}/share/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml"

242 243
  SetOutPath "$INSTDIR\bin"
  File "${DESTDIR}${PREFIX}/bin/${PRODUCT_EXE_NAME}"
244 245 246

  ReadEnvStr $0 COMSPEC
  SetOutPath "$INSTDIR"
247
  nsExec::ExecToLog '"$0" /C bin\glib-compile-schemas.exe share\glib-2.0\schemas'
248 249
  nsExec::ExecToLog '"$0" /C bin\gtk-update-icon-cache.exe share\icons\Adwaita'
  nsExec::ExecToLog '"$0" /C bin\gtk-update-icon-cache.exe share\icons\hicolor'
250 251 252 253 254 255

  ; FIXME: ChangeLog should come from the dist dir, otherwise it does not
  ; contain the generated changelog.
  File /oname=ChangeLog.txt ChangeLog
  File /oname=COPYING.txt COPYING
  File /oname=README.txt README
256
  File /oname=SOURCES.txt SOURCES
257 258 259 260 261 262 263 264 265 266 267 268 269 270

  ; Shortcuts
  ;!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  ;CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  ;CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\EasyTAG ${PRODUCT_VERSION}.lnk" "$INSTDIR\easytag.exe"
  ;!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd

;------------------------------------
; EasyTAG shortcut install Section
;------------------------------------
SectionGroup /e "Shortcuts" SecShortcuts
  Section /o "Desktop" SecDesktopShortcut
    SetOverwrite on
271
    CreateShortCut "$DESKTOP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk" "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
272 273 274 275 276 277 278
    SetOverwrite off
  SectionEnd

  Section "Start Menu" SecStartMenuShortcut
    SetOverwrite on
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
    CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
279
    CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk" "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
280 281 282 283 284 285 286
    !insertmacro MUI_STARTMENU_WRITE_END
    SetOverwrite off
  SectionEnd

  Section "Context Menu" SecContextMenuShortcut
    SetOverwrite on
    WriteRegStr HKCR "Directory\shell\${PRODUCT_NAME}" "" "Browse with EasyTAG"
287
    WriteRegStr HKCR "Directory\shell\${PRODUCT_NAME}\command" "" '"$INSTDIR\bin\${PRODUCT_EXE_NAME}" "%1"'
288 289 290 291 292 293 294 295
    SetOverwrite off
  SectionEnd
SectionGroupEnd


;------------------------------------
; Translation install Section
;------------------------------------
296 297 298
!macro Locale LOCALE
Section "${LOCALE} Translation"
  SetOutPath "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES"
David King's avatar
David King committed
299
  File "${DESTDIR}${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/easytag.mo"
300 301 302
  File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/atk10.mo"
  File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gdk-pixbuf.mo"
  File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/glib20.mo"
303 304
  File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gtk30.mo"
  File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gtk30-properties.mo"
305
SectionEnd
306 307 308 309
!macroend

SectionGroup "Translations" SecTranslations
  !insertmacro Locale "bg"
310
  !insertmacro Locale "bs"
311 312 313 314 315
  !insertmacro Locale "ca"
  !insertmacro Locale "cs"
  !insertmacro Locale "da"
  !insertmacro Locale "de"
  !insertmacro Locale "el"
316
  !insertmacro Locale "en_GB"
317 318 319 320
  !insertmacro Locale "es"
  !insertmacro Locale "fr"
  !insertmacro Locale "he"
  !insertmacro Locale "hu"
321
  !insertmacro Locale "id"
322 323
  !insertmacro Locale "it"
  !insertmacro Locale "ja"
324
  !insertmacro Locale "ko"
325
  !insertmacro Locale "lt"
326
  !insertmacro Locale "nb"
327 328
  !insertmacro Locale "nl"
  !insertmacro Locale "pl"
329
  !insertmacro Locale "pt"
330 331 332 333 334 335 336
  !insertmacro Locale "pt_BR"
  !insertmacro Locale "ro"
  !insertmacro Locale "ru"
  !insertmacro Locale "sl"
  !insertmacro Locale "sr"
  !insertmacro Locale "sr@latin"
  !insertmacro Locale "sv"
337
  !insertmacro Locale "te"
338 339 340 341 342
  !insertmacro Locale "tr"
  !insertmacro Locale "uk"
  !insertmacro Locale "zh_CN"
  !insertmacro Locale "zh_TW"
SectionGroupEnd
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357

Section -AdditionalIcons
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME} Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
  !insertmacro MUI_STARTMENU_WRITE_END
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${PRODUCT_EXE_NAME}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\Uninstall ${PRODUCT_NAME}.exe$\" /S"
358
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
359 360 361
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
362 363 364 365 366 367 368 369
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Readme" "$INSTDIR\README.txt"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallSource" "$EXEDIR"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
  ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
  IntFmt $0 "0x%08X" $0
  WriteRegDword ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0"
  WriteRegDword ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "NoModify" 1
  WriteRegDword ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "NoRepair" 1
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
SectionEnd

; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SecProgram} "The ${PRODUCT_NAME} program and associated core files"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} "Translation catalogs. You can skip installing these if you only want to see the UI in US English"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Application shortcuts"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortcut} "Create a shortcut to the program on the desktop"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} "Create shortcuts in the start menu"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecContextMenuShortcut} "Launch ${PRODUCT_NAME} from the Explorer context menu"
!insertmacro MUI_FUNCTION_DESCRIPTION_END


;------------------------------------
; Uninstall Section
;------------------------------------
Section Uninstall
  !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
  Delete /rebootok "$DESKTOP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
  Delete /rebootok "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
  Delete /rebootok "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk"
  RMDir "$SMPROGRAMS\${PRODUCT_NAME}"

393
  Delete /rebootok "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
394 395

  RMDir /r "$INSTDIR\lib\pango"
396
  RMDir /r "$INSTDIR\lib\gtk-3.0"
397
  RMDir /r "$INSTDIR\lib\gdk-pixbuf-2.0"
398
  RMDir /r "$INSTDIR\etc\gtk-3.0"
399 400
  RMDir /r "$INSTDIR\etc\fonts"

401
  Delete /rebootok "$INSTDIR\bin\zlib1.dll"
402
  Delete /rebootok "$INSTDIR\bin\gtk-update-icon-cache.exe"
403 404
  Delete /rebootok "$INSTDIR\bin\gspawn-win32-helper.exe"
  Delete /rebootok "$INSTDIR\bin\glib-compile-schemas.exe"
405
  Delete /rebootok "$INSTDIR\bin\libwinpthread-1.dll"
406 407 408 409 410 411 412 413
  Delete /rebootok "$INSTDIR\bin\libwavpack-1.dll"
  Delete /rebootok "$INSTDIR\bin\libvorbisfile-3.dll"
  Delete /rebootok "$INSTDIR\bin\libvorbis-0.dll"
  Delete /rebootok "$INSTDIR\bin\libtag.dll"
  Delete /rebootok "$INSTDIR\bin\libstdc++-6.dll"
  Delete /rebootok "$INSTDIR\bin\libspeex-1.dll"
  Delete /rebootok "$INSTDIR\bin\libpng16-16.dll"
  Delete /rebootok "$INSTDIR\bin\libpixman-1-0.dll"
414
  Delete /rebootok "$INSTDIR\bin\libpcre-1.dll"
415 416 417
  Delete /rebootok "$INSTDIR\bin\libpangowin32-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpangocairo-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpango-1.0-0.dll"
418 419
  Delete /rebootok "$INSTDIR\bin\libopusfile-0.dll"
  Delete /rebootok "$INSTDIR\bin\libopus-0.dll"
420 421
  Delete /rebootok "$INSTDIR\bin\libogg-0.dll"
  Delete /rebootok "$INSTDIR\bin\libintl-8.dll"
422 423 424
  Delete /rebootok "$INSTDIR\bin\libid3tag-0.dll"
  Delete /rebootok "$INSTDIR\bin\libid3-3-8-3.dll"
  Delete /rebootok "$INSTDIR\bin\libgtk-3-0.dll"
425 426 427 428 429
  Delete /rebootok "$INSTDIR\bin\libgobject-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgmodule-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libglib-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgio-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
430
  Delete /rebootok "$INSTDIR\bin\libgdk-3-0.dll"
431
  Delete /rebootok "$INSTDIR\bin\libgcc_s_sjlj-1.dll"
432 433
  Delete /rebootok "$INSTDIR\bin\libfreetype-6.dll"
  Delete /rebootok "$INSTDIR\bin\libfontconfig-1.dll"
434 435
  Delete /rebootok "$INSTDIR\bin\libffi-6.dll"
  Delete /rebootok "$INSTDIR\bin\libFLAC-8.dll"
436
  Delete /rebootok "$INSTDIR\bin\libexpat-1.dll"
437
  Delete /rebootok "$INSTDIR\bin\libepoxy-0.dll"
438
  Delete /rebootok "$INSTDIR\bin\libcairo-gobject-2.dll"
439
  Delete /rebootok "$INSTDIR\bin\libcairo-2.dll"
440
  Delete /rebootok "$INSTDIR\bin\libbz2-1.dll"
441 442
  Delete /rebootok "$INSTDIR\bin\libatk-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\iconv.dll"
443
  RMDir /r "$INSTDIR\usr"
444
  RMDir /r "$INSTDIR\share"
445 446 447 448 449 450
  RMDir /r "$INSTDIR\lib"
  RMDir /r "$INSTDIR\etc"
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
  Delete "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
  Delete "$INSTDIR\ChangeLog.txt"
  Delete "$INSTDIR\COPYING.txt"
451
  Delete "$INSTDIR\bin\${PRODUCT_EXE_NAME}"
452
  Delete "$INSTDIR\README.txt"
453
  RMDir /r "$INSTDIR\lib\locale\"
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474

  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall ${PRODUCT_NAME}.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME} Website.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME} Documentation.lnk"

  Delete "$DESKTOP\${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"

  RMDir "$SMPROGRAMS\$ICONS_GROUP"
  RMDir "$INSTDIR"

  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  ; Delete "Browse with EasyTAG" context menu
  DeleteRegKey HKCR "Directory\shell\${PRODUCT_NAME}"

  ; Delete personal settings?
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \
             "Do you want to remove your personal settings?" IDYES deletesettings IDNO dontdeletesettings
  deletesettings:
    ; Get 'Application Data' user's directory
475
    RMDir /r "$LOCALAPPDATA\@PACKAGE_TARNAME@"
476 477 478 479 480 481 482 483 484 485 486
  dontdeletesettings:

  SetAutoClose true
SectionEnd


Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  Abort
FunctionEnd