; Script generated by the HM NIS Edit Script Wizard.

; Build Unicode target (from NIS 3.x)
Unicode true

Function .onInit
  System::Call 'kernel32::CreateMutex(p 0, i 0, t "GC-Installer") p .r1 ?e'
  Pop $R0

  StrCmp $R0 0 +3
    MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
  Abort
FunctionEnd

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Golden Cheetah"
!define PRODUCT_VERSION "v3.7.1"
!define PRODUCT_BIT "64"
!define PRODUCT_STARTMENU "Golden Cheetah"
!define PRODUCT_WEB_SITE_FILENAME "GoldenCheetah WebSite"
!define PRODUCT_WEB_SITE_URL "http://www.goldencheetah.org"
!define PRODUCT_WIKI_FILENAME "GoldenCheetah Wiki"
!define PRODUCT_WIKI_URL "https://github.com/GoldenCheetah/GoldenCheetah/wiki"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\GoldenCheetah.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_SETTINGS_KEY "Software\goldencheetah.org"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"


;--------------------------------
;Include Modern UI

!include "MUI2.nsh"

;--------------------------------
;General


Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${PRODUCT_BIT}bit)"
OutFile "GoldenCheetah_${PRODUCT_VERSION}_${PRODUCT_BIT}bit_Windows.exe"
InstallDir "$PROGRAMFILES64\Golden Cheetah"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"
Icon "gc.ico"
RequestExecutionLevel admin


;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING
!define MUI_ICON "gc.ico"
!define MUI_UNICON "gc.ico"

;--------------------------------
;Pages

; Welcome page
!insertmacro MUI_PAGE_WELCOME

; License page
!insertmacro MUI_PAGE_LICENSE "license.txt"

; Directory page
!insertmacro MUI_PAGE_DIRECTORY

; Component page
!insertmacro MUI_PAGE_COMPONENTS

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES

; Finish page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!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 "English"

; MUI end ------

!include x64.nsh

Section "Golden Cheetah (required)" Sec1

  SectionIn RO

  SetShellVarContext all
  CreateDirectory "$SMPROGRAMS\${PRODUCT_STARTMENU}"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU}\Golden Cheetah.lnk" "$INSTDIR\GoldenCheetah.exe"
  CreateShortCut "$DESKTOP\Golden Cheetah.lnk" "$INSTDIR\GoldenCheetah.exe"

; GoldenCheetah Files
  SetOverwrite try
  SetOutPath "$INSTDIR"
  File "D3Dcompiler_47.dll"
  File "dxcompiler.dll"
  File "dxil.dll"
  File "gc.ico"
  File "GoldenCheetah.exe"
  File "GoldenCheetah.pdb"
  SetOutPath "$INSTDIR\generic"
  File "generic\qtuiotouchplugin.dll"
  SetOutPath "$INSTDIR\iconengines"
  File "iconengines\qsvgicon.dll"
  SetOutPath "$INSTDIR"
  SetOutPath "$INSTDIR\imageformats"
  File "imageformats\qgif.dll"
  File "imageformats\qico.dll"
  File "imageformats\qjpeg.dll"
  File "imageformats\qsvg.dll"
  SetOutPath "$INSTDIR"
  File "libcrypto-1_1-x64.dll"
  File "libsamplerate-0.dll"
  File "libssl-1_1-x64.dll"
  File "license.txt"
  SetOutPath "$INSTDIR\multimedia"
  File "multimedia\ffmpegmediaplugin.dll"
  File "multimedia\windowsmediaplugin.dll"
  SetOutPath "$INSTDIR\networkinformation"
  File "networkinformation\qnetworklistmanager.dll"
  SetOutPath "$INSTDIR\platforms"
  File "platforms\qwindows.dll"
  SetOutPath "$INSTDIR"
  File "opengl32sw.dll"
  File "OpenSSL License.txt"
  SetOutPath "$INSTDIR\position"
  File "position\qtposition_nmea.dll"
  File "position\qtposition_positionpoll.dll"
  File "position\qtposition_winrt.dll"
  SetOutPath "$INSTDIR"
  File "PYTHON LICENSE.txt"
  File "_asyncio.pyd"
  File "_bz2.pyd"
  File "_ctypes.pyd"
  File "_decimal.pyd"
  File "_elementtree.pyd"
  File "_hashlib.pyd"
  File "libcrypto-1_1.dll"
  File "libssl-1_1.dll"
  File "LICENSE.txt"
  File "_lzma.pyd"
  File "_msi.pyd"
  File "_multiprocessing.pyd"
  File "_overlapped.pyd"
  File "pyexpat.pyd"
  File "python37.dll"
  File "python37._pth"
  File "python37.zip"
  File "python3.dll"
  File "python.exe"
  File "pythonw.exe"
  File "_queue.pyd"
  File "select.pyd"
  File "_socket.pyd"
  File "sqlite3.dll"
  File "_sqlite3.pyd"
  File "_ssl.pyd"
  File "unicodedata.pyd"
  File "winsound.pyd"
  SetOutPath "$INSTDIR\Lib"
  File /nonfatal /a /r "Lib\"
  SetOutPath "$INSTDIR"
  File "gsl.dll"
  File "gslcblas.dll"
  SetOutPath "$INSTDIR"
  File "Qt6Bluetooth.dll"
  File "Qt6Charts.dll"
  File "Qt6Core.dll"
  File "Qt6Core5Compat.dll"
  File "Qt6Gui.dll"
  File "Qt6Multimedia.dll"
  File "Qt6MultimediaWidgets.dll"
  File "Qt6Network.dll"
  File "Qt6OpenGL.dll"
  File "Qt6OpenGLWidgets.dll"
  File "Qt6Positioning.dll"
  File "Qt6PrintSupport.dll"
  File "Qt6Qml.dll"
  File "Qt6QmlMeta.dll"
  File "Qt6QmlModels.dll"
  File "Qt6QmlWorkerScript.dll"
  File "Qt6Quick.dll"
  File "Qt6QuickWidgets.dll"
  File "Qt6SerialPort.dll"
  File "Qt6Sql.dll"
  File "Qt6Svg.dll"
  File "Qt6WebChannel.dll"
  File "Qt6WebEngineCore.dll"
  File "Qt6WebEngineWidgets.dll"
  File "Qt6Widgets.dll"
  File "Qt6Xml.dll"
  File "avcodec-61.dll"
  File "avformat-61.dll"
  File "avutil-59.dll"
  File "swresample-5.dll"
  File "swscale-8.dll"
  File "QtWebEngineProcess.exe"
  File "ReadMe.txt"
  SetOutPath "$INSTDIR\resources"
  File "resources\icudtl.dat"
  File "resources\qtwebengine_devtools_resources.pak"
  File "resources\qtwebengine_resources.pak"
  File "resources\qtwebengine_resources_100p.pak"
  File "resources\qtwebengine_resources_200p.pak"
  File "resources\v8_context_snapshot.bin"
  SetOutPath "$INSTDIR"
  File "SiUSBXp.dll"
  SetOutPath "$INSTDIR\sqldrivers"
  File "sqldrivers\qsqlite.dll"
  File "sqldrivers\qsqlmimer.dll"
  File "sqldrivers\qsqlodbc.dll"
  File "sqldrivers\qsqlpsql.dll"
  SetOutPath "$INSTDIR\styles"
  File "styles\qmodernwindowsstyle.dll"
  File "styles\qwindowsvistastyle.dll"
  SetOutPath "$INSTDIR\tls"
  File "tls\qcertonlybackend.dll"
  File "tls\qopensslbackend.dll"
  File "tls\qschannelbackend.dll"
  SetOutPath "$INSTDIR\translations\qtwebengine_locales"
  File "translations\qtwebengine_locales\am.pak"
  File "translations\qtwebengine_locales\ar.pak"
  File "translations\qtwebengine_locales\bg.pak"
  File "translations\qtwebengine_locales\bn.pak"
  File "translations\qtwebengine_locales\ca.pak"
  File "translations\qtwebengine_locales\cs.pak"
  File "translations\qtwebengine_locales\da.pak"
  File "translations\qtwebengine_locales\de.pak"
  File "translations\qtwebengine_locales\el.pak"
  File "translations\qtwebengine_locales\en-GB.pak"
  File "translations\qtwebengine_locales\en-US.pak"
  File "translations\qtwebengine_locales\es-419.pak"
  File "translations\qtwebengine_locales\es.pak"
  File "translations\qtwebengine_locales\et.pak"
  File "translations\qtwebengine_locales\fa.pak"
  File "translations\qtwebengine_locales\fi.pak"
  File "translations\qtwebengine_locales\fil.pak"
  File "translations\qtwebengine_locales\fr.pak"
  File "translations\qtwebengine_locales\gu.pak"
  File "translations\qtwebengine_locales\he.pak"
  File "translations\qtwebengine_locales\hi.pak"
  File "translations\qtwebengine_locales\hr.pak"
  File "translations\qtwebengine_locales\hu.pak"
  File "translations\qtwebengine_locales\id.pak"
  File "translations\qtwebengine_locales\it.pak"
  File "translations\qtwebengine_locales\ja.pak"
  File "translations\qtwebengine_locales\kn.pak"
  File "translations\qtwebengine_locales\ko.pak"
  File "translations\qtwebengine_locales\lt.pak"
  File "translations\qtwebengine_locales\lv.pak"
  File "translations\qtwebengine_locales\ml.pak"
  File "translations\qtwebengine_locales\mr.pak"
  File "translations\qtwebengine_locales\ms.pak"
  File "translations\qtwebengine_locales\nb.pak"
  File "translations\qtwebengine_locales\nl.pak"
  File "translations\qtwebengine_locales\pl.pak"
  File "translations\qtwebengine_locales\pt-BR.pak"
  File "translations\qtwebengine_locales\pt-PT.pak"
  File "translations\qtwebengine_locales\ro.pak"
  File "translations\qtwebengine_locales\ru.pak"
  File "translations\qtwebengine_locales\sk.pak"
  File "translations\qtwebengine_locales\sl.pak"
  File "translations\qtwebengine_locales\sr.pak"
  File "translations\qtwebengine_locales\sv.pak"
  File "translations\qtwebengine_locales\sw.pak"
  File "translations\qtwebengine_locales\ta.pak"
  File "translations\qtwebengine_locales\te.pak"
  File "translations\qtwebengine_locales\th.pak"
  File "translations\qtwebengine_locales\tr.pak"
  File "translations\qtwebengine_locales\uk.pak"
  File "translations\qtwebengine_locales\vi.pak"
  File "translations\qtwebengine_locales\zh-CN.pak"
  File "translations\qtwebengine_locales\zh-TW.pak"
  SetOutPath "$INSTDIR\translations"
  File "translations\qt_ar.qm"
  File "translations\qt_bg.qm"
  File "translations\qt_ca.qm"
  File "translations\qt_cs.qm"
  File "translations\qt_da.qm"
  File "translations\qt_de.qm"
  File "translations\qt_en.qm"
  File "translations\qt_es.qm"
  File "translations\qt_fi.qm"
  File "translations\qt_fr.qm"
  File "translations\qt_gd.qm"
  File "translations\qt_he.qm"
  File "translations\qt_hu.qm"
  File "translations\qt_it.qm"
  File "translations\qt_ja.qm"
  File "translations\qt_ko.qm"
  File "translations\qt_lv.qm"
  File "translations\qt_pl.qm"
  File "translations\qt_ru.qm"
  File "translations\qt_sk.qm"
  File "translations\qt_uk.qm"
  File "translations\qt_zh_TW.qm"

SectionEnd

Section /o "Visual C++ Redistributable" Sec2

  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  File "vc_redist.x64.exe"
  ExecWait 'vc_redist.x64.exe'

SectionEnd

LangString DESC_Sec1 ${LANG_ENGLISH} "Golden Cheetah for Windows - 64Bit"
LangString DESC_Sec2 ${LANG_ENGLISH} "Microsoft Visual C++ 2015-2019 Redistributable (x64) is required to run Golden Cheetah for Windows"

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${Sec1} $(DESC_Sec1)
  !insertmacro MUI_DESCRIPTION_TEXT ${Sec2} $(DESC_Sec2)
!insertmacro MUI_FUNCTION_DESCRIPTION_END



Section -AdditionalIcons
  SetShellVarContext all
  SetOutPath $INSTDIR
  WriteIniStr "$INSTDIR\${PRODUCT_WEB_SITE_FILENAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE_URL}"
  WriteIniStr "$INSTDIR\${PRODUCT_WIKI_FILENAME}.url" "InternetShortcut" "URL" "${PRODUCT_WIKI_URL}"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU}\Need help - Check the Wiki.lnk" "$INSTDIR\${PRODUCT_WIKI_FILENAME}.url"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU}\GoldenCheetah Website.lnk" "$INSTDIR\${PRODUCT_WEB_SITE_FILENAME}.url"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU}\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\GoldenCheetah.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\GoldenCheetah.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE_URL}"
SectionEnd


Section Uninstall
  SetShellVarContext all
  Delete "$INSTDIR\${PRODUCT_WIKI_FILENAME}.url"
  Delete "$INSTDIR\${PRODUCT_WEB_SITE_FILENAME}.url"
  Delete "$INSTDIR\${PRODUCT_NAME}.url"

; GoldenCheetah Filelist && RMDIR List
  Delete "$INSTDIR\uninst.exe"
  Delete "$INSTDIR\D3Dcompiler_47.dll"
  Delete "$INSTDIR\dxcompiler.dll"
  Delete "$INSTDIR\dxil.dll"
  Delete "$INSTDIR\gc.ico"
  Delete "$INSTDIR\GoldenCheetah.exe"
  Delete "$INSTDIR\GoldenCheetah.pdb"
  Delete "$INSTDIR\generic\qtuiotouchplugin.dll"
  Delete "$INSTDIR\iconengines\qsvgicon.dll"
  Delete "$INSTDIR\imageformats\qgif.dll"
  Delete "$INSTDIR\imageformats\qico.dll"
  Delete "$INSTDIR\imageformats\qjpeg.dll"
  Delete "$INSTDIR\imageformats\qsvg.dll"
  Delete "$INSTDIR\libcrypto-1_1-x64.dll"
  Delete "$INSTDIR\libsamplerate-0.dll"
  Delete "$INSTDIR\libssl-1_1-x64.dll"
  Delete "$INSTDIR\license.txt"
  Delete "$INSTDIR\multimedia\ffmpegmediaplugin.dll"
  Delete "$INSTDIR\multimedia\windowsmediaplugin.dll"
  Delete "$INSTDIR\opengl32sw.dll"
  Delete "$INSTDIR\OpenSSL License.txt"
  Delete "$INSTDIR\networkinformation\qnetworklistmanager.dll"
  Delete "$INSTDIR\platforms\qwindows.dll"
  Delete "$INSTDIR\position\qtposition_nmea.dll"
  Delete "$INSTDIR\position\qtposition_positionpoll.dll"
  Delete "$INSTDIR\position\qtposition_winrt.dll"
  Delete "$INSTDIR\PYTHON LICENSE.txt"
  Delete "$INSTDIR\_asyncio.pyd"
  Delete "$INSTDIR\_bz2.pyd"
  Delete "$INSTDIR\_ctypes.pyd"
  Delete "$INSTDIR\_decimal.pyd"
  Delete "$INSTDIR\_elementtree.pyd"
  Delete "$INSTDIR\_hashlib.pyd"
  Delete "$INSTDIR\libcrypto-1_1.dll"
  Delete "$INSTDIR\libssl-1_1.dll"
  Delete "$INSTDIR\LICENSE.txt"
  Delete "$INSTDIR\_lzma.pyd"
  Delete "$INSTDIR\_msi.pyd"
  Delete "$INSTDIR\_multiprocessing.pyd"
  Delete "$INSTDIR\_overlapped.pyd"
  Delete "$INSTDIR\pyexpat.pyd"
  Delete "$INSTDIR\python37.dll"
  Delete "$INSTDIR\python37._pth"
  Delete "$INSTDIR\python37.zip"
  Delete "$INSTDIR\python3.dll"
  Delete "$INSTDIR\python.exe"
  Delete "$INSTDIR\pythonw.exe"
  Delete "$INSTDIR\_queue.pyd"
  Delete "$INSTDIR\select.pyd"
  Delete "$INSTDIR\_socket.pyd"
  Delete "$INSTDIR\sqlite3.dll"
  Delete "$INSTDIR\_sqlite3.pyd"
  Delete "$INSTDIR\_ssl.pyd"
  Delete "$INSTDIR\unicodedata.pyd"
  Delete "$INSTDIR\winsound.pyd"
  RMDir /r "$INSTDIR\Lib"
  Delete "$INSTDIR\gsl.dll"
  Delete "$INSTDIR\gslcblas.dll"
  Delete "$INSTDIR\Qt6Bluetooth.dll"
  Delete "$INSTDIR\Qt6Charts.dll"
  Delete "$INSTDIR\Qt6Core.dll"
  Delete "$INSTDIR\Qt6Core5Compat.dll"
  Delete "$INSTDIR\Qt6Gui.dll"
  Delete "$INSTDIR\Qt6Multimedia.dll"
  Delete "$INSTDIR\Qt6MultimediaWidgets.dll"
  Delete "$INSTDIR\Qt6Network.dll"
  Delete "$INSTDIR\Qt6OpenGL.dll"
  Delete "$INSTDIR\Qt6OpenGLWidgets.dll"
  Delete "$INSTDIR\Qt6Positioning.dll"
  Delete "$INSTDIR\Qt6PrintSupport.dll"
  Delete "$INSTDIR\Qt6Qml.dll"
  Delete "$INSTDIR\Qt6QmlMeta.dll"
  Delete "$INSTDIR\Qt6QmlModels.dll"
  Delete "$INSTDIR\Qt6QmlWorkerScript.dll"
  Delete "$INSTDIR\Qt6Quick.dll"
  Delete "$INSTDIR\Qt6QuickWidgets.dll"
  Delete "$INSTDIR\Qt6SerialPort.dll"
  Delete "$INSTDIR\Qt6Sql.dll"
  Delete "$INSTDIR\Qt6Svg.dll"
  Delete "$INSTDIR\Qt6WebChannel.dll"
  Delete "$INSTDIR\Qt6WebEngineCore.dll"
  Delete "$INSTDIR\Qt6WebEngineWidgets.dll"
  Delete "$INSTDIR\Qt6Widgets.dll"
  Delete "$INSTDIR\Qt6Xml.dll"
  Delete "$INSTDIR\avcodec-61.dll"
  Delete "$INSTDIR\avformat-61.dll"
  Delete "$INSTDIR\avutil-59.dll"
  Delete "$INSTDIR\swresample-5.dll"
  Delete "$INSTDIR\swscale-8.dll"

  Delete "$INSTDIR\QtWebEngineProcess.exe"
  Delete "$INSTDIR\ReadMe.txt"
  Delete "$INSTDIR\resources\icudtl.dat"
  Delete "$INSTDIR\resources\qtwebengine_devtools_resources.pak"
  Delete "$INSTDIR\resources\qtwebengine_resources.pak"
  Delete "$INSTDIR\resources\qtwebengine_resources_100p.pak"
  Delete "$INSTDIR\resources\qtwebengine_resources_200p.pak"
  Delete "$INSTDIR\resources\v8_context_snapshot.bin"
  Delete "$INSTDIR\SiUSBXp.dll"
  Delete "$INSTDIR\sqldrivers\qsqlite.dll"
  Delete "$INSTDIR\sqldrivers\qsqlmimer.dll"
  Delete "$INSTDIR\sqldrivers\qsqlodbc.dll"
  Delete "$INSTDIR\sqldrivers\qsqlpsql.dll"
  Delete "$INSTDIR\styles\qmodernwindowsstyle.dll"
  Delete "$INSTDIR\styles\qwindowsvistastyle.dll"
  Delete "$INSTDIR\tls\qcertonlybackend.dll"
  Delete "$INSTDIR\tls\qopensslbackend.dll"
  Delete "$INSTDIR\tls\qschannelbackend.dll"
  Delete "$INSTDIR\translations\qtwebengine_locales\am.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ar.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\bg.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\bn.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ca.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\cs.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\da.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\de.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\el.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\en-GB.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\en-US.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\es-419.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\es.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\et.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\fa.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\fi.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\fil.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\fr.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\gu.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\he.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\hi.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\hr.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\hu.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\id.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\it.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ja.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\kn.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ko.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\lt.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\lv.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ml.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\mr.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ms.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\nb.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\nl.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\pl.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\pt-BR.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\pt-PT.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ro.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ru.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\sk.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\sl.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\sr.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\sv.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\sw.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\ta.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\te.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\th.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\tr.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\uk.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\vi.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\zh-CN.pak"
  Delete "$INSTDIR\translations\qtwebengine_locales\zh-TW.pak"
  Delete "$INSTDIR\translations\qt_ar.qm"
  Delete "$INSTDIR\translations\qt_bg.qm"
  Delete "$INSTDIR\translations\qt_ca.qm"
  Delete "$INSTDIR\translations\qt_cs.qm"
  Delete "$INSTDIR\translations\qt_da.qm"
  Delete "$INSTDIR\translations\qt_de.qm"
  Delete "$INSTDIR\translations\qt_en.qm"
  Delete "$INSTDIR\translations\qt_es.qm"
  Delete "$INSTDIR\translations\qt_fi.qm"
  Delete "$INSTDIR\translations\qt_fr.qm"
  Delete "$INSTDIR\translations\qt_gd.qm"
  Delete "$INSTDIR\translations\qt_he.qm"
  Delete "$INSTDIR\translations\qt_hu.qm"
  Delete "$INSTDIR\translations\qt_it.qm"
  Delete "$INSTDIR\translations\qt_ja.qm"
  Delete "$INSTDIR\translations\qt_ko.qm"
  Delete "$INSTDIR\translations\qt_lv.qm"
  Delete "$INSTDIR\translations\qt_pl.qm"
  Delete "$INSTDIR\translations\qt_ru.qm"
  Delete "$INSTDIR\translations\qt_sk.qm"
  Delete "$INSTDIR\translations\qt_uk.qm"
  Delete "$INSTDIR\translations\qt_zh_TW.qm"
  Delete "$INSTDIR\vc_redist.x64.exe"

  RMDir "$INSTDIR\translations\qtwebengine_locales"
  RMDir "$INSTDIR\translations"
  RMDir "$INSTDIR\sqldrivers"
  RMDir "$INSTDIR\resources"
  RMDir "$INSTDIR\networkinformation"
  RMDir "$INSTDIR\position"
  RMDir "$INSTDIR\platforms"
  RMDir "$INSTDIR\mediaservice"
  RMDir "$INSTDIR\generic"
  RMDir "$INSTDIR\imageformats"
  RMDir "$INSTDIR\iconengines"
  RMDir "$INSTDIR\multimedia"
  RMDir "$INSTDIR\styles"
  RMDir "$INSTDIR\tls"
  RMDir "$INSTDIR"
; End of File and RMDIR List

  SetShellVarContext all
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\*.*"
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\Uninstall.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\Need help - Check the Wiki.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\GoldenCheetah Website.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\Golden Cheetah.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_STARTMENU}\*.lnk"
  RMDir /r "$SMPROGRAMS\${PRODUCT_STARTMENU}"
  Delete "$DESKTOP\Golden Cheetah.lnk"

  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  SetAutoClose false
SectionEnd
