4 Replies Latest reply on Sep 14, 2010 8:43 AM by jmac

    batch package with reboot

    Apprentice

      Hi all,

       

      i'm trying to build a package which needs to reboot and continue installation after the reboot.

       

      the script (which uninstalls old sapgui, reboots and installs new version) looks like this:

       

      IF NOT "%2."=="." GOTO error
      IF "%1."=="." GOTO uninstall
      IF "%1"=="sapinstall" GOTO %1

       

      :uninstall

      sdclient.exe /msg="%DATE% %TIME% - uninstall, cleanup.."

      if exist "%PROGRAMFILES%\SAP\SapSetup\setup\NwSapSetup.exe" "%PROGRAMFILES%\SAP\SapSetup\setup\NwSapSetup.exe" /uninstall /all /silent

      if exist "%PROGRAMFILES%\SAPpc" rd /S /Q "%PROGRAMFILES%\SAPpc"
      if exist "%PROGRAMFILES%\SAP\Frontend" rd /S /Q "%PROGRAMFILES%\SAP\Frontend"
      if exist "%PROGRAMFILES%\Gemeinsame Dateien\SAP Shared" rd /S /Q "%PROGRAMFILES%\Gemeinsame Dateien\SAP Shared"


      :reboot
      sdclient.exe /msg="Rebooting..."
      sdclient.exe /onreboot /bat /p=%0 /cmds=sapinstall
      sdclient.exe /reboot
      GOTO end

       

      :sapinstall

       

      sdclient.exe /msg="%DATE% %TIME% - installation of new sap package"

      cscript install\setup.vbs install\SAP_FULL.exe /silent
      cscript install\setup.vbs install\patches\bi710sp11_1100-10004472.exe /silent


      :error

      exit /B 1


      :success

      sdclient.exe /msg="%date% %time% - successfull installation."


      :end

       

      The uninstall section works fine and the reboot is triggered. After the reboot (Result: "Machine has successfully restarted") the package fails (Result: "failed to install package"). But this only happens when i do not directly login to the machine. If I login after the reboot everything is fine and the package continues with the sapinstall-section. If i do not login immediately the package fails.

       

      Is the above scenario only working with an autologin?

       

      Currently i'm using a workaround which creates a LocalSch.exe <...> /toe="logon" task, which fires the installation after the user logs on to the machine, but i would like to know if i missunderstand something using sdclient.exe /onreboot

       

      Thanks & best regards,

      Dirk

       

      ps: i'm running ldms8.8 sp4