summaryrefslogtreecommitdiff
path: root/frontends/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-01-07 13:28:40 +0000
committerVincent Sanders <vince@kyllikki.org>2017-01-07 13:28:40 +0000
commitd1693c27c0d9658b655c158a9652f87683719325 (patch)
treec3c5a84eea91282efc857910f7616eebb7d7a155 /frontends/windows
parent9be0f4ccaf9696173fb910660352be6648811040 (diff)
downloadnetsurf-d1693c27c0d9658b655c158a9652f87683719325.tar.gz
netsurf-d1693c27c0d9658b655c158a9652f87683719325.tar.bz2
fix windows installer generation
the windows installer package generation was not correctly parameterised which resulted in fetching resources from incorrect locations. Additionally the clean target was not removing generated installer output.
Diffstat (limited to 'frontends/windows')
-rw-r--r--frontends/windows/Makefile29
-rw-r--r--frontends/windows/res/installer.nsi67
2 files changed, 68 insertions, 28 deletions
diff --git a/frontends/windows/Makefile b/frontends/windows/Makefile
index 41c8b8c6d..1b93e4cc7 100644
--- a/frontends/windows/Makefile
+++ b/frontends/windows/Makefile
@@ -3,10 +3,14 @@
#
# This file is part of NetSurf
+
+VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
+VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
+
+
LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib
CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/
-
$(eval $(call pkg_config_find_and_add,libcares,Cares))
$(eval $(call pkg_config_find_and_add,zlib,ZLib))
@@ -68,10 +72,25 @@ install-windows:
package-windows: netsurf-installer.exe
WIN_RES_OBJ := installer.nsi NetSurf.ico netsurf.png welcome.html default.css
-WIN_RES_INS_OBJ := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(WIN_RES_OBJ)) $(OBJROOT)/messages
+WIN_RES_INS_OBJ := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(WIN_RES_OBJ)) $(OBJROOT)/messages-en
+
+# deal with making installer generation verbose
+ifeq ($(Q),)
+NSIS_VERBOSE := 4
+else
+NSIS_VERBOSE := 0
+endif
-$(OBJROOT)/messages: resources/FatMessages
- $(Q)$(SPLIT_MESSAGES) -l en -p win -f messages resources/FatMessages > $@
+# installer messages generation
+$(OBJROOT)/messages-en: resources/FatMessages
+ $(VQ)echo "MSGSPLIT: Language: en Filter: win"
+ $(Q)$(SPLIT_MESSAGES) -l en -p win -f messages -o $@ $<
netsurf-installer.exe: $(EXETARGET) $(WIN_RES_INS_OBJ)
- makensis -V4 -NOCD $(FRONTEND_RESOURCES_DIR)/installer.nsi
+ $(VQ)echo "MAKENSIS: $@"
+ $(Q)makensis -V$(NSIS_VERBOSE) -NOCD -DOBJROOT=$(OBJROOT) -DRESDIR=$(FRONTEND_RESOURCES_DIR) -DVERSIONMAJOR=$(VERSION_MAJ) -DVERSIONMINOR=$(VERSION_MIN) -DOUTFNAME=$@ $(FRONTEND_RESOURCES_DIR)/installer.nsi
+
+clean-installer:
+ $(VQ)echo " CLEAN: netsurf-installer.exe"
+ $(Q)$(RM) netsurf-installer.exe
+CLEANS += clean-installer
diff --git a/frontends/windows/res/installer.nsi b/frontends/windows/res/installer.nsi
index 0c733db2e..17afee26d 100644
--- a/frontends/windows/res/installer.nsi
+++ b/frontends/windows/res/installer.nsi
@@ -3,21 +3,40 @@
# show up in a few places.
# All the other settings can be tweaked by editing the !defines at the top of this script
+
!define APPNAME "NetSurf"
!define COMPANYNAME "NetSurf"
!define DESCRIPTION "Web Browser"
-# These three must be integers
-!define VERSIONMAJOR 3
-!define VERSIONMINOR 6
-!define VERSIONBUILD 1
+
+# The version values must be simple integers
+!ifndef VERSIONMAJOR
+ !define VERSIONMAJOR 3
+!endif
+!ifndef VERSIONMINOR
+ !define VERSIONMINOR 7
+!endif
+!ifndef VERSIONBUILD
+ !define VERSIONBUILD 0
+!endif
+
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
-# It is possible to use "mailto:" links in here to open the email client
!define HELPURL "http://www.netsurf-browser.org/" # "Support Information" link
!define UPDATEURL "http://www.netsurf-browser.org/" # "Product Updates" link
!define ABOUTURL "http://www.netsurf-browser.org/" # "Publisher" link
# This is the size (in kB) of all the files copied into "Program Files"
!define INSTALLSIZE 9000
-
+
+# output filename
+!ifndef OUTFNAME
+ !define OUTFNAME "netsurf-installer.exe"
+!endif
+
+# path to resources
+!ifndef RESDIR
+ !define RESDIR "frontends/windows/res"
+!endif
+
+
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
@@ -26,8 +45,8 @@ InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
LicenseData "COPYING"
# This will be in the installer/uninstaller's title bar
Name "${COMPANYNAME} - ${APPNAME}"
-Icon "frontends\windows\res\NetSurf.ico"
-outFile "netsurf-installer.exe"
+Icon "${RESDIR}\NetSurf.ico"
+outFile "${OUTFNAME}"
BrandingText "${COMPANYNAME}"
!include LogicLib.nsh
@@ -53,21 +72,23 @@ function .onInit
functionEnd
section "install"
- # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
+ # Files for the install directory
+
+ # Default output path
setOutPath $INSTDIR
- # Files added here should be removed by the uninstaller (see section "uninstall")
- file "NetSurf.exe"
- file /oname=NetSurf.ico "frontends\windows\res\NetSurf.ico"
- file /oname=default.css "frontends\windows\res\default.css"
- file /oname=internal.css "frontends\windows\res\internal.css"
- file /oname=adblock.css "frontends\windows\res\adblock.css"
- file /oname=welcome.html "frontends\windows\res\welcome.html"
- file /oname=credits.html "frontends\windows\res\credits.html"
- file /oname=licence.html "frontends\windows\res\licence.html"
- file /oname=netsurf.png "frontends\windows\res\netsurf.png"
- file /oname=messages "build-Linux-windows\messages"
- file /oname=ca-bundle.crt "frontends\windows\res\ca-bundle.crt"
- # Add any other files for the install directory (license files, app data, etc) here
+
+ # Files added here should be removed by the uninstaller section
+ file "NetSurf.exe"
+ file /oname=NetSurf.ico "${RESDIR}\NetSurf.ico"
+ file /oname=default.css "${RESDIR}\default.css"
+ file /oname=internal.css "${RESDIR}\internal.css"
+ file /oname=adblock.css "${RESDIR}\adblock.css"
+ file /oname=welcome.html "${RESDIR}\welcome.html"
+ file /oname=credits.html "${RESDIR}\credits.html"
+ file /oname=licence.html "${RESDIR}\licence.html"
+ file /oname=netsurf.png "${RESDIR}\netsurf.png"
+ file /oname=messages "${OBJROOT}\messages-en"
+ file /oname=ca-bundle.crt "${RESDIR}\ca-bundle.crt"
# Uninstaller - See function un.onInit and section "uninstall" for configuration
writeUninstaller "$INSTDIR\uninstall.exe"
@@ -95,7 +116,7 @@ section "install"
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
sectionEnd
-
+
# Uninstaller
function un.onInit