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')
+# Url taken from http://nsis.sourceforge.net/AccessControl_plug-in
+NSIS_ACCESSCONTROL=http://nsis.sourceforge.net/mediawiki/images/4/4a/AccessControl.zip
#------------------------------
# Build ILS XUL CLIENT/SERVER
# Build a windows installer.
win-client: 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 -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_EXTRAOPTS} windowssetup.nsi
@echo 'Done'
# For linux, just build a tar.bz2 archive
!ifdef AUTOUPDATE | PERMACHINE
; For autoupdate and/or registering per machine, make sure we can write to the install directory.
- ; If the AccessControl plugin was packaged or part of nsis we would use it instead.
- ; Also, as cacls.exe is depreciated when icacls.exe exists, try icacls.exe first.
- IfFileExists "$SYSDIR/icacls.exe" 0 +3
- ExecWait '"$SYSDIR/icacls.exe" "$INSTDIR" /grant Everyone:(OI)(CI)F'
- Goto +3
- IfFileExists "$SYSDIR/cacls.exe" 0 +2
- ExecWait '"$SYSDIR/cacls.exe" "$INSTDIR" /E /G Everyone:F'
+ !addplugindir AccessControl/Plugins
+ AccessControl::GrantOnFile "$INSTDIR" "Everyone" "FullAccess"
!endif
SectionEnd