Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-4962

Windows service uninstall script dumps script content to console during execution

    Details

      Description

      The uninstall script execution is not clean and it would dumps the script contents to the console instead of showing only a execution status:
      Here is the console output when run the uninstall command

      PS C:\Users\Administrator\Downloads\openidm\bin> .\launcher.bat /uninstall
      
      C:\Users\Administrator\Downloads\openidm\bin>rem @echo off
      
      C:\Users\Administrator\Downloads\openidm\bin>SETLOCAL ENABLEDELAYEDEXPANSION
      
      C:\Users\Administrator\Downloads\openidm\bin>rem Set Launcher Home
      
      C:\Users\Administrator\Downloads\openidm\bin>set CURRENT_DIR=C:\Users\Administrator\Downloads\openidm\bin
      
      C:\Users\Administrator\Downloads\openidm\bin>cd /d "C:\Users\Administrator\Downloads\openidm\bin\launcher.bat"\..
      
      C:\Users\Administrator\Downloads\openidm\bin>set SCRIPT_DIR=C:\Users\Administrator\Downloads\openidm\bin
      
      C:\Users\Administrator\Downloads\openidm\bin>cd ..
      
      C:\Users\Administrator\Downloads\openidm>if not "" == "" goto homeSet
      
      C:\Users\Administrator\Downloads\openidm>set LAUNCHER_SERVER_HOME=C:\Users\Administrator\Downloads\openidm
      
      C:\Users\Administrator\Downloads\openidm>cd "C:\Users\Administrator\Downloads\openidm\bin""
      
      C:\Users\Administrator\Downloads\openidm\bin>if exist "C:\Users\Administrator\Downloads\openidm\bin\launcher.bat" goto h
      omeOk
      
      C:\Users\Administrator\Downloads\openidm\bin>rem Check Java availability
      
      C:\Users\Administrator\Downloads\openidm\bin>if not "C:\Program Files (x86)\Java\jre7\" == "" goto checkJavaHome
      
      C:\Users\Administrator\Downloads\openidm\bin>if exist "C:\Program Files (x86)\Java\jre7\\bin\java.exe" goto javaHomeOk
      
      C:\Users\Administrator\Downloads\openidm\bin>set JAVA="C:\Program Files (x86)\Java\jre7\\bin\java.exe"
      
      C:\Users\Administrator\Downloads\openidm\bin>set JAVA_DLL="C:\Program Files (x86)\Java\jre7\\jre\bin\server\jvm.dll"
      
      C:\Users\Administrator\Downloads\openidm\bin>rem Check and Set CLASSPATH for starting Launcher
      
      C:\Users\Administrator\Downloads\openidm\bin>if not "" == "" goto classpathOK
      
      C:\Users\Administrator\Downloads\openidm\bin>set CP="C:\Users\Administrator\Downloads\openidm\bin\*"
      
      C:\Users\Administrator\Downloads\openidm\bin>rem SET MISC PROPERTIES
      
      C:\Users\Administrator\Downloads\openidm\bin>rem Architecture, can be i386 or amd64 or ia64 (it is basically the directo
      ry name
      
      C:\Users\Administrator\Downloads\openidm\bin>rem where the binaries are stored, if not set this script will try to
      
      C:\Users\Administrator\Downloads\openidm\bin>rem find the value automatically based on environment variables)
      
      C:\Users\Administrator\Downloads\openidm\bin>set ARCH=
      
      C:\Users\Administrator\Downloads\openidm\bin>rem find out the architecture
      
      C:\Users\Administrator\Downloads\openidm\bin>if """" == """" (
      set ARCH=i386
       if ""AMD64"" == ""AMD64"" set ARCH=amd64
       if ""AMD64"" == ""IA64"" set ARCH=ia64
      )
      
      C:\Users\Administrator\Downloads\openidm\bin>rem Set Launcher start params, needs to be separated by ;
      
      C:\Users\Administrator\Downloads\openidm\bin>if not "" == "" goto launcerStartOK
      
      C:\Users\Administrator\Downloads\openidm\bin>set LAUNCHER_START_PARAMS=-c;bin/launcher.json
      
      C:\Users\Administrator\Downloads\openidm\bin>rem -------------------------------------------------------------
      
      C:\Users\Administrator\Downloads\openidm\bin>if ""/uninstall"" == ""/install"" goto srvInstall
      
      C:\Users\Administrator\Downloads\openidm\bin>if ""/uninstall"" == ""/uninstall"" goto srvUninstall
      
      C:\Users\Administrator\Downloads\openidm\bin>shift
      
      C:\Users\Administrator\Downloads\openidm\bin>if not """" == """" (set SERVICE_NAME= )  else (set SERVICE_NAME=ForgeRockL
      auncherJavaService )
      
      C:\Users\Administrator\Downloads\openidm\bin>"C:\Users\Administrator\Downloads\openidm\bin\amd64\prunsrv.exe" //DS//Forg
      eRockLauncherJavaService
      
      C:\Users\Administrator\Downloads\openidm\bin>echo Service "ForgeRockLauncherJavaService" removed successfully
      Service "ForgeRockLauncherJavaService" removed successfully
      
      C:\Users\Administrator\Downloads\openidm\bin>goto :EOF
      PS C:\Users\Administrator\Downloads\openidm\bin>
      

      Note: The script worked in uninstalling OpenIDM service.

        Attachments

          Activity

            People

            • Assignee:
              brmiller Brendan Miller
              Reporter:
              Tinghua.Xu Tinghua Xu
              QA Assignee:
              Tinghua Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: