MRLunchBox Posted June 12, 2013 Share Posted June 12, 2013 Greetings,I'm a noob when it comes to batch files and scripts etc but can somewhat piece together what I need. Basic batch files I can easiliy do, however.I created a batch file that will install about 7 applications. Two of the applications require a reboot (Embassy Security Center (wave which needs to run as a domain uesr) and Single Sign On). 1 could use a reboot if needed.My issue is that the 2 that require the reboot kind of kill each other off. Meaning if its pending the reboot the second app that requires the reboot never starts or starts but fails somewhere after starting. I moved all applications around and still have the same issue.So here is my scenario. The laptop was just imaged, joined to the domain etc. The batch file will be used by the tech to update the image and install additional applications.What I would like is for the batch file to install XX applications reboot and contine to the rest. This would meet the requirement of one app needing the reboot.We dont use SCCM here so I can use a task in our imaging process.The batch file needs to be run by a doman user preferably the initial tech usng run as admin to run it vs a service account. I guess I can move the program so that after the reboot the application that need to be insall can be install using a local admin or a non domain account.I'm willing to try any step, ie. using the run once registry key, converting to powershell etc.Thank you for your timecolor 0A@echo offmode con:cols=90 lines=40Echo.Echo. This utility will perform the following actionsEcho.Echo. 1 Stop Windows Firewall to Prevent issues with InstallationEcho.Echo. 2. Patch Link Client Upgrade and point to new ServerEcho.Echo. 3. AMP Client UpgradeEcho.Echo. 4. Install Lync 2013Echo.Echo. 5. Install WebSense (Blue Coat is no longer used)Echo.Echo. 6. Activate Windows and OfficeEcho.Echo. 7. Install WAVE and TDMRemoteConfigEcho.Echo. 8. Install Single Sign OnEcho.Echo. 9. Install Cisco VPN and add the ProfileEcho.Echo. Reboot to complete the instllation of the application that require itEcho.Echo.Echo. Once the above have completed the job will Auto Reboot the WorkstaionEcho.Echo.Echo.Echo. Press A to StartEcho. Press B to Quit and exitEcho.Echo.Echo.set /p choice=Select your choise to Start= Echo.if not '%choice%'=='' set choice=%choice:~0,1%if '%choice%'=='A' goto Start_Jobif '%choice%'=='B' goto Exitif '%choice%'=='a' goto Start_Jobif '%choice%'=='b' goto ExitEcho.Echo. "%choice%" is not a valid (answer/command)Echo.Echo.Echo.:ExitExit:Start_JobREM ***************************************REM ***************************************REM ******* P R E P W O R KREM ***************************************REM ***************************************REM The following folders are being createdEcho.Echo.Echo. Setup Folder Created atEcho. C:\Windows\TEMP\Workstation_SetupMD C:\Windows\TEMP\Workstation_Setupping -n 2 127.0.0.1>nulMD C:\Windows\TEMP\Workstation_Setup\WAVE-2-7ping -n 2 127.0.0.1>nulMD C:\Windows\TEMP\Workstation_Setup\Lync-2013\ping -n 2 127.0.0.1>nulMD C:\Windows\TEMP\Workstation_Setup\Cisco-VPN\ping -n 2 127.0.0.1>nulREM Ths is where the SSO GD Logo will be copied laterMD C:\ProgramData\GD-Logoping -n 2 127.0.0.1>nulREM The following are being downloadedREM Copy Lumension Agent to local MachineEcho.XCOPY \\SERVER\InfrastructureSoftware\PatchLink\Win7-64Bit\LMAgentx64.msi C:\Windows\TEMP\Workstation_Setup\ /Q /Yping -n 3 127.0.0.1>nulEcho. Lumension Was DownloadedEcho.REM Copy AMP Agent Re-instal to local machineXCOPY \\SERVER\InfrastructureSoftware\AMP\Windows_32_and_64_Bit_Version_11.5_Re-install.exe C:\Windows\TEMP\Workstation_Setup\ /Q /Yping -n 3 127.0.0.1>nulEcho. AMP Was DownloadedEcho.REM Copy AMP Un-Install Agent to local MachineREM XCOPY \\SERVER\InfrastructureSoftware\AMP\Windows_32_and_64_Bit_Version_11.5_Un-install.exe C:\Windows\TEMP\Workstation_Setup\ /Q /YREM ping -n 3 127.0.0.1>nulREM Copy AMP Install Agent to local MachineREM XCOPY \\SERVER\InfrastructureSoftware\AMP\Windows_32_and_64_Bit_Version_11.5_Install.exe C:\Windows\TEMP\Workstation_Setup\ /Q /YREM ping -n 3 127.0.0.1>nulREM Copy Lync 2013 to Local MachineXCOPY \\SERVER\e$\Software\Microsoft\Lync2013_X86_Win7\*.* C:\Windows\TEMP\Workstation_Setup\Lync-2013\ /E/Q /Yping -n 5 127.0.0.1>nulEcho. Lync Was DownloadedEcho.REM Copy WAVE to Local MachineXCOPY \\SERVER\GeneralSoftware\WAVE\WAVE_Embassy_Security_Center_2.7\64BIT_20101221_ESCTDM64_TDM_02.07.00.043b\*.* C:\Windows\TEMP\Workstation_Setup\WAVE-2-7\ /e /Q /Yping -n 5 127.0.0.1>nulEcho. WAVE Was DownloadedEcho.REM Copy WebSense to Local MachineXCOPY \\SERVER\InfrastructureSoftware\WebSense_Remote_Filtering_Agent\Win_64Bit\WebsenseEndpoint_64bit.exe C:\Windows\TEMP\Workstation_Setup\ /Q /Y ping -n 3 127.0.0.1>nulEcho. WebSense Was DownloadedEcho.REM Copy TDMRemoteConfig to Local MachineXCOPY \\SERVER\ClientConfiguration\TDMremoteConfig64.msi C:\Windows\TEMP\Workstation_Setup\ /Q /Yping -n 3 127.0.0.1>nulEcho. TDM Remote Config Was DownloadedEcho.REM Copy Single Sign On app and LogoXCOPY "\\SERVER\sso$\OneSign Agent 4.7.000.10\OneSignAgentx64.msi" C:\Windows\TEMP\Workstation_Setup\ /Q /Yping -n 3 127.0.0.1>nulXCOPY "\\SERVER\sso$\GD-Logo.BMP" C:\Windows\TEMP\Workstation_Setup\ /Q /Yping -n 3 127.0.0.1>nulEcho. Single Sign On and GD Logo were DownloadedREM Copy Cisco VPN and ProfileXCOPY "\\SERVER\Cisco_VPN$\*.*" C:\Windows\TEMP\Workstation_Setup\Cisco-VPN\ /q /yEcho. Cisco VPN was Downloadedping -n 3 127.0.0.1>nulREM ***************************************REM ***************************************REM ******* I N S T A L LREM ***************************************REM ***************************************REM Stop Windows Firewall Servicesc stop MpsSvcping -n 2 127.0.0.1>nulEcho. Windows Firewall StoppedEcho.REM Windows and Office Re-ActivationREM Windows ActivationREG ADD HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\CLASS\{4D36E967-E325-11CE-BFC1-08002BE10318} /v UPPERFILTERS /t REG_MULTI_SZ /d PartMgr /f ping -n 2 127.0.0.1>nulcscript //b "c:\windows\system32\slmgr.vbs" /ipk OUR-KEYping -n 2 127.0.0.1>nulcscript //b "c:\windows\system32\slmgr.vbs" /atoping -n 2 127.0.0.1>nulEcho.REM Office ActivationREM First modify registry to allow activation of OfficeREG ADD HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\CLASS\{4D36E967-E325-11CE-BFC1-08002BE10318} /v UPPERFILTERS /t REG_MULTI_SZ /d PartMgr /f ping -n 2 127.0.0.1>nulcscript //b "C:\Program Files (x86)\Microsoft Office\Office14\ospp.vbs" /inpkey:OUR-KEYping -n 2 127.0.0.1>nulcscript //b "C:\Program Files (x86)\Microsoft Office\Office14\ospp.vbs" /actping -n 2 127.0.0.1>nulEcho. Windows and Office were activatedEcho.Echo.REM Patch Link InstallEcho. Staring Patch Link clinet upgradeC:\Windows\System32\msiexec.exe /i "C:\Windows\Temp\Workstation_Setup\LMAgentx64.msi" /quiet /norestart SERVERIPADDRESS="OUR SERVERping -n 15 127.0.0.1>nulEcho. Lumension was re-installedEcho.Echo.REM AMP Re-installEcho. Starting AMP clinet upgradeC:\Windows\TEMP\Workstation_Setup\Windows_32_and_64_Bit_Version_11.5_Re-install.exeping -n 15 127.0.0.1>nulEcho. AMP was Re-installedEcho.Echo.REM Install WebSenseEcho. Starting WebSene client InstallC:\Windows\TEMP\Workstation_Setup\WebsenseEndpoint_64bit.exe /v"/quiet /norestart WSCONTEXT=OUR NUMBER"ping -n 15 127.0.0.1>nulEcho. WebSense was InstalledEcho.Echo.REM Lync 2013 InstallEcho. Starting Lync 2013 InstallC:\Windows\TEMP\Workstation_Setup\Lync-2013\setup.exe /adminfile "C:\Windows\TEMP\Workstation_Setup\Lync-2013\Lync_2013_x86.MSP" /config "C:\Windows\TEMP\Workstation_Setup\Lync-2013\lync.ww\config.xml"ping -n 15 127.0.0.1>nulEcho. Lync 2013 was InstalledEcho.Echo.REM INSTALL WAVE (Require Reboot)Echo. Starting WAVE Security Center InstallC:\Windows\TEMP\Workstation_Setup\WAVE-2-7\installer.exe -silent -installping -n 30 127.0.0.1>nulEcho. WAVE was InstalledEcho.Echo.REM Install TDMRemoteConfigEcho. Starting TDMRemoteConfig InstallC:\Windows\System32\msiexec.exe /i C:\Windows\TEMP\Workstation_Setup\TDMremoteConfig64.msi /QB /NORESTARTping -n 30 127.0.0.1>nulEcho. TDM Recmote Config was InstalledEcho.Echo.REM Install Cisco VPN and Copy ProfileEcho. Starting Cisco VPN InstallC:\Windows\System32\msiexec.exe /I C:\Windows\TEMP\Workstation_Setup\Cisco-VPN\vpnclient_setup.MSI /QB /norestartping -n 15 127.0.0.1>nulEcho. Cisco VPN was installed and Profile importedEcho.ECho.REM Install Single Sign On and copy Logo to folder ( Requires Reboot)Echo. Starting Single Sing On InstallC:\Windows\System32\msiexec.exe /I C:\TEMP\SSO\OneSignAgentx64.msi IPTXPRIMSERVER="https://OUR-SERVER.com/sso/servlet/messagerouter" AGENTTYPE="1" /qn /NORESTARTping -n 15 127.0.0.1>nulReg Add HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node\SSOProvider\CoBranding /v LogoImage /t REG_SZ /d C:\ProgramData\Logo\Logo.BMPping -n 15 127.0.0.1>nulXCOPY C:\Windows\TEMP\Workstation_Setup\Logo.BMP C:\ProgramData\Logo\ /Q /YSSO was installed, Logo Copied and registry modifiedEcho.Echo.REM ***************************************REM ***************************************REM ******* C L E A N U PREM ***************************************REM ***************************************REM Delete the downloaded applicationsDelRD C:\Windows\TEMP\Workstation_Setup /s /qshutdown /r /f /t 30 Link to comment Share on other sites More sharing options...
allen2 Posted June 12, 2013 Share Posted June 12, 2013 (edited) There are lot of ways of doing this kind of install but unless, you want/need the tech to stay behind the computer when the install is processing, you could avoid the login thing using autologin feature with local admin account. Then i think the easiest way would to add a run item (yes run not runonce) in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" and set it to launch the local batch.The local batch would check (using "if exist") and set flag (using files) for each app install so resuming would work and you could insert reboot in the batch. The last action of the batch would be to remove itself from the registry run key and remove autologin(if used). Edited June 12, 2013 by allen2 Link to comment Share on other sites More sharing options...
MRLunchBox Posted June 13, 2013 Author Share Posted June 13, 2013 Yes, I eventually found some thread where the suggestion was made to also use "Run" key. I can do this, howver, it will take me time to plan it outIn the mean time I found that I can use the following which I can try first.From what I've read executing the EXEs or MSIs with the start /wait comman will force the process to complelty finish before moving to the next step.Any optionns on how true that is?START /W C:\Windows\System32\msiexec.exe /i C:\Windows\TEMP\Workstation_Setup\TDMremoteConfig64.msi /QB /NORESTART ping -n 30 127.0.0.1>nul START /W ETC Link to comment Share on other sites More sharing options...
allen2 Posted June 14, 2013 Share Posted June 14, 2013 Indeed start /wait will usually (in almost all cases) wait until the process launched exit to go to next step but that doesn't mean that the application will be properly installed.When deploying applications, it might be usefull in some case to clone the install instead of running the installer (in this case installrite might be very handy). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now