From 002fe45dfd4776bb44a9e786625421a67558d60c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 24 Jan 2013 15:58:35 -0800 Subject: Try to automate the version number used in the windows installer This adds a Makefile target to create the .nsi file from a template and to hopefully create the right strings to magically get the correct version strings in the Windows installer Signed-off-by: Dirk Hohndel --- packaging/windows/mingw-make.sh | 2 +- packaging/windows/subsurface.nsi | 184 ------------------------------------ packaging/windows/subsurface.nsi.in | 184 ++++++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+), 185 deletions(-) delete mode 100644 packaging/windows/subsurface.nsi create mode 100644 packaging/windows/subsurface.nsi.in (limited to 'packaging/windows') diff --git a/packaging/windows/mingw-make.sh b/packaging/windows/mingw-make.sh index ccd418c6f..7416d1d59 100755 --- a/packaging/windows/mingw-make.sh +++ b/packaging/windows/mingw-make.sh @@ -12,4 +12,4 @@ make CC=i686-w64-mingw32-gcc \ PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/ \ CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw/ \ XSLTCONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xslt-config \ - XML2CONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xml2-config NAME=subsurface.exe install-cross-windows + XML2CONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xml2-config NAME=subsurface.exe install-cross-windows $@ diff --git a/packaging/windows/subsurface.nsi b/packaging/windows/subsurface.nsi deleted file mode 100644 index 0dcf18939..000000000 --- a/packaging/windows/subsurface.nsi +++ /dev/null @@ -1,184 +0,0 @@ -# -# Subsurface NSIS installer script -# -# This installer creator needs to be run with: -# makensis subsurface.nsi -# -# It assumes that packaging/windows/dll is a symlink to -# the directory in which the required Windows DLLs are installed -# (in my case that's /usr/i686-w64-mingw32/sys-root/mingw/bin) -# - -#-------------------------------- -# Include Modern UI - - !include "MUI2.nsh" - -#-------------------------------- -# General - - # Program version - !define SUBSURFACE_VERSION "2.1" - - # VIProductVersion requires version in x.x.x.x format - !define SUBSURFACE_VIPRODUCTVERSION "2.1.0.0" - - # Installer name and filename - Name "Subsurface" - Caption "Subsurface ${SUBSURFACE_VERSION} Setup" - OutFile "subsurface-${SUBSURFACE_VERSION}.exe" - - # 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 - RequestExecutionLevel admin - -#-------------------------------- -# Version information - - VIProductVersion "${SUBSURFACE_VIPRODUCTVERSION}" - VIAddVersionKey "ProductName" "Subsurface" - VIAddVersionKey "FileDescription" "Subsurface - an open source dive log program." - VIAddVersionKey "FileVersion" "${SUBSURFACE_VERSION}" - VIAddVersionKey "LegalCopyright" "GPL v.2" - VIAddVersionKey "ProductVersion" "${SUBSURFACE_VERSION}" - -#-------------------------------- -# 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 - -Section - SetShellVarContext all - - # Installation path - SetOutPath "$INSTDIR" - - # Delete any already installed DLLs to avoid buildup of various - # versions of the same library when upgrading - Delete "$INSTDIR\*.dll" - - # Files to include in installer - File ..\..\subsurface.exe - File ..\..\subsurface.svg - File ..\..\xslt\jdivelog2subsurface.xslt - File ..\..\xslt\SuuntoSDM.xslt - File dll\iconv.dll - File dll\libatk-1.0-0.dll - File dll\libcairo-2.dll - File dll\libdivecomputer-0.dll - File dll\libffi-6.dll - File dll\libfontconfig-1.dll - File dll\libfreetype-6.dll - File mydll\freetype6.dll - File mydll\freetype-config - File dll\libgdk-win32-2.0-0.dll - File dll\libgdk_pixbuf-2.0-0.dll - File dll\libgio-2.0-0.dll - File dll\libglib-2.0-0.dll - File dll\libgmodule-2.0-0.dll - File dll\libgobject-2.0-0.dll - File dll\libgthread-2.0-0.dll - File dll\libgtk-win32-2.0-0.dll - File dll\libintl-8.dll - File dll\libjasper-1.dll - File dll\libjpeg-62.dll - File mydll\libpango-1.0-0.dll - File mydll\libpangocairo-1.0-0.dll - File mydll\libpangoft2-1.0-0.dll - File mydll\libpangowin32-1.0-0.dll - File dll\libpixman-1-0.dll - File dll\libpng15-15.dll - File dll\libtiff-3.dll - File dll\libusb-1.0.dll - File dll\libxml2-2.dll - File dll\libxslt-1.dll - File dll\libexpat-1.dll - File dll\pthreadGC2.dll - File dll\zlib1.dll - File dll\libcrypto-10.dll - File dll\libsoup-2.4-1.dll - File subsurface.ico - File /r share - - # 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" - !insertmacro MUI_STARTMENU_WRITE_END - - # Create the uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - -SectionEnd - -#-------------------------------- -# Uninstaller section - -Section "Uninstall" - SetShellVarContext all - - # Delete installed files - Delete "$INSTDIR\*.dll" - Delete "$INSTDIR\*.xslt" - Delete "$INSTDIR\freetype-config" - Delete "$INSTDIR\subsurface.exe" - Delete "$INSTDIR\subsurface.ico" - Delete "$INSTDIR\subsurface.svg" - Delete "$INSTDIR\Uninstall.exe" - RMDir /r "$INSTDIR\share" - RMDir "$INSTDIR" - - # Remove shortcuts - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder - Delete "$SMPROGRAMS\$StartMenuFolder\Subsurface.lnk" - Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Subsurface.lnk" - RMDir "$SMPROGRAMS\$StartMenuFolder" - - # Remove registry entries - DeleteRegKey /ifempty HKCU "Software\Subsurface" - -SectionEnd diff --git a/packaging/windows/subsurface.nsi.in b/packaging/windows/subsurface.nsi.in new file mode 100644 index 000000000..5fdad4fff --- /dev/null +++ b/packaging/windows/subsurface.nsi.in @@ -0,0 +1,184 @@ +# +# Subsurface NSIS installer script +# +# This installer creator needs to be run with: +# makensis subsurface.nsi +# +# It assumes that packaging/windows/dll is a symlink to +# the directory in which the required Windows DLLs are installed +# (in my case that's /usr/i686-w64-mingw32/sys-root/mingw/bin) +# + +#-------------------------------- +# Include Modern UI + + !include "MUI2.nsh" + +#-------------------------------- +# General + + # Program version + !define SUBSURFACE_VERSION "VERSIONTOKEN" + + # VIProductVersion requires version in x.x.x.x format + !define SUBSURFACE_VIPRODUCTVERSION "PRODVTOKEN" + + # Installer name and filename + Name "Subsurface" + Caption "Subsurface ${SUBSURFACE_VERSION} Setup" + OutFile "subsurface-${SUBSURFACE_VERSION}.exe" + + # 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 + RequestExecutionLevel admin + +#-------------------------------- +# Version information + + VIProductVersion "${SUBSURFACE_VIPRODUCTVERSION}" + VIAddVersionKey "ProductName" "Subsurface" + VIAddVersionKey "FileDescription" "Subsurface - an open source dive log program." + VIAddVersionKey "FileVersion" "${SUBSURFACE_VERSION}" + VIAddVersionKey "LegalCopyright" "GPL v.2" + VIAddVersionKey "ProductVersion" "${SUBSURFACE_VERSION}" + +#-------------------------------- +# 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 + +Section + SetShellVarContext all + + # Installation path + SetOutPath "$INSTDIR" + + # Delete any already installed DLLs to avoid buildup of various + # versions of the same library when upgrading + Delete "$INSTDIR\*.dll" + + # Files to include in installer + File ..\..\subsurface.exe + File ..\..\subsurface.svg + File ..\..\xslt\jdivelog2subsurface.xslt + File ..\..\xslt\SuuntoSDM.xslt + File dll\iconv.dll + File dll\libatk-1.0-0.dll + File dll\libcairo-2.dll + File dll\libdivecomputer-0.dll + File dll\libffi-6.dll + File dll\libfontconfig-1.dll + File dll\libfreetype-6.dll + File mydll\freetype6.dll + File mydll\freetype-config + File dll\libgdk-win32-2.0-0.dll + File dll\libgdk_pixbuf-2.0-0.dll + File dll\libgio-2.0-0.dll + File dll\libglib-2.0-0.dll + File dll\libgmodule-2.0-0.dll + File dll\libgobject-2.0-0.dll + File dll\libgthread-2.0-0.dll + File dll\libgtk-win32-2.0-0.dll + File dll\libintl-8.dll + File dll\libjasper-1.dll + File dll\libjpeg-62.dll + File mydll\libpango-1.0-0.dll + File mydll\libpangocairo-1.0-0.dll + File mydll\libpangoft2-1.0-0.dll + File mydll\libpangowin32-1.0-0.dll + File dll\libpixman-1-0.dll + File dll\libpng15-15.dll + File dll\libtiff-3.dll + File dll\libusb-1.0.dll + File dll\libxml2-2.dll + File dll\libxslt-1.dll + File dll\libexpat-1.dll + File dll\pthreadGC2.dll + File dll\zlib1.dll + File dll\libcrypto-10.dll + File dll\libsoup-2.4-1.dll + File subsurface.ico + File /r share + + # 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" + !insertmacro MUI_STARTMENU_WRITE_END + + # Create the uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + +#-------------------------------- +# Uninstaller section + +Section "Uninstall" + SetShellVarContext all + + # Delete installed files + Delete "$INSTDIR\*.dll" + Delete "$INSTDIR\*.xslt" + Delete "$INSTDIR\freetype-config" + Delete "$INSTDIR\subsurface.exe" + Delete "$INSTDIR\subsurface.ico" + Delete "$INSTDIR\subsurface.svg" + Delete "$INSTDIR\Uninstall.exe" + RMDir /r "$INSTDIR\share" + RMDir "$INSTDIR" + + # Remove shortcuts + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder + Delete "$SMPROGRAMS\$StartMenuFolder\Subsurface.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Subsurface.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" + + # Remove registry entries + DeleteRegKey /ifempty HKCU "Software\Subsurface" + +SectionEnd -- cgit v1.2.3-70-g09d2