forked from I2P_Developers/i2p.i2p
Correct the path to wrapper.logfile in Windows (see comments in the script for
much more info). Fixes #473
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2011-08-06 kytv
|
||||
* Fix #473 (wrapper.logfile set to the wrong path in Windows).
|
||||
|
||||
2011-07-31 zzz
|
||||
* Crypto: Implement and then comment out an alternate
|
||||
AES-256/CBC implementation using the JVM crypto libs,
|
||||
|
@@ -191,6 +191,9 @@
|
||||
<executable targetfile="$INSTALL_PATH/installer/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH/I2P Router Console.webloc" /></args></executable>
|
||||
-->
|
||||
<!-- workaround for bad default path for wrapper.log in Windows. -->
|
||||
<executable targetfile="$INSTALL_PATH/fix_logfile_path.cmd" type="bin" stage="postinstall" keep="false"> <os family="windows" />
|
||||
</executable>
|
||||
|
||||
<!-- workaround for vista permission problems - see comments above -->
|
||||
<executable targetfile="$INSTALL_PATH/fixperms.bat" type="bin" stage="postinstall" keep="true" failure="warn"
|
||||
|
33
installer/resources/fix_logfile_path.cmd
Normal file
33
installer/resources/fix_logfile_path.cmd
Normal file
@@ -0,0 +1,33 @@
|
||||
@echo off
|
||||
:: fix_logfile_path.cmd
|
||||
::
|
||||
:: This is a simple (and/or stupid) script whose sole purpose is to set the
|
||||
:: correct path for wrapper.logfile, by explicitly setting it to use the
|
||||
:: environment variable %temp%.
|
||||
::
|
||||
:: On every *NIX-like system, $SYSTEM_java_io_tmpdir/wrapper.log points to a system-level
|
||||
:: temp directory (/tmp on Linux, /var/tmp on BSD, etc.), but in Windows the value of %temp%
|
||||
:: depends on whose account a process is running under. If the same user that installs I2P
|
||||
:: is the only one that will run I2P, this isn't a problem.
|
||||
::
|
||||
:: The problem comes from trying to run the process as a service, or trying to run under an
|
||||
:: account other than the one that did the installation. For example if the user "Administrator"
|
||||
:: installed I2P on Windows 7, the value for wrapper.logfile will be set to the hardcoded value of
|
||||
:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log (if it's left at the default value of
|
||||
:: $SYSTEM_java_io_tmpdir/wrapper.log.
|
||||
::
|
||||
:: If user Alice tries to run I2P, the wrapper will try to write its logfile to
|
||||
:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log. Unfortunately Alice
|
||||
:: doesn't have the rights to access Administrator's temp directory. The same
|
||||
:: will happen with the "limited access account" that the I2P service runs
|
||||
:: under.
|
||||
::
|
||||
:: Since Windows doesn't have sed and it has a retarded find, we resort to this
|
||||
:: lameness.
|
||||
::
|
||||
cd /d %~dp0
|
||||
find /V /I "wrapper.logfile=" wrapper.config > wrapper.new
|
||||
echo wrapper.logfile=%%temp%%\wrapper.log >> wrapper.new
|
||||
move wrapper.new wrapper.config
|
||||
|
||||
:: As an added bonus, wrapper.config now has DOS line endings in Windows.
|
Reference in New Issue
Block a user