Changeset 0617ee9


Ignore:
Timestamp:
Mar 27, 2011 1:30:30 AM (9 years ago)
Author:
HungryHobo <HungryHobo@…>
Branches:
master
Children:
a188275
Parents:
4fbde3a
Message:

Fix: Wrong working dir when running as a Windows service

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r4fbde3a r0617ee9  
    409409        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
    410410        <copy file="installer/resources/postinstall.bat" todir="pkg-temp/" />
     411        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
    411412        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
    412413        <copy todir="pkg-temp/lib/wrapper/win32/">
  • installer/install.xml

    r4fbde3a r0617ee9  
    184184            <description>Automatically start I2P in the background</description>
    185185            <os family="windows" />
     186            <executable targetfile="$INSTALL_PATH/set_config_dir_for_nt_service.bat" stage="postinstall" failure="warn" keep="false" />
    186187<!--
    187             <executable targetfile="$INSTALL_PATH/install_i2p_service_winnt.bat" stage="postinstall" failure="warn" keep="true" />
    188188-->
    189189            <executable targetfile="$INSTALL_PATH/install_i2p_service_winnt.bat" stage="postinstall" failure="warn" keep="true">
     
    199199                </args>
    200200            </executable>
    201 <!--
    202             <executable targetfile="$INSTALL_PATH/uninstall_i2p_service_winnt.bat" stage="uninstall" failure="warn" keep="true" />
    203 -->
    204201            <executable targetfile="$INSTALL_PATH/uninstall_i2p_service_winnt.bat" stage="uninstall" failure="warn" keep="true">
    205202                <args>
  • router/java/src/net/i2p/router/startup/WorkingDir.java

    r4fbde3a r0617ee9  
    165165    }
    166166
    167     /** Returns <code>false</code> if a directory is empty, or contains nothing besides a subdirectory named plugins */
     167    /**
     168     * Tests if <code>dir</code> has been set up as a I2P working directory.<br/>
     169     * Returns <code>false</code> if a directory is empty, or contains nothing besides
     170     * subdirectories named <code>plugins</code> and/or <code>logs</code>.<br/>
     171     * Returns <code>true</code> if the directory contains something not named
     172     * <code>plugins</code> or <code>logs</code>.</br>
     173     * This allows to pre-install plugins before the first router start.
     174     */
    168175    private static boolean isSetup(File dir) {
    169176        if (dir.isDirectory()) {
    170177            String[] files = dir.list();
    171             if (files.length == 0)
    172                 return false;
    173             if (files.length>1 || !"plugins".equals(files[0]))
    174                 return true;
     178            if (files == null)
     179                return false;
     180            for (String file: files)
     181                if (!"plugins".equals(file) && !"logs".equals(file))
     182                    return true;
    175183        }
    176184        return false;
Note: See TracChangeset for help on using the changeset viewer.