/build/static/layout/Breadcrumb_cap_w.png

How to delay the next thing during scripted installs

I'm putting together my first scripted installation and some of the software isn't installing. I think it's either there is already an installation running and it tries to kick off the next thing and fails, or the install could be running and the next part of the script has a reboot. How can I set this to not run the next item in the scripted install until the previous has finished?

0 Comments   [ + ] Show comments

Answers (17)

Posted by: jmcelvoy 13 years ago
Second Degree Blue Belt
0
Forgot to ask. If neither of these are the reason my software isn't running, is there a way to dump a log file of the scripted install?
Posted by: dchristian 13 years ago
Red Belt
0
Please ignore wrong forum

:)
Posted by: jmcelvoy 13 years ago
Second Degree Blue Belt
0
This is all being done through the scripted install/deployment on the K2000. I have a Base Deployment setup and under the Run Post Installation tasks, I have several different apps that are supposed to run. I don't see any of these run during the deployment. Some of these are batch files that make a registry edit. Others are software installs. If I only have 1 of them in the Run Post Installation, that 1 runs just fine. It's when I have several in there. How can I put in a pre-install / post install message? Not sure what you mean by "make sure the OS you are trying to deploy to is highlighted under the software entry page tab"
Posted by: cblake 13 years ago
Red Belt
0
jmcelvoy - the response above was for Managed installs on the K1. We get those by accident in this forum sometimes :)
Can you give us an example of what your post install looks like? Maybe a screen shot? Often it's an ordering problem, missing reboots in the correct places, or syntax of specific tasks. The scripted install itself doesn't have a log, as it's actually a collection of a bunch of smaller jobs. What you could do is add a line to your bat files to echo it's begin and completion to a local text file. That might give you some idea where something is failing as well.
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
there are several common ways to delay the start of tasks. it could be something as simple as needing to place a start /wait in your call for the installation which will allow the called program to run before your script will proceed to it's next line. sometimes you need to inject a "pause" into your script, like is the case with our Trend Micro Client, where the start /wait doesn't do the trick as there seems to be a ton of "post installation" steps that Trend goes through before it's truly installed. I accomplish this by pinging the local host for a specific amount of time before the script ends or moves to the next portion whatever your situation may be.

I have noticed a common lack of specificity to the questions on this board and think it would do everyone well to include as much information as possible in their OP's. Show us your script code, or like Christopher suggested include screen shots. I find I get much quicker answers to my questions when I provide as much information as possible. What program are you installing. Is it an .msi based install, installshield, other?

As to the log files:

MSI Command Line Switches: http://technet.microsoft.com/en-us/library/cc759262(WS.10).aspx
InstallShield Command Line Switches: http://kb.flexerasoftware.com/doc/Helpnet/installshield12helplib/IHelpSetup_EXECmdLine.htm

Log files are your best friends when deploying applications and other things. Lesson that it took me a long time to learn.


Also, go check out the Scripting Forum and you'll pick up a lot of cool tricks that can help with installation and automation.
Posted by: rmeyer 13 years ago
Second Degree Blue Belt
0
Hi

I think I know what you mean, if you are installing the agent you like it to fininsh all installations before it will go to next process, I created this VBScript to make sure it waits:

Create a installation task after the agent installation with it attached and this command line: %windir%\system32\cmd.exe /c cscript.exe WaitForInstallation.vbs //NOLOGO

I made it to run several times because we have some dependencies that that I wanna make sure exist on the PC before other software is installed.

I hope it is usefull :)

---------------------------------------
' ********************************************************************************************
' * Script to wait untill the Inventort and software installation is done before continueing *
' * By René Meyer - 2010 *
' * Commandline: %windir%\system32\cmd.exe /c cscript.exe WaitForInstallation.vbs //NOLOGO *
' ********************************************************************************************

Dim oShell
Set oShell = CreateObject("Wscript.Shell")

