10 Replies Latest reply on Oct 29, 2010 10:22 PM by Jawad.Butt

    Reboot necessary

    Rookie

      I am building a distribution package. Currently I have three .msi and their corresponding .mst. Let's assume that the first .msi which includes the .mst is package 1, the second msi with its corresponding mst is package two, etc. Between package 1 and 2 I need a reboot. Package 2 cannot possibly install until the successful installation of package 1 and a successful reboot.

      I have tried this a couple of different ways. I have tried scripting it using the following:

       

      REM

       

      if "%1" == "" goto section1
      if "%1" == "alldone" goto alldone

       

      :section1
      REM ---------------------------------------------
      Package 1 msi & mst
      REM ---------------------------------------------
      sdclient.exe /msg="The client has not yet rebooted."
      sdclient.exe /onreboot /bat /p=%0 /cmds=alldone
      sdclient.exe /reboot
      goto getout

       

      :alldone
      REM -----------------------------------------
      Package 2 & 3
      REM -----------------------------------------
      set errorlevel=0
      sdclient.exe /msg="The client has reboot three times, we are now done."
      :getout

      exit

       

       

      This seems to install the first package and reboot the machine just fine but when the client comes back up LANDesk does not continue the installation.

      If however I build a msi distribution package for package 1,2, & 3 and make package 3 dependent on 2 and 2 dependent on 1 and force a restart on package 1, it copies the files the the cache but never does any installation or reboot. What am I missing?

        • 1. Re: Reboot necessary
          zman Master

          What version of LANDesk and SP? I've had some issues with 8.8 where it would not continue after reboot. Make sure when you define your batch file distribution package you command line sysntax is case sensitive. You could:

           

          1. Use provisioning. http://community.landesk.com/support/docs/DOC-4648
          2. Forgoe using sdclient /onreboot and just script - See below  - mdt_upgrade_new.cmd is the batch file I copy down and continue to run with a command line var in the runonce key. The only problem is you lose package distribution status after the first reboot. Here is the runonce statement:

           

           

          REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RUNONCE /v MDT_UPGRADE /t REG_SZ /d "\"%PROGRAMFILES%\Landesk\Ldclient\sdclient.exe\" /p=\"c:\data\mdt_upgrade_new.cmd\" /cmds=\"post-reboot_1\" /bat /detachedmode /Ac /N /E"  /f 
          
          

           

           

          First Batch File called with LANDesk

           

          @ECHO OFF
          ECHO Running MDT Upgrade Do Not Close Window
          Echo %DATE% - %TIME% - Copy of Required Files  - Start >> C:\LOGS\MDT_UPDATE.LOG
              IF NOT EXIST C:\DATA\ (
                  MD C:\DATA
              )
          xcopy \\SERVERNAME\SHARE\mdt_upgrade_new.cmd c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\a_logon_embed.exe c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\hostchange.exe c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\auto_updates.exe c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\pointsec.reg c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\cleanup.reg c:\data /c /q /h /y
          xcopy "\\SERVERNAME\SHARE\Mobile Maps.inf" c:\data /c /q /h /y
          xcopy "\\SERVERNAME\SHARE\MDSDispatch.inf" c:\data /c /q /h /y
          xcopy \\SERVERNAME\SHARE\delprof.exe c:\data /c /q /h /y 
          xcopy \\SERVERNAME\SHARE\ICSweep.exe c:\data /c /q /h /y
           
          
          
              IF NOT EXIST c:\data\mdt_upgrade_new.cmd (
                  Echo %DATE% - %TIME% - c:\data\mdt_upgrade_new.cmd Not found!  Script will not continue. >> C:\LOGS\MDT_UPDATE.LOG
                  CLS 
                  Exit /B 0
              )
              IF NOT EXIST c:\data\a_logon_embed.exe (
                  Echo %DATE% - %TIME% - c:\data\a_logon_embed.exe Not found!  Script will not continue. >> C:\LOGS\MDT_UPDATE.LOG
                  CLS 
                  Exit /B 0
              )
              IF NOT EXIST c:\data\hostchange.exe (
                  Echo %DATE% - %TIME% - c:\data\hostchange.exe Not found!  Script will not continue. >> C:\LOGS\MDT_UPDATE.LOG
                  CLS 
                  Exit /B 0
              )
              IF NOT EXIST c:\data\auto_updates.exe (
                  Echo %DATE% - %TIME% - c:\data\auto_updates.exe Not found!  Script will not continue. >> C:\LOGS\MDT_UPDATE.LOG
                  CLS 
                  Exit /B 0
              )
            
          Echo %DATE% - %TIME% - Copy of Required Files  - Finish >> C:\LOGS\MDT_UPDATE.LOG
          Echo %DATE% - %TIME% - Spawning mdt_upgrade_new.cmd >> C:\LOGS\MDT_UPDATE.LOG
          "%PROGRAMFILES%\Landesk\Ldclient\sdclient.exe" /p="c:\data\mdt_upgrade_new.cmd"  /bat /detachedmode /Ac /N /E 
          EXIT /B 0
          

           

           

           

           

          Second Batch File.

          @ECHO ON
          
          :checkparameter
          :: Batch fails if two parameters are given or if the first
          :: parameter is does not match a valid label.
          IF NOT "%2."=="." GOTO invalidparameter
          IF "%1."=="." GOTO pre-reboot
          IF "%1"=="post-reboot_1" GOTO post-reboot_1
          IF "%1"=="post-reboot_2" GOTO post-reboot_2
          IF "%1"=="post-reboot_3" GOTO post-reboot_3
          
          :invalidparameter
              :: Only one parameter is allowed.
              ECHO Error: Invalid Parameter
              ECHO Valid parameter: [post-reboot]
              GOTO end
          
          :pre-reboot
              Echo %DATE% - %TIME% - Begin pre-boot >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_1 - Start >> C:\LOGS\MDT_UPDATE.LOG
              REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RUNONCE /v MDT_UPGRADE /t REG_SZ /d "\"%PROGRAMFILES%\Landesk\Ldclient\sdclient.exe\" /p=\"c:\data\mdt_upgrade_new.cmd\" /cmds=\"post-reboot_1\" /bat /detachedmode /Ac /N /E"  /f 
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_1 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Taskkill - Start >> C:\LOGS\MDT_UPDATE.LOG
              %windir%\system32\TASKKILL.EXE /F /IM vulscan.exe /T
              %windir%\system32\TASKKILL.EXE /F /IM ldiscn32.exe /T
              Echo %DATE% - %TIME% - Running Taskkill - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Run Inventory Scan - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\Landesk\Ldclient\ldiscn32.exe" /L /NOUI
              Echo %DATE% - %TIME% - Run Inventory Scan - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Remove Run Items - Start >> C:\LOGS\MDT_UPDATE.LOG
              Call :remove_run_items
              Echo %DATE% - %TIME% - Remove Run Items - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Auto Logon - Start >> C:\LOGS\MDT_UPDATE.LOG
              C:\DATA\a_logon_embed.exe /s 
              Echo %DATE% - %TIME% - Auto Logon - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Host Change - Start >> C:\LOGS\MDT_UPDATE.LOG
              C:\DATA\hostchange.exe -q -d
              Echo %DATE% - %TIME% - Host Change - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Cleanup - Start >> C:\LOGS\MDT_UPDATE.LOG
              Call :clean_up
              Echo %DATE% - %TIME% - Cleanup - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - End pre-boot >> C:\LOGS\MDT_UPDATE.LOG
          
          :reboot
              Echo %DATE% - %TIME% - Rebooting 1 >> C:\LOGS\MDT_UPDATE.LOG
              %WINDIR%\System32\shutdown.exe -r -f -c "First Reboot MDT Upgrade" -t 10
              GOTO end
          
          :post-reboot_1
              Echo %DATE% - %TIME% - Begin post-reboot_1 >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_2 - Start >> C:\LOGS\MDT_UPDATE.LOG
              REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RUNONCE /v MDT_UPGRADE /t REG_SZ /d "\"%PROGRAMFILES%\Landesk\Ldclient\sdclient.exe\" /p=\"c:\data\mdt_upgrade_new.cmd\" /cmds=\"post-reboot_2\" /bat /detachedmode /Ac /N /E"  /f 
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_2 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Taskkill - Start >> C:\LOGS\MDT_UPDATE.LOG
              %windir%\system32\TASKKILL.EXE /F /IM vulscan.exe /T
              %windir%\system32\TASKKILL.EXE /F /IM ldiscn32.exe /T
              Echo %DATE% - %TIME% - Running Taskkill - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Vulscan - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running Vulscan - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Office 2007 - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=Microsoft Office 2007" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running Office 2007 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Adobe Reader 9.3 - Start  >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=Acrobat Reader 9.3" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running Adobe Reader 9.3 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running MCafee Virus Scan - Start >> C:\LOGS\MDT_UPDATE.LOG
              :: Need to Uninstall Older versions of spyware module of mcafee installer halts - only on MDTs
            IF Exist "%ProgramFiles%\network associates\common framework\*.*" "%ProgramFiles%\network associates\common framework\frminst.exe" /forceuninstall /s
              "%ProgramFiles%\Program Files\Network Associates\VirusScan\csscan.exe" /UninstallMAS
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=Mcafee 8.7" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running MCafee Virus Scan - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running XP SP3 - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=WXP-SP3" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running XP SP3 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - End post-reboot_1 >> C:\LOGS\MDT_UPDATE.LOG
          
          
          :reboot_2
              Echo %DATE% - %TIME% - Rebooting 2 >> C:\LOGS\MDT_UPDATE.LOG
              %WINDIR%\System32\shutdown.exe -r -f -c "Second Reboot MDT Upgrade" -t 10
              GOTO end
           
          :post-reboot_2
              Echo %DATE% - %TIME% - Begin post-reboot_2 >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_3 - Start >> C:\LOGS\MDT_UPDATE.LOG
              REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RUNONCE /v MDT_UPGRADE /t REG_SZ /d "\"%PROGRAMFILES%\Landesk\Ldclient\sdclient.exe\" /p=\"c:\data\mdt_upgrade_new.cmd\" /cmds=\"post-reboot_3\" /bat /detachedmode /Ac /N /E"  /f 
              Echo %DATE% - %TIME% - Update Reg Run Key post-reboot_3 - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Taskkill - Start >> C:\LOGS\MDT_UPDATE.LOG
              %windir%\system32\TASKKILL.EXE /F /IM infoclient.exe /T
              %windir%\system32\TASKKILL.EXE /F /IM vulscan.exe /T
              %windir%\system32\TASKKILL.EXE /F /IM ldiscn32.exe /T
              Echo %DATE% - %TIME% - Running Taskkill - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Patches - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "Group=8144" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running Patches - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running SDMCACHE - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=LANDesk_Discard_Period" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running SDMCACHE - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - End post-reboot_2 >> C:\LOGS\MDT_UPDATE.LOG
           
          :reboot_3
              Echo %DATE% - %TIME% - Rebooting 3 >> C:\LOGS\MDT_UPDATE.LOG
              %WINDIR%\System32\shutdown.exe -r -f -c "Second Reboot MDT Upgrade" -t 10
              GOTO end
               
          :post-reboot_3
              Echo %DATE% - %TIME% - Begin post-reboot_3 >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running PointSec - Start >> C:\LOGS\MDT_UPDATE.LOG
              "%PROGRAMFILES%\landesk\ldclient\vulscan.exe" /repair "vulnerability=PointSec" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              Echo %DATE% - %TIME% - Running PointSec - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Restore Run Items - Start >> C:\LOGS\MDT_UPDATE.LOG
              CALL :restore_run_items
              Echo %DATE% - %TIME% - Running Restore Run Items - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Turn Auto Updates Off - Start >> C:\LOGS\MDT_UPDATE.LOG
              C:\DATA\auto_updates.exe
              Echo %DATE% - %TIME% - Running Turn Auto Updates Off - Finish >> C:\LOGS\MDT_UPDATE.LOG
              :: run Mcafee Hips
              ::"c:\program files\landesk\ldclient\vulscan.exe" /repair "vulnerability=Mcafee HIPS" /NoSync /AgentBehavior=1 /AutoCloseTimeout=1
              ::Echo %DATE% - %TIME% - Running Hips Complete >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running AutoLogon Reset - Start >> C:\LOGS\MDT_UPDATE.LOG
              C:\DATA\a_logon_embed.exe /r
              Echo %DATE% - %TIME% - Running AutoLogon Reset - Finish >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - End post-reboot_3 >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Running Reboot 3 - Start >> C:\LOGS\MDT_UPDATE.LOG
              START %WINDIR%\System32\shutdown.exe -r -f -c "Final Reboot MDT Upgrade" -t 20
              Echo %DATE% - %TIME% - Running Reboot 3 - Complete >> C:\LOGS\MDT_UPDATE.LOG
              Echo %DATE% - %TIME% - Upgrade Complete >> C:\LOGS\MDT_UPDATE.LOG
              Exit /B 0
              
          ::----------------------------------------------------[Sub routines ]-----------------------------------------------------------------
          :remove_run_items
              IF NOT EXIST C:\DATA\ (
                  MD C:\DATA
              )
              ::Remove Programs that will cause problems with Provisioning.
              IF NOT EXIST C:\DATA\REG_RUN.REG (
                  REG EXPORT HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run C:\DATA\REG_RUN.REG
              ) ELSE (
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V AGRSMMSG /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V Infoclient /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V GpsReaderServiceMonitor /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V SafetyBriefingsSync /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V MAPV /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V SunJavaUpdateSched /f
                  REG DELETE HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V McAfeeUpdaterUI /f
              )
              :: Remove StartUp Menu Items
              IF NOT EXIST C:\DATA\STARTUPZ\ (
                  MD C:\DATA\STARTUPZ\
              )
              XCOPY "%ALLUSERSPROFILE%\Start Menu\Programs\Startup\*.*" C:\DATA\STARTUPZ\*.* /C /H /R /Y
              DEL /F /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Startup\*.*" 
              SC STOP cgi.ssp.cad.service start= disabled
              SC STOP cgi.ssp.cad.processstarter start= disabled
              SC STOP cgi.ssp.cad.gpsreaderservice start= disabled
              SC STOP infoclientwinlogondesktop start= disabled
              SC STOP infoclientuserdesktop start= disabled
              SC STOP vclient start= disabled
              SC STOP CMSClient start= disabled
              SC config cgi.ssp.cad.service start= disabled
              SC config cgi.ssp.cad.processstarter start= disabled
              SC config cgi.ssp.cad.gpsreaderservice start= disabled
              SC config infoclientwinlogondesktop start= disabled
              SC config infoclientuserdesktop start= disabled
              SC config vclient start= disabled
              SC config CMSClient start= disabled
          GOTO :EOF
          
          
          :restore_run_items
              ::Remove Programs that will cause problems with Provisioning.
              REG ADD HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V AGRSMMSG /t REG_SZ /d AGRSMMSG.exe /F
              REG ADD HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V SafetyBriefingsSync /t REG_SZ /d "\"C:\Program files\SAFEAPP\\minimize.exe\" \"C:\Program files\SAFEAPP\\safetysync.cmd\"" /F
              REG ADD HKLM\SOftware\Microsoft\Windows\CurrentVersion\Run /V MAPV /t REG_SZ /d "cmd /c net use v: \\%COMPUTERNAME%\videos" /F
              :: RESTORE StartUp Menu Items
              XCOPY C:\DATA\STARTUPZ\*.*  "%ALLUSERSPROFILE%\Start Menu\Programs\Startup\*.*"  /c /q /h /r /y
              SC config cgi.ssp.cad.service start= auto
              SC config cgi.ssp.cad.processstarter start= auto
              SC config cgi.ssp.cad.gpsreaderservice start= auto
              SC config infoclientwinlogondesktop start= auto
              SC config infoclientuserdesktop start= auto
              SC config vclient start= auto
              SC config CMSClient start= auto
              ::Restore Pointsec/Ecutel Gina
              regedit /S C:\DATA\pointsec.reg 
          GOTO :EOF
          
          
          :clean_up
              del /F /Q C:\WINDOWS\security\*.log
              del /F /S /Q C:\WINDOWS\temp\*.*
              del /F /S /Q %TEMP%\*.*
              del /F /Q C:\WINDOWS\security\*.log
              secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /log ss.log
              ::Replace Rights for Mobile Maps
              IF EXIST "c:\Program Files\Mobile Maps" (
                Secedit.exe /configure /cfg "c:\Mobile Maps.inf" /db "C:\WINDOWS\security\templates\Mobile Maps"
              )
              ::Replace Rights on CGI folder
              IF EXIST "c:\Program Files\CGI" (
                Secedit.exe /configure /cfg "c:\data\Complete\MDSDispatch.inf" /db "C:\WINDOWS\security\templates\MDSDispatch"
              )
              rundll32 wbemupgd, UpgradeRepository
              net stop "Cryptographic Services"
              del /F /Q /S %SystemRoot%\System32\catroot2\*.*
              del /F /Q %windir%\security\logs\*.log
              net start "Cryptographic Services"
              msiexec /unregister
              msiexec /regserver
              regsvr32 /s %windir%\system32\msi.dll
              Net Start "Windows Firewall/Internet Connection Sharing (ICS)"
              C:\DATA\delprof.exe /q /i /d:90
              C:\DATA\ICSweep.exe /all
              rd /s /q  c:\drvrs 
              del %WINDIR%\TEMP /s /q /f
              REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Compress old files" /f
              REGEDIT /S c:\data\cleanup.reg
              CLEANMGR /sagerun:89
              CHKDSK C: 
              IF ERRORLEVEL 2 (
                  Echo %DATE% - %TIME% - Running Mark Drive Dirty - Start >> C:\LOGS\MDT_UPDATE.LOG
                  fsutil dirty set c:
                  Echo %DATE% - %TIME% - Running Mark Drive Dirty - Finish >> C:\LOGS\MDT_UPDATE.LOG
              )    
          GOTO :EOF
          
          :end
          
          1 of 1 people found this helpful
          • 2. Re: Reboot necessary
            Rookie

            So if I am reading this correctly the answer to my question is no, landesk (9 btw) cannot do this. I know I can do this through registry edits, the part that throws me is that this is an advertised feature of Landesk. I read the book and they offer a script, which I used to no avail. This seems a little silly that we have to use windows features to do what Landesk offers as a solution.

            • 3. Re: Reboot necessary
              irishmn76 SupportEmployee

              LANDesk 9 can do this, but it's done in two ways, one is via provisioning today, just like zman said.  The other is done via our method you talked about where with msi files and using dependencies it survives the reboot.  If you'd like to make your method work, I'd suggest you use LANDesk and edit the actions.ini file.  (It's technically what the msi file thing does.)  To do this check out: http://www.droppedpackets.org/systemmanagement/ldms/swd/running-tasks-before-login/  Otherwise use the Pre, Main, and Post package that is part of the scheduled task.  It will allow you to survive the reboots as well, but is limited to just one package per section.

              • 4. Re: Reboot necessary
                zman Master

                Denny is correct it can survive reboots. What I posted is a work a round for when things don't work. I've also had instances (I think some operational conditions) where no matter what, the scheduled task does not survive a reboot. Time is critical and sometime you don't have a lot of it to figure out why and thus work arounds and hacks. For instance I mark the drive dirty and do a chkdsk which reboots. This really screws LANDesk up.  Plus my post is longer

                • 5. Re: Reboot necessary
                  Apprentice

                  looks like i've got the same problem here

                   

                   

                  what i did is:

                   

                  i scheduled the second part (the part after the reboot) as a localsch-task:

                   

                  LocalSch.exe /exe="%SYSTEMROOT%\system32\wscript.exe" /cmd="""%LD_CLIENT_DIR%\sdmcache\ldpkg\%PACKAGE_NAME%\install\install_part2.vbs""" /toe="logon"

                  "%LD_CLIENT_DIR%\vulscan.exe" /rebootIfNeeded /agentbehavior=221 /nosync

                   

                   

                  The vbs is part of the package (additional file) and does the rest when the user logs in (with SYSTEM Account privileges). Im rebooting with vulscan.exe which allows the logged on user to defer the reboot.

                   

                   

                  Works great for me.

                  • 6. Re: Reboot necessary
                    Expert

                    Good idea on the scheduled task. The only downside I could see would depend on the security configuration. The sceduled task would need to be set to run as an administrator (if the logged in user is not), file and print needs to be enabled and the user (logged in or the one running the script) needs to have network access to the machine.

                     

                    I had a project that required something the same where 1 app installed, rebooted the machine and then a second installed and rebooted again. I used the runonce reg key and changed the autologin settings in the registry. Not the best idea but it worked at the time. (note: don't use a domain account for the autologin, create a local account instead)

                     

                    My suggestion would be to use a provisioning script. Its easier to setup and manage and can be tweaked without having to access the machine directly should it fail.

                    • 7. Re: Reboot necessary
                      Apprentice

                      the cool thing when using "landesk's localsch.exe scheduler" is, that the tasks are not run in the security context of the user. they're running under the SYSTEM account.

                      • 8. Re: Reboot necessary
                        Rookie

                        Thank you all for your input, however, it has uncovered another issue.

                        In retrospect the reboot sequence I was using worked like a charm, the problem was with running msiexec.exe. So I apologize to those I may have offended by being frustrated with the reboot sequence (still have never seen it work but can assume it is no longer the problem).

                         

                        Right now I have scripted a batch file to run my MSI and MSTs. I have to make separate registry edits so it made sense rather than doing a straight MSI install. When I push the batch file it says it has run successfully but in reality it does not do the installation. I am becoming convinced that it is a problem with installing this particular MSI with a domain service admin account. If I am at the console and use the service account to login I can run the batch and it install the files just fine. If I choose instead to run it from landesk with the local account that is logged in and I have a local admin/domain user account logged in I can run the push and it works just fine. I just cannot seem to run it with the machine logged out with a domain admin service account. Any suggestions for things to look for?

                        • 9. Re: Reboot necessary
                          Apprentice

                          I'm still having trouble with this. Reboots really suck

                          The localsch-workaround i've posted before doesn't work properly.

                           

                          the only solution that is really working is zman's version.

                           

                          I'm using sdclient.exe to fire a vbscript which I previously copied to the machine.

                           

                          ...\Ldclient\sdclient.exe /p="c:\windows\system32\wscript.exe" /cmds="c:\test.vbs" /bat /detachedmode /Ac /N /E

                           

                          Works great, but can someone tell me, what the commandline switches "/bat" "/detachedmode" and "/E" are good for? I can't find any reference for them.

                           

                          Best regards,

                          Dirk

                          • 10. Re: Reboot necessary
                            Apprentice

                            i use the following registry with Symantec EndPoint protection and it works great. Try it and see how it works.

                             

                            1. Save the following as .reg file

                            2. Create a batch file that adds the reg file to the system registry

                                 a. REGEDIT /S \\server\share\regfile

                            3. Run the next install

                             

                            Note: the - entry deletes the key for Restart Requirement. This is true and has been tested only with Windows 7.

                             

                            Registry Entry...

                             

                            Windows Registry Editor Version 5.00

                            [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
                            "PendingFileRenameOperations"=-
                            [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired]