1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 14:53:21 +02:00
GPXSee/pkg/gpxsee.nsi

278 lines
8.6 KiB
Plaintext
Raw Normal View History

2015-10-06 01:56:19 +02:00
!include "MUI2.nsh"
!include "x64.nsh"
!include "WinVer.nsh"
2015-10-06 01:56:19 +02:00
2018-08-12 13:30:20 +02:00
; Macros
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
!macro LOCALIZATION LANG CODE
Section "${LANG}"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
!if /FileExists translations\qt_${CODE}.qm
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
!endif
SectionEnd
!macroend
2015-10-06 01:56:19 +02:00
; The name of the installer
Name "GPXSee"
2016-05-05 22:28:53 +02:00
; Program version
Squashed commit of the following: commit f819840aff5869308de57eed890f00b438c262aa Merge: 46bf281 49470f2 Author: Hosted Weblate <hosted@weblate.org> Date: Tue Oct 9 00:01:42 2018 +0200 Merge branch 'origin/master' into Weblate commit 49470f22b2b71c70fd6adebe3a397d42ef8a8e12 Merge: 078b272 ed03e31 Author: Hosted Weblate <hosted@weblate.org> Date: Mon Oct 8 23:56:36 2018 +0200 Merge branch 'origin/master' into Weblate commit ed03e319490723772f83d03aafc605798bf5c71d Merge: ce41409 605b09c Author: Hosted Weblate <hosted@weblate.org> Date: Mon Oct 8 23:53:56 2018 +0200 Merge branch 'origin/master' into Weblate commit 605b09c195f05d959f623fe2d5c84c2eabe8a810 Author: Allan Nordhøy <epost@anotheragency.no> Date: Mon Oct 8 20:26:04 2018 +0000 Translated using Weblate (Norwegian Bokmål) Currently translated at 92.2% (299 of 324 strings) Translation: GPXSee/Translations Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb/ commit 0898953674ec7dbf570f284d27559e779b7df28e Merge: fd0401a 869fdf5 Author: Hosted Weblate <hosted@weblate.org> Date: Mon Oct 8 22:24:40 2018 +0200 Merge branch 'origin/master' into Weblate commit 869fdf5982d9c4d7ec5e1fc29d07f1e52fbf4735 Merge: 7fe5189 aa32415 Author: Hosted Weblate <hosted@weblate.org> Date: Mon Oct 8 22:09:51 2018 +0200 Merge branch 'origin/master' into Weblate commit aa32415adb4bb9e5aea7340e1173004e97d00a14 Author: jan madsen <jsm@janz.dk> Date: Mon Oct 8 12:01:51 2018 +0000 Translated using Weblate (Danish) Currently translated at 85.4% (275 of 322 strings) Translation: GPXSee/Translations Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/ commit c1a64d2c0b3e9e248a9002a600658bd1fc4d889d Author: jan madsen <jsm@janz.dk> Date: Mon Oct 8 10:53:55 2018 +0000 Translated using Weblate (Danish) Currently translated at 34.1% (110 of 322 strings) Translation: GPXSee/Translations Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/ commit 31bbdba5481fbe0120e43bb30d02b896e663a9b5 Author: jan madsen <jsm@janz.dk> Date: Mon Oct 8 10:36:54 2018 +0000 Translated using Weblate (Danish) Currently translated at 19.8% (64 of 322 strings) Translation: GPXSee/Translations Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-09 00:18:17 +02:00
!define VERSION "6.3"
2015-10-06 01:56:19 +02:00
; The file to write
2016-05-05 22:28:53 +02:00
OutFile "GPXSee-${VERSION}.exe"
; Compression method
SetCompressor /SOLID lzma
2015-10-06 01:56:19 +02:00
; Required execution level
RequestExecutionLevel admin
2015-10-06 01:56:19 +02:00
; The default installation directory
InstallDir "$PROGRAMFILES\GPXSee"
2015-10-06 01:56:19 +02:00
2017-02-16 18:59:37 +01:00
; Installer executable info
VIProductVersion "${VERSION}.0.0"
VIAddVersionKey "ProductVersion" ${VERSION}
VIAddVersionKey "FileVersion" "${VERSION}.0.0"
VIAddVersionKey "ProductName" "GPXSee"
VIAddVersionKey "LegalCopyright" "GPXSee project"
VIAddVersionKey "FileDescription" "GPXSee installer"
; Registry key to check for directory (so if you install again, it will
2015-10-06 01:56:19 +02:00
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
2015-10-06 01:56:19 +02:00
; Registry key for uninstaller
2016-05-03 10:18:51 +02:00
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
2015-10-06 01:56:19 +02:00
; Start menu page configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GPXSee"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "GPXSee"
2015-10-06 01:56:19 +02:00
Var StartMenuFolder
;--------------------------------
; Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "licence.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
; Languages
!insertmacro MUI_LANGUAGE "English"
Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "GPXSee can only be installed on Windows 7 or later."
Abort
${EndIf}
FunctionEnd
2015-10-06 01:56:19 +02:00
; The stuff to install
Section "GPXSee" SEC_APP
2015-10-06 01:56:19 +02:00
SectionIn RO
; Set output path to the installation directory
2015-10-06 01:56:19 +02:00
SetOutPath $INSTDIR
; Put the files there
2015-10-06 01:56:19 +02:00
File "gpxsee.exe"
2018-01-29 00:19:57 +01:00
File /r "maps"
File /r "csv"
; Create start menu entry and add links
SetShellVarContext all
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\GPXSee.lnk" "$INSTDIR\gpxsee.exe"
!insertmacro MUI_STARTMENU_WRITE_END
; Create the uninstaller
WriteUninstaller "$INSTDIR\uninstall.exe"
2015-10-06 01:56:19 +02:00
; Write the installation path into the registry
DetailPrint "Registering application..."
WriteRegStr HKLM SOFTWARE\GPXSee "Install_Dir" "$INSTDIR"
2015-10-06 01:56:19 +02:00
; Write the uninstall keys for Windows
WriteRegStr HKLM "${REGENTRY}" "DisplayName" "GPXSee"
WriteRegStr HKLM "${REGENTRY}" "Publisher" "Martin Tuma"
2016-05-05 22:28:53 +02:00
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "${REGENTRY}" "NoModify" 1
WriteRegDWORD HKLM "${REGENTRY}" "NoRepair" 1
2015-10-06 01:56:19 +02:00
; Associate file formats
DetailPrint "Associating file types..."
2018-08-12 13:30:20 +02:00
!insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
!insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
!insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
!insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
2016-05-03 10:18:51 +02:00
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
2015-10-06 01:56:19 +02:00
SectionEnd
Section "QT framework" SEC_QT
SectionIn RO
2015-10-06 01:56:19 +02:00
File "Qt5Core.dll"
File "Qt5Gui.dll"
File "Qt5Widgets.dll"
File "Qt5PrintSupport.dll"
2015-11-25 23:18:07 +01:00
File "Qt5Network.dll"
File "Qt5Sql.dll"
2015-10-06 01:56:19 +02:00
File /r "platforms"
File /r "imageformats"
2016-05-29 19:35:38 +02:00
File /r "printsupport"
File /r "styles"
File /r "sqldrivers"
2015-10-06 01:56:19 +02:00
SectionEnd
Section "MSVC runtime" SEC_MSVC
SectionIn RO
DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..."
${If} ${RunningX64}
ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
${Else}
ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
${EndIf}
2015-10-06 01:56:19 +02:00
StrCmp $R0 "1" 0 +3
DetailPrint "Visual C++ 2015 Redistributable is already installed, skipping install."
Goto done
DetailPrint "Installing Visual C++ 2015 Redistributable..."
SetOutPath $TEMP
File "vcredist_x86.exe"
2017-06-19 22:48:48 +02:00
ExecWait '"$TEMP\vcredist_x86.exe" /install /quiet /norestart'
SetOutPath $INSTDIR
done:
2015-10-06 01:56:19 +02:00
SectionEnd
Section "OpenSSL" SEC_OPENSSL
File "libeay32.dll"
File "ssleay32.dll"
SectionEnd
Section "ANGLE" SEC_ANGLE
File "libGLESv2.dll"
File "libEGL.dll"
File "D3DCompiler_47.dll"
SectionEnd
SectionGroup "Localization" SEC_LOCALIZATION
!insertmacro LOCALIZATION "Czech" "cs"
2018-10-09 00:01:18 +02:00
!insertmacro LOCALIZATION "Danish" "da"
!insertmacro LOCALIZATION "Finnish" "fi"
!insertmacro LOCALIZATION "French" "fr"
!insertmacro LOCALIZATION "German" "de"
!insertmacro LOCALIZATION "Norwegian" "nb"
!insertmacro LOCALIZATION "Polish" "pl"
!insertmacro LOCALIZATION "Russian" "ru"
!insertmacro LOCALIZATION "Swedish" "sv"
SectionGroupEnd
2015-10-06 01:56:19 +02:00
;--------------------------------
; Uninstaller
Section "Uninstall"
2015-10-06 01:56:19 +02:00
; Remove registry keys
DeleteRegKey HKLM "${REGENTRY}"
DeleteRegKey HKLM SOFTWARE\GPXSee
2015-10-06 01:56:19 +02:00
; Remove directories used
RMDir /r "$INSTDIR"
; Remove Start menu entries
SetShellVarContext all
2015-10-06 01:56:19 +02:00
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
Delete "$SMPROGRAMS\$StartMenuFolder\*.*"
2016-05-03 10:18:51 +02:00
RMDir "$SMPROGRAMS\$StartMenuFolder"
; Remove GPX file association
2018-08-12 13:30:20 +02:00
!insertmacro FILE_ASSOCIATION_REMOVE "gpx"
!insertmacro FILE_ASSOCIATION_REMOVE "tcx"
!insertmacro FILE_ASSOCIATION_REMOVE "kml"
!insertmacro FILE_ASSOCIATION_REMOVE "fit"
!insertmacro FILE_ASSOCIATION_REMOVE "igc"
!insertmacro FILE_ASSOCIATION_REMOVE "nmea"
!insertmacro FILE_ASSOCIATION_REMOVE "plt"
!insertmacro FILE_ASSOCIATION_REMOVE "rte"
!insertmacro FILE_ASSOCIATION_REMOVE "wpt"
!insertmacro FILE_ASSOCIATION_REMOVE "loc"
!insertmacro FILE_ASSOCIATION_REMOVE "slf"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
2015-10-06 01:56:19 +02:00
SectionEnd
;-------------------------------
;Descriptions
;Language strings
LangString DESC_QT ${LANG_ENGLISH} \
"QT cross-platform application framework."
2015-10-06 01:56:19 +02:00
LangString DESC_MSVC ${LANG_ENGLISH} \
"Visual C++ 2015 runtime components. If already installed, will be skipped."
LangString DESC_OPENSSL ${LANG_ENGLISH} \
"OpenSSL library. Required for HTTPS to work."
LangString DESC_ANGLE ${LANG_ENGLISH} \
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
2015-10-06 01:56:19 +02:00
LangString DESC_APP ${LANG_ENGLISH} \
"GPXSee application"
LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
"Localization"
2015-10-06 01:56:19 +02:00
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_OPENSSL} $(DESC_OPENSSL)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
2015-10-06 01:56:19 +02:00
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END