mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Switched to VS2015 builds wih global installs
This commit is contained in:
parent
932f817496
commit
973298f36e
51
gpxsee.nsi
51
gpxsee.nsi
@ -1,5 +1,5 @@
|
|||||||
;Include Modern UI
|
|
||||||
!include "MUI2.nsh"
|
!include "MUI2.nsh"
|
||||||
|
!include "x64.nsh"
|
||||||
|
|
||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
@ -7,20 +7,21 @@ Name "GPXSee"
|
|||||||
; The file to write
|
; The file to write
|
||||||
OutFile "install.exe"
|
OutFile "install.exe"
|
||||||
|
|
||||||
RequestExecutionLevel user
|
; Required execution level
|
||||||
|
RequestExecutionLevel admin
|
||||||
|
|
||||||
; The default installation directory
|
; The default installation directory
|
||||||
InstallDir "$LOCALAPPDATA\GPXSee"
|
InstallDir "$PROGRAMFILES\GPXSee"
|
||||||
|
|
||||||
; Registry key to check for directory (so if you install again, it will
|
; Registry key to check for directory (so if you install again, it will
|
||||||
; overwrite the old one automatically)
|
; overwrite the old one automatically)
|
||||||
InstallDirRegKey HKCU "Software\GPXSee" "Install_Dir"
|
InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||||
|
|
||||||
; Registry key for uninstaller
|
; Registry key for uninstaller
|
||||||
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
|
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
|
||||||
|
|
||||||
; Start menu page configuration
|
; Start menu page configuration
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GPXSee"
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GPXSee"
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "GPXSee"
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "GPXSee"
|
||||||
|
|
||||||
@ -58,18 +59,19 @@ Section "GPXSee (required)" SEC_APP
|
|||||||
File "gpxsee.exe"
|
File "gpxsee.exe"
|
||||||
|
|
||||||
; Write the installation path into the registry
|
; Write the installation path into the registry
|
||||||
WriteRegStr HKCU SOFTWARE\GPXSee "Install_Dir" "$INSTDIR"
|
WriteRegStr HKLM SOFTWARE\GPXSee "Install_Dir" "$INSTDIR"
|
||||||
|
|
||||||
; Write the uninstall keys for Windows
|
; Write the uninstall keys for Windows
|
||||||
WriteRegStr HKCU "${REGENTRY}" "DisplayName" "GPXSee"
|
WriteRegStr HKLM "${REGENTRY}" "DisplayName" "GPXSee"
|
||||||
WriteRegStr HKCU "${REGENTRY}" "Publisher" "Martin Tuma"
|
WriteRegStr HKLM "${REGENTRY}" "Publisher" "Martin Tuma"
|
||||||
WriteRegStr HKCU "${REGENTRY}" "DisplayVersion" "2.7"
|
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "2.7"
|
||||||
WriteRegStr HKCU "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
WriteRegStr HKLM "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||||
WriteRegDWORD HKCU "${REGENTRY}" "NoModify" 1
|
WriteRegDWORD HKLM "${REGENTRY}" "NoModify" 1
|
||||||
WriteRegDWORD HKCU "${REGENTRY}" "NoRepair" 1
|
WriteRegDWORD HKLM "${REGENTRY}" "NoRepair" 1
|
||||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
|
|
||||||
; Create start menu entry and add links
|
; Create start menu entry and add links
|
||||||
|
SetShellVarContext all
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||||
@ -93,9 +95,23 @@ SectionEnd
|
|||||||
|
|
||||||
Section "MSVC runtime" SEC_MSVC
|
Section "MSVC runtime" SEC_MSVC
|
||||||
|
|
||||||
File "msvcr100.dll"
|
DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..."
|
||||||
File "msvcp100.dll"
|
${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}
|
||||||
|
|
||||||
|
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 "VC_redist.x86.exe"
|
||||||
|
ExecWait '"$TEMP/VC_redist.x86.exe" /install /quiet /norestart'
|
||||||
|
|
||||||
|
done:
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
@ -105,13 +121,14 @@ SectionEnd
|
|||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
|
|
||||||
; Remove registry keys
|
; Remove registry keys
|
||||||
DeleteRegKey HKCU "${REGENTRY}"
|
DeleteRegKey HKLM "${REGENTRY}"
|
||||||
DeleteRegKey HKCU SOFTWARE\GPXSee
|
DeleteRegKey HKLM SOFTWARE\GPXSee
|
||||||
|
|
||||||
; Remove directories used
|
; Remove directories used
|
||||||
RMDir /r "$INSTDIR"
|
RMDir /r "$INSTDIR"
|
||||||
|
|
||||||
; Remove Start menu entries
|
; Remove Start menu entries
|
||||||
|
SetShellVarContext all
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
||||||
Delete "$SMPROGRAMS\$StartMenuFolder\*.*"
|
Delete "$SMPROGRAMS\$StartMenuFolder\*.*"
|
||||||
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
||||||
@ -126,7 +143,7 @@ SectionEnd
|
|||||||
LangString DESC_QT ${LANG_ENGLISH} \
|
LangString DESC_QT ${LANG_ENGLISH} \
|
||||||
"QT Library. Unselct only if you have QT already installed!"
|
"QT Library. Unselct only if you have QT already installed!"
|
||||||
LangString DESC_MSVC ${LANG_ENGLISH} \
|
LangString DESC_MSVC ${LANG_ENGLISH} \
|
||||||
"Visual C++ 2010 runtime components. Unselct only if you have the runtime already installed!"
|
"Visual C++ 2015 runtime components. Unselct only if you have the runtime already installed!"
|
||||||
LangString DESC_APP ${LANG_ENGLISH} \
|
LangString DESC_APP ${LANG_ENGLISH} \
|
||||||
"GPXSee application"
|
"GPXSee application"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user