wscript.echo "Waiting for KACE to finish the inventory..."
wscript.sleep(120000)

wscript.echo "Waiting for KACE to start the software installation..."
wscript.sleep(60000)
dim Scripttime, i, RoundTime, RoundCount
Scripttime = 180
RoundCount = 0

'***********************************************************************************************
'* Change the 2 values below to config how long/how meny times it should run before continuing *
'***********************************************************************************************
MaxRounds = 10
MinRoundTime = 90
'****************************************************
'* It will not run more than the "MaxRounds" *
'* If it takes less than the "MinRoundTime" it will *
'* consider the round done and go to next round. *
'* If you set MinRoundTime too low the script will *
'* never finish :) *
'****************************************************

' Running the KBScriptRunner.exe untill it takes less than MinRoundTime for it to finish or MaxRounds in total
for i = 1 to 10
RoundCount = RoundCount + 1
RoundTime = 0
oShell.Run "cmd.exe /C " & chr(34) & "C:\Program Files (x86)\KACE\KBOX\KBScriptRunner.exe" & chr(34) & "", 1, False
oShell.Run "cmd.exe /C " & chr(34) & "C:\Program Files\KACE\KBOX\KBScriptRunner.exe" & chr(34) & "", 1, False
RoundTime = RoundTime + 20
Scripttime = Scripttime + 20
wscript.sleep(20000)
WaitForProcessToClose "KBOXClient.exe"
' wscript.echo "RoundTime = " & RoundTime
' wscript.echo "MinRoundTime = " & MinRoundTime
' wscript.echo "Total Rounds = " & RoundCount
' wscript.echo "Max Rounds = " & MaxRounds
if RoundTime < MinRoundTime Then i = 10
if RoundCount >= MaxRounds Then i = 10
wscript.sleep(5000)
next

' ******************************************************
' * Waiting for the KBOXClient.exe process to finish...*
' ******************************************************
Sub WaitForProcessToClose(processname)
Dim strComputer
Dim objProcess
Dim colProcess
Dim objWMIService
Dim Count

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Dim l_StartTime
l_StartTime = Now

Do While True
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = '" & processname & "'")

If colProcess.Count = 0 Then
Exit Sub
End If
If Abs(DateDiff("s", l_StartTime, Now)) > 5 Then

' wscript.echo "Kace agent is installing software, Please wait... (Been running for " & left(Scripttime/60,4) & " min...)"
wscript.sleep(10000)
Scripttime = Scripttime + 10
RoundTime = RoundTime + 10
StopService "ntrtscan"
End If
Loop



End Sub

' ***************************************************************************
' * Stopping Trend Micro Real time scanner to speed up installation process *
' ***************************************************************************
Sub StopService(strService)

Set objShell = CreateObject("WScript.Shell")

On Error Resume Next

Set objWMIService = GetObject("winmgmts:\\" & strServer)
If Err.Number <> 0 Then
Err.Clear
Else
Set objService = objWMIService.Get("Win32_Service.Name='" & strService & "'")
If Err.Number Then
WScript.Echo strServer & " Cannot stop Real Time Scanner, Service not found"

Err.Clear
Else
'WScript.Echo strServer & " SUCCESS: " & strService & " [Service found]"

strComputer="."

Set objService = GetObject("WinNT://" & strComputer & "/" &strService & ",service")
If objService.Status=2 Then
'if disabled it set the service to automatic start
If objService.startType=4 Then
objService.startType=1
WScript.Echo "Service: " & objService.name & " was disabled!"
objService.SetInfo
WScript.Sleep 2000
End if
'if set to manuel start it is changed to automatic start
If objService.startType=3 Then
objService.startType=1
WScript.Echo "Starting " & objService.name & " was set to manual start!"
objService.SetInfo
WScript.Sleep 2000
End if

'objService.Stop
End If
if objService.Status<>1 Then
WScript.Echo "Stopping " & objService.name
objService.Stop
End If
End If

