mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
24.25.2007 77eebebe9004fbcedd79da2c5fe729a875f82281
fixed problems related to running the upgrader in Windows
5 files modified
47 ■■■■■ changed files
opendj-sdk/opends/resource/upgrade.bat 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallLauncher.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/resource/upgrade.bat
@@ -32,18 +32,23 @@
:checkJavaBin
if "%JAVA_BIN%" == "" goto noJavaBin
if "%*" == "" goto callWebStartUpgrade
goto callExtractor
:noJavaBin
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
set JAVA_BIN=%JAVA_HOME%\bin\java.exe
set jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
if "%*" == "" goto callWebStartUpgrade
goto callExtractor
:noJavaHome
if not exist "%DIR_HOME%\bat\set-java-home.bat" goto noSetJavaHome
call "%DIR_HOME%\bat\set-java-home.bat"
set JAVA_BIN=%JAVA_HOME%\bin\java.exe
set jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
if "%*" == "" goto callWebStartUpgrade
goto callExtractor
:noSetJavaHome
@@ -53,12 +58,7 @@
set PATH=%SystemRoot%
if "%*" == "" goto callLaunch
goto callJava
:callLaunch
"%DIR_HOME%\lib\winlauncher.exe" launch "%DIR_HOME%" "%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.upgrader.UpgradeLauncher
goto end
if "%*" == "" goto callWebStartUpgrade
:callExtractor
if EXIST .\tmp\upgrade rd .\tmp\upgrade /s /q
@@ -68,6 +68,13 @@
if %ERRORLEVEL%==0 goto callUpgrader
goto end
:callWebStartUpgrade
set JAVAWS_VM_ARGS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -Dorg.opends.quicksetup.upgrader.Root="%DIR_HOME%"
rem set JAVAWS_VM_ARGS=-Dorg.opends.quicksetup.upgrader.Root="%DIR_HOME%"
if "%OPENDS_UPGRADE_JNLP%" == "" set OPENDS_UPGRADE_JNLP=http://build.opends.org/install/QuickUpgrade.jnlp
"%JAVAWS_BIN%" "%OPENDS_UPGRADE_JNLP%"
goto end
:callUpgrader
set CLASSPATH=""
FOR %%x in ("%DIR_HOME%\tmp\upgrade\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -114,7 +114,6 @@
   */
  protected void printUsage(String i18nMsg) {
    System.err.println(i18nMsg);
    System.exit(QuickSetupCli.USER_DATA_ERROR);
  }
  /**
@@ -234,26 +233,24 @@
  /**
   * The main method which is called by the uninstall command lines.
   * @return int exit code that should be returned upon exit of this program
   */
  public void launch() {
  public int launch() {
    int exitCode = 0;
    if (shouldPrintUsage()) {
      printUsage();
      exitCode = QuickSetupCli.USER_DATA_ERROR;
    } else if (isCli()) {
      int exitCode = launchCli(args, createCliApplication());
      if (exitCode != 0) {
        System.exit(exitCode);
      }
      exitCode = launchCli(args, createCliApplication());
    } else {
      willLaunchGui();
      int exitCode = launchGui(args);
      exitCode = launchGui(args);
      if (exitCode != 0) {
        guiLaunchFailed();
        exitCode = launchCli(args, createCliApplication());
        if (exitCode != 0) {
          System.exit(exitCode);
        }
      }
    }
    return exitCode;
  }
  /**
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java
@@ -49,7 +49,7 @@
   * will pass to the org.opends.server.tools.InstallDS class.
   */
  public static void main(String[] args) {
    new InstallLauncher(args).launch();
    System.exit(new InstallLauncher(args).launch());
  }
  /**
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallLauncher.java
@@ -48,7 +48,7 @@
   * will pass to the org.opends.server.tools.InstallDS class.
   */
  public static void main(String[] args) {
    new UninstallLauncher(args).launch();
    System.exit(new UninstallLauncher(args).launch());
  }
  /**
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -242,6 +242,7 @@
    String[] args = new String[argList.size()];
    argList.toArray(args);
    ProcessBuilder pb = new ProcessBuilder(args);
    pb.directory(installation.getBinariesDirectory());
    Map<String, String> env = pb.environment();
    env.put("JAVA_HOME", System.getProperty("java.home"));
    /* Remove JAVA_BIN to be sure that we use the JVM running the installer
@@ -249,6 +250,12 @@
     */
    env.remove("JAVA_BIN");
    // Upgrader's classpath contains jars located in the temporary
    // directory that we don't want locked by the directory server
    // when it starts.  Since we're just calling the start-ds script
    // it will figure out the correct classpath for the server.
    env.remove("CLASSPATH");
    try
    {
      String startedId = getStartedId();