From: Kyle Huckins Date: Thu, 2 May 2019 21:11:09 +0000 (+0000) Subject: lp1825891 Hatch Windows Installer ProgramData logs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0ee19694c12e9d215d303f25824e69f89b1a5ca3;p=working%2FHatch.git lp1825891 Hatch Windows Installer ProgramData logs - Create ProgramData/Hatch dir and associated registry key upon installation - Remove ProgramData/Hatch dir upon uninstallation - Set hatch.properties and logging.properties data directory and logging path to ProgramData/Hatch(/hatch.log) Signed-off-by: Kyle Huckins Signed-off-by: Bill Erickson Changes to be committed: modified: installer/windows/hatch.nsi --- diff --git a/installer/windows/hatch.nsi b/installer/windows/hatch.nsi index f5e9e11cd8..08ef332e4d 100644 --- a/installer/windows/hatch.nsi +++ b/installer/windows/hatch.nsi @@ -115,8 +115,17 @@ section "install" !insertmacro _ReplaceInFile "$INSTDIR\extension\host\org.evergreen_ils.hatch.firefox.json" "/path/to/hatch.sh" "$0\\hatch.bat" AccessControl::EnableFileInheritance "$INSTDIR\extension\host\org.evergreen_ils.hatch.chrome.json" AccessControl::EnableFileInheritance "$INSTDIR\extension\host\org.evergreen_ils.hatch.firefox.json" + ; Set logging to be in ProgramData + SetShellVarContext all + ${IfNot} ${FileExists} "$APPDATA\${APPNAME}" + CreateDirectory "$APPDATA\${APPNAME}" + ${EndIf} + !insertmacro _ReplaceInFile "$INSTDIR\hatch.properties" "#data.directory=/tmp/foo" "data.directory=C://ProgramData//${APPNAME}" + !insertmacro _ReplaceInFile "$INSTDIR\logging.properties" "%h/.evergreen/hatch.log" "C://ProgramData//${APPNAME}//hatch.log" ; Registry info for Add/Remove Programs + WriteRegStr HKLM "SOFTWARE\${COMPANYNAME}\${APPNAME}" "Logging Path" $APPDATA + SetShellVarContext current WriteRegStr HKLM "SOFTWARE\${COMPANYNAME}\${APPNAME}" "Install Path" $INSTDIR WriteRegStr HKLM "SOFTWARE\${COMPANYNAME}\${APPNAME}" "Version" "${FULLVERSION}" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" @@ -177,6 +186,13 @@ function un.onInit functionEnd section "uninstall" + # Remove the data log directory + SetShellVarContext all + ${If} ${FileExists} "$APPDATA\${APPNAME}" + RmDir /r /REBOOTOK "$APPDATA\${APPNAME}" + ${EndIf} + SetShellVarContext current + # Remove the actual files Delete /REBOOTOK "$INSTDIR\hatch.bat" Delete /REBOOTOK "$INSTDIR\hatch.properties"