End If
End Sub
----------------------------------------------------
Posted by: jmcelvoy 13 years ago
Second Degree Blue Belt
0
I'm not sure how to post a screenshot on here, so I'll just write everything out. My Pre-Installation consist of:
Get Pre-Existing Computer Name - Application(VBS Script)
Create Single Partition - DiskPart Scrip
Format C: as NTFS - Batch Script
Install Windows 7 MBR - Batch Script
Then my Post-Installation tasks consist of:
Disable UAC - Batch Script
Disable USB Ports - Application(regedit)
Apply Pre-Existing Computer Name - Application(Batch file)
Microsoft .Net 3.5 SP1 - Application
Windows 7 Licensing - Batch Script
KBOX Agent - K1000 Agent
Join Domain - Join Domain
Reboot - Batch Script
Adobe Reader X - Application
Office 2010 - Application
Office 2010 Activation - Batch Script

On Post-Installation, the Disable UAC, Disable USB, Apply Pre-Existing Computer Name, Windows 7 Licensing, KBOX Agent, Join Domain, Reboot, Office 2010, and Office 2010 Activation all run. The Microsoft .Net 3.5 SP1 and Adobe Reader X DO NOT get installed for some reason.
For the .Net 3.5 SP1 install, I have uploaded the zip file and my command line reads: dotnetfx35.exe /q /norestart
For the Adobe Reader X install, I have uploaded the zip file and my command line reads: AcroRead.msi /quiet /norestart
If I wanted to put the Start /wait in, where would I place that? In the Command Line before the dotnetfx.exe /q /norestart Or after? Also where would I put the ping loopback?
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
ah, you ran into the same problem I did. Once Win7 reboots it does not continue the post-installation procedure, as opposed to the behavior in XP. It was explained to me that this was an issue with Win7 and not the KBox, but I disagree as the coding can be put in place to write the proper registry entries to kick back off the post-installs.

Move your join domain and reboot to the last steps in your setup.

I have a script I use that joins the domain, reboots and starts off SP1 installation as SP1 installation will end the post-installation procedure as well.


ORIGINAL: jmcelvoy

I'm not sure how to post a screenshot on here, so I'll just write everything out. My Pre-Installation consist of:
Get Pre-Existing Computer Name - Application(VBS Script)
Create Single Partition - DiskPart Scrip
Format C: as NTFS - Batch Script
Install Windows 7 MBR - Batch Script
Then my Post-Installation tasks consist of:
Disable UAC - Batch Script
Disable USB Ports - Application(regedit)
Apply Pre-Existing Computer Name - Application(Batch file)
Microsoft .Net 3.5 SP1 - Application
Windows 7 Licensing - Batch Script
KBOX Agent - K1000 Agent
Join Domain - Join Domain
Reboot - Batch Script
Adobe Reader X - Application
Office 2010 - Application
Office 2010 Activation - Batch Script

On Post-Installation, the Disable UAC, Disable USB, Apply Pre-Existing Computer Name, Windows 7 Licensing, KBOX Agent, Join Domain, Reboot, Office 2010, and Office 2010 Activation all run. The Microsoft .Net 3.5 SP1 and Adobe Reader X DO NOT get installed for some reason.
For the .Net 3.5 SP1 install, I have uploaded the zip file and my command line reads: dotnetfx35.exe /q /norestart
For the Adobe Reader X install, I have uploaded the zip file and my command line reads: AcroRead.msi /quiet /norestart
If I wanted to put the Start /wait in, where would I place that? In the Command Line before the dotnetfx.exe /q /norestart Or after? Also where would I put the ping loopback?
Posted by: cblake 13 years ago
Red Belt
0
ORIGINAL: dyehardfan

ah, you ran into the same problem I did. Once Win7 reboots it does not continue the post-installation procedure, as opposed to the behavior in XP. It was explained to me that this was an issue with Win7 and not the KBox, but I disagree as the coding can be put in place to write the proper registry entries to kick back off the post-installs.

Good info- thanks dyehardfan. I haven't seen this behavior personally, but it might be useful to the forum to share the registry solution you have?
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
I am not a coding expert, so I do not know how you'd write the code exactly, I would imagine it would take an evaluation of all of the post-install tasks and see which ones actually require a reboot and then add something similar to my excerpt below which I use to install SP1 after the Name and Join Domain process as discussed in another thread.

:Write Registry Key to Begin Post Scripted Install Scripted Installs
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"postScripted.vbs\"" /f

The next time it new a reboot was in order it would do something similar. It would basically take a script that could write secondary scripts on the fly. MOST of the time you do not run into situations that require a reboot in the middle of the Scripted Install, but there are occasions. When those arrive they go in my postScripted.vbs.

I have not done enough research to find where the differences lie between XP and 7 and how they handle the post installation task information provided by the K2000, but maybe I'll have a better solution for you by the time the Konference rolls around again, ha.
Posted by: rmeyer 13 years ago
Second Degree Blue Belt
0
I haven't started looking into Win7 OS installation other than just installing the OS yet :P

But I would add a registry entry like dyehardfan writes in the RunOnce before teh reboot, if you have all the packages as a seperate package in the Kbox2000, all the script I does is to install all the software that is missing via the KBox1000 :)
Posted by: cblake 13 years ago
Red Belt
0
rmeyer - If your K1 is handling all of your tasks then it's a moot point. Your postinstall tasks aren't failing, because they are being ran by the agent.
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
I think that is the way I am ultimately planning on handling application installation. I am having to work my way through a big roll-out right now though and don't have the time to hardly even login to my k1 right now other than to check out tickets. I figure it will be relatively easy to move my post-install jobs over to managed installations when I get some free time.


ORIGINAL: cblake

rmeyer - If your K1 is handling all of your tasks then it's a moot point. Your postinstall tasks aren't failing, because they are being ran by the agent.

Posted by: cblake 13 years ago
Red Belt
0
K1 is my personal preference when the option exists. Since it can handle new and existing machines as equals, why not? One place to maintain things, and one set of challenges to work against. I often use what we call "breadcrumbs" to make the machine part of a label to further automate. Here's a KKE we did on this concept:
K1000 KKE's: https://support.software.dell.com/k1000-systems-management-appliance/kb?k=KKE
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
Wow, if it's that simple why hasn't it been integrated into the Appliances?

ORIGINAL: cblake

K1 is my personal preference when the option exists. Since it can handle new and existing machines as equals, why not? One place to maintain things, and one set of challenges to work against. I often use what we call "breadcrumbs" to make the machine part of a label to further automate. Here's a KKE we did on this concept:
K1000/K2000 Koncepts: Using Custom Inventory as Breadcrumbs to Integrate Imaged Machines with K1000 Labeling
October 19, 2010, 10:58 am San Francisco Time
53 mins
Presenter: Chris Blake & Kent Feid
Playback Link: https://kace.webex.com/kace/lsr.php?AT=pb&SP=TC&rID=60867212&act=pb&rKey=76b3e8117f39b9a1
Posted by: CordlezToaster 13 years ago
Purple Belt
0
we usually have a bat file with

start /wait Name_of_application_install.exe

This has helped us we have the k2000 install 30+ applications.
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
yeah start /wait generally works, especially for Installshield and .msi installers. I have run into situations where start /wait will actually open a second command window and run the program (depending on how the installer was written). This second window never closes after the install until you manuall exit it. In these situations I use the Call command instead of start /wait. These are the ones I generally have to build a "pause timer" into.


ORIGINAL: CordlezToaster

we usually have a bat file with

start /wait Name_of_application_install.exe

This has helped us we have the k2000 install 30+ applications.

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