!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}"
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"