export NSIS_AUTOUPDATE=$$([ -f client/defaults/preferences/autoupdate.js ] && echo '-DAUTOUPDATE')
export NSIS_DEV=$$([ -f client/defaults/preferences/developers.js ] && echo '-DDEVELOPER')
export NSIS_PERMACHINE=$$([ -f client/defaults/preferences/aa_per_machine.js ] && echo '-DPERMACHINE')
+export NSIS_EXTRAS=$$([ -f extras.nsi ] && echo '-DEXTRAS')
# Url taken from http://nsis.sourceforge.net/AccessControl_plug-in
NSIS_ACCESSCONTROL=http://nsis.sourceforge.net/mediawiki/images/4/4a/AccessControl.zip
# https://developer.mozilla.org/en/XULRunner/Deploying_XULRunner_1.8
# for their respective platforms in regards to XULRunner deployment
+nsis_check:
+ @echo 'Checking for makensis'
+ @type -P makensis > /dev/null || ( echo 'MAKENSIS NOT FOUND: Cannot continue. Do you need to install the NSIS package?' && exit 1 )
+
+unzip_check:
+ @echo 'Checking for unzip'
+ @type -P unzip > /dev/null || ( echo 'UNZIP NOT FOUND: Cannot continue.' && exit 1 )
+
+branding_check:
+ @echo 'Checking for branding'
+ @[ -f xulrunner-stub.exe ] || echo 'xulrunner-stub.exe not found'
+ @[ -f build/evergreen.ico ] || echo 'build/evergreen.ico not found'
+ @if [ ! -f xulrunner-stub.exe -o ! -f build/evergreen.ico ]; then echo 'Branding incomplete. Did you forget to run "make rigbeta" or "make rigrelease"?'; echo 'You will need to "make rebuild" afterwards.'; exit 1; fi
+
# Note that I decided to use win/lin channels for ease of coding platform specific updates
-win-xulrunner: client_app
+win-xulrunner: unzip_check branding_check client_app
@echo 'Preparing Windows xulrunner'
@if [ ! -f ${XULRUNNER_WINFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi
@unzip -q ${XULRUNNER_WINFILE} -dclient
# Build a windows installer.
-win-client: win-xulrunner
+win-client: nsis_check win-xulrunner
@if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; wget ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi
@echo 'Building installer'
- @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAOPTS} windowssetup.nsi
+ @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAS} ${NSIS_EXTRAOPTS} windowssetup.nsi
@echo 'Done'
# For linux, just build a tar.bz2 archive
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
+; Make the welcome page a tad less verbose on the name
+; Note: The title bar will still be verbose (full product name + version + "Setup")
+!define MUI_WELCOMEPAGE_TITLE "Welcome to the Evergreen Staff Client ${PRODUCT_VERSION} Setup Wizard"
+
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page, if we have one
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
-!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "English"
-!insertmacro MUI_LANGUAGE "French"
; MUI end ------
CreateShortCut "$DESKTOP\Evergreen Staff Client ${PRODUCT_TAG}.lnk" "$INSTDIR\evergreen.exe"
; External script for extra things.
+ !ifdef EXTRAS
!define EXTERNAL_EXTRAS_SECMAIN
!include /NONFATAL "extras.nsi"
!undef EXTERNAL_EXTRAS_SECMAIN
+ !endif
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
; Section descriptions
+!ifdef AUTOUPDATE | DEVELOPER | PERMACHINE
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SECMAIN} "The Evergreen Staff Client with XULRunner, Required"
!ifdef AUTOUPDATE
!insertmacro MUI_DESCRIPTION_TEXT ${SECPERMAC} "Default registration and offline storage to per machine instead of per user"
!endif
!insertmacro MUI_FUNCTION_DESCRIPTION_END
-
+!endif
Function un.onUninstSuccess
HideWindow
Delete "$SMPROGRAMS\$ICONS_GROUP\Evergreen Staff Client.lnk"
; External script for removing extra files before we wipe out the install directory
+ !ifdef EXTRAS
!define EXTERNAL_EXTRAS_UNINSTALL
!include /NONFATAL "extras.nsi"
!undef EXTERNAL_EXTRAS_UNINSTALL
+ !endif
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir /r "$INSTDIR\updates"