From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 18 Mar 2011 18:08:51 +0000 (+0000)
Subject: Switch to AccessControl plugin, more reliable.
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a14e79755db3e4d27174619d2170456444847b18;p=evergreen%2Fmasslnc.git

Switch to AccessControl plugin, more reliable.

Only fetches it when needed.

Also make NSIS Less...verbose. Warnings/errors only.

Author: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>


git-svn-id: svn://svn.open-ils.org/ILS/trunk@19810 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am
index a462ec0b5a..5e3a030fe5 100644
--- a/Open-ILS/xul/staff_client/Makefile.am
+++ b/Open-ILS/xul/staff_client/Makefile.am
@@ -26,6 +26,8 @@ export NSIS_WICON=$$(if [ -f client/evergreen.ico ]; then echo '-DWICON'; fi)
 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
@@ -250,8 +252,9 @@ linux-xulrunner: client_app
 # 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
diff --git a/Open-ILS/xul/staff_client/windowssetup.nsi b/Open-ILS/xul/staff_client/windowssetup.nsi
index 0427ec9de0..d5077fb888 100644
--- a/Open-ILS/xul/staff_client/windowssetup.nsi
+++ b/Open-ILS/xul/staff_client/windowssetup.nsi
@@ -113,13 +113,8 @@ Section "Staff Client" SECMAIN
 
   !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