2012-09-13 10:33:37 +00:00
|
|
|
#
|
|
|
|
# Subsurface NSIS installer script
|
|
|
|
#
|
|
|
|
# This installer creator needs to be run with:
|
2011-11-26 03:39:30 +00:00
|
|
|
# makensis subsurface.nsi
|
|
|
|
#
|
2012-09-13 10:33:37 +00:00
|
|
|
# It assumes that packaging/windows/dll is a symlink to
|
2011-11-26 03:39:30 +00:00
|
|
|
# the directory in which the required Windows DLLs are installed
|
|
|
|
# (in my case that's /usr/i686-w64-mingw32/sys-root/mingw/bin)
|
|
|
|
#
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Include Modern UI
|
|
|
|
|
|
|
|
!include "MUI2.nsh"
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# General
|
|
|
|
|
2012-09-13 16:30:03 +00:00
|
|
|
# Program version
|
2013-01-24 23:58:35 +00:00
|
|
|
!define SUBSURFACE_VERSION "VERSIONTOKEN"
|
2012-09-13 16:30:03 +00:00
|
|
|
|
|
|
|
# VIProductVersion requires version in x.x.x.x format
|
2013-01-24 23:58:35 +00:00
|
|
|
!define SUBSURFACE_VIPRODUCTVERSION "PRODVTOKEN"
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
# Installer name and filename
|
|
|
|
Name "Subsurface"
|
2012-09-13 16:30:03 +00:00
|
|
|
Caption "Subsurface ${SUBSURFACE_VERSION} Setup"
|
|
|
|
OutFile "subsurface-${SUBSURFACE_VERSION}.exe"
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
# Icon to use for the installer
|
|
|
|
!define MUI_ICON "subsurface.ico"
|
|
|
|
|
|
|
|
# Default installation folder
|
|
|
|
InstallDir "$PROGRAMFILES\Subsurface"
|
|
|
|
|
|
|
|
# Get installation folder from registry if available
|
|
|
|
InstallDirRegKey HKCU "Software\Subsurface" ""
|
|
|
|
|
|
|
|
# Request application privileges
|
2012-09-18 11:39:24 +00:00
|
|
|
RequestExecutionLevel admin
|
2012-09-13 10:33:37 +00:00
|
|
|
|
2012-09-13 16:25:22 +00:00
|
|
|
#--------------------------------
|
|
|
|
# Version information
|
|
|
|
|
2012-09-13 16:30:03 +00:00
|
|
|
VIProductVersion "${SUBSURFACE_VIPRODUCTVERSION}"
|
2012-09-13 16:25:22 +00:00
|
|
|
VIAddVersionKey "ProductName" "Subsurface"
|
|
|
|
VIAddVersionKey "FileDescription" "Subsurface - an open source dive log program."
|
2012-09-13 16:30:03 +00:00
|
|
|
VIAddVersionKey "FileVersion" "${SUBSURFACE_VERSION}"
|
2012-09-13 16:25:22 +00:00
|
|
|
VIAddVersionKey "LegalCopyright" "GPL v.2"
|
2012-09-13 16:30:03 +00:00
|
|
|
VIAddVersionKey "ProductVersion" "${SUBSURFACE_VERSION}"
|
2012-09-13 16:25:22 +00:00
|
|
|
|
2012-09-13 10:33:37 +00:00
|
|
|
#--------------------------------
|
|
|
|
# Settings
|
|
|
|
|
|
|
|
# Show a warn on aborting installation
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
|
|
|
# Defines the target start menu folder
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Subsurface"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Variables
|
|
|
|
|
|
|
|
Var StartMenuFolder
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Pages
|
|
|
|
|
|
|
|
# Installer pages
|
|
|
|
!insertmacro MUI_PAGE_LICENSE "..\..\gpl-2.0.txt"
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
|
|
# Uninstaller pages
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Languages
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Default installer section
|
|
|
|
|
2011-10-29 17:02:40 +00:00
|
|
|
Section
|
2012-10-08 17:40:25 +00:00
|
|
|
SetShellVarContext all
|
2011-10-29 17:02:40 +00:00
|
|
|
|
2012-09-13 10:33:37 +00:00
|
|
|
# Installation path
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
|
2012-09-13 16:30:03 +00:00
|
|
|
# Delete any already installed DLLs to avoid buildup of various
|
|
|
|
# versions of the same library when upgrading
|
|
|
|
Delete "$INSTDIR\*.dll"
|
|
|
|
|
2012-09-13 10:33:37 +00:00
|
|
|
# Files to include in installer
|
2012-09-18 11:43:48 +00:00
|
|
|
File ..\..\subsurface.exe
|
2013-02-16 03:55:19 +00:00
|
|
|
File /r ..\..\xslt
|
2012-09-18 11:43:48 +00:00
|
|
|
File dll\iconv.dll
|
|
|
|
File dll\libdivecomputer-0.dll
|
|
|
|
File dll\libintl-8.dll
|
|
|
|
File dll\libpng15-15.dll
|
|
|
|
File dll\libusb-1.0.dll
|
|
|
|
File dll\libxml2-2.dll
|
|
|
|
File dll\libxslt-1.dll
|
|
|
|
File dll\zlib1.dll
|
2013-09-17 19:05:10 +00:00
|
|
|
File dll\libzip-2.dll
|
2013-04-03 21:22:53 +00:00
|
|
|
File dll\libsqlite3-0.dll
|
2013-09-17 19:05:10 +00:00
|
|
|
File dll\libgcc_s_sjlj-1.dll
|
|
|
|
File dll\libstdc++-6.dll
|
|
|
|
File dll\QtCore4.dll
|
|
|
|
File dll\QtGui4.dll
|
|
|
|
File dll\QtNetwork4.dll
|
|
|
|
File dll\QtSvg4.dll
|
|
|
|
File dll\QtWebKit4.dll
|
|
|
|
File dll\QtDeclarative4.dll
|
|
|
|
File dll\QtScript4.dll
|
|
|
|
File dll\QtSql4.dll
|
|
|
|
File dll\QtXmlPatterns4.dll
|
|
|
|
File dll\QtXml4.dll
|
|
|
|
File dll\libmarblewidget.dll
|
2012-09-18 11:43:48 +00:00
|
|
|
File subsurface.ico
|
2012-10-16 04:27:16 +00:00
|
|
|
File /r share
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
# Store installation folder in registry
|
|
|
|
WriteRegStr HKCU "Software\Subsurface" "" $INSTDIR
|
|
|
|
|
|
|
|
# Create shortcuts
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
|
|
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Subsurface.lnk" "$INSTDIR\subsurface.exe"
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall Subsurface.lnk" "$INSTDIR\Uninstall.exe"
|
2013-02-21 12:31:13 +00:00
|
|
|
CreateShortCut "$DESKTOP\Subsurface.lnk" "$INSTDIR\subsurface.exe" ""
|
2012-09-13 10:33:37 +00:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
|
|
|
|
# Create the uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
|
2013-05-14 17:25:08 +00:00
|
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
|
|
|
|
"DisplayName" "Subsurface"
|
|
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
|
|
|
|
"DisplayIcon" "$INSTDIR\subsurface.ico"
|
|
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
|
|
|
|
"UninstallString" "$INSTDIR\Uninstall.exe"
|
2013-05-15 15:50:34 +00:00
|
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
|
|
|
|
"DisplayVersion" ${SUBSURFACE_VERSION}
|
2013-05-14 17:25:08 +00:00
|
|
|
|
2012-09-13 10:33:37 +00:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Uninstaller section
|
|
|
|
|
|
|
|
Section "Uninstall"
|
2012-10-08 17:40:25 +00:00
|
|
|
SetShellVarContext all
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
# Delete installed files
|
|
|
|
Delete "$INSTDIR\*.dll"
|
2013-02-21 12:31:13 +00:00
|
|
|
Delete "$INSTDIR\xslt\*.xslt"
|
2012-10-16 08:52:19 +00:00
|
|
|
Delete "$INSTDIR\freetype-config"
|
2012-09-13 10:33:37 +00:00
|
|
|
Delete "$INSTDIR\subsurface.exe"
|
|
|
|
Delete "$INSTDIR\subsurface.ico"
|
2012-09-13 14:19:04 +00:00
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
2012-10-16 08:52:19 +00:00
|
|
|
RMDir /r "$INSTDIR\share"
|
2013-02-21 12:31:13 +00:00
|
|
|
RMDir /r "$INSTDIR\xslt"
|
2012-09-13 10:33:37 +00:00
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
|
|
|
# Remove shortcuts
|
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Subsurface.lnk"
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Subsurface.lnk"
|
|
|
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
2013-02-21 12:31:13 +00:00
|
|
|
Delete "$DESKTOP\Subsurface.lnk"
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
# Remove registry entries
|
|
|
|
DeleteRegKey /ifempty HKCU "Software\Subsurface"
|
2013-05-14 17:25:08 +00:00
|
|
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface"
|
2012-09-13 10:33:37 +00:00
|
|
|
|
|
|
|
SectionEnd
|