Deployment Solution

 View Only
Expand all | Collapse all

Scripted OS - OS + Applications: How do I join now to be one process?

  • 1.  Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 01:23 AM
    Hi All,

    I currently have my scripted OS deploying successfully. It lays down the base windows xp build and applies the changes necessary to our SOE. Within the same job I have included after the scripted OS to start installing applications. This is done by executing exe/msi files silently. The issue seems to be that the application scripts seem to run before the OS has actually finished installing and therefore when it does actually boot into windows xp it doesn't continue to install the applications.

    I've test each on their own and both work successfully however when put together I seem to have issues? Is anybody able to help me with this.

    To get a better idea this is how my job would look

    Distribute Disk Image .\Images\FAT32.IMG
    Run Script Install Scripted OS - Windows XP SP3
    Run Script Install AntiVirus
    Run Script Install Adobe Reader
    Run Script Install Office 2007

    etc etc.

    Any help would be appreciated.

    Regards

    Byron


  • 2.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 04:27 AM
    Hi Byron,

    First of all make sure that the script that runs the scripted OS installation ends up installing the Aclient.

    Set the remaining Run scripts

    Run Script Install AntiVirus
    Run Script Install Adobe Reader
    Run Script Install Office 2007

    etc etc.

    To run in Production - Client installed OS mode.

    Hope this helps.

    /mlogan


  • 3.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 08:49 AM
    byronjt,

    I have had this problem in the past.  One simple solution is to add a task between the scripted OS install and the application install (running client side in the production OS) and waits 3 to 5 minutes.  While not the perfect solution it will give the OS a chance to finish installing and for everything to settle before starting application installs. 

    If your scripted OS install causes the machine to reboot in between the first time the production agent connects and when it's "ready", then just add a dummy run script task that runs client side, then have a server side script that does the 3-5 wait.

    By the way, the DS for Dell scripted OS install process already have these timed wait tasks built in.

    Hope that helps,

    ~eorme


  • 4.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 08:40 PM
    Hi All thanks for the replies, much appreciated.

    Just a query in regards to both of your answers. By using the term production - client installed OS mode is that the same as Script Run Location within the script job.

    I have the script run location set to run on the client computer. and script options as hidden but is what you mentioned an option elsewhere to this?

    Also eorme you've mentioned the dell scripted os process before where do I find these examples? are they on a dell cd or on the altiris server somewhere?

    Any help appreciated as always.


  • 5.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 08:45 PM
    Also eorme are you able to copy and paste an example of the wait script that you would recommend I use?

    Much appreciated.


  • 6.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 08:57 PM
    Ok I see the production - Client Install OS which I have switched on for all my application installs so I may have to implement the wait command like eorme mentioned.


  • 7.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 16, 2009 10:05 PM
    I tried script again with a fresh build

    after the scripted os was completed it said sending a wake on lan signal and I thought it might work when the OS came up. however eventually the first software install errored with an Error 1 during script execution. I've read a few places that say  this is a problem with my script however I've got an exact copy of all application installs in another job and if i drop this down to the job after the OS is install then it happily goes away installing everything?

    Any ideas? The wait script is possibly the best option to try


  • 8.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 17, 2009 07:21 AM

    You mention that you got an error 1. However did the software install? Remember that it is not all software installers that return 0 as compleeted succesfully. Deployment Solution expects a returncode of 0 for it to show that the installation succeeded.

    Eg. installing an MSI file that requires a reboot that you say NO to will give you error 3010. But actually the software installed succesfully.

    Also if your software installation reboots the client, and not DS, you could end up with error 1 as DS thinks you installation failed.

    Hope this helps you a little.

    /mlogan



  • 9.  RE: Scripted OS - OS + Applications: How do I join now to be one process?
    Best Answer

    Posted Jun 17, 2009 10:21 AM
    Here's a simple example that will wait for one minute:


    REM Wait for OS install to complete
    @echo off

    ::pause for one minute to let the OS installation settle
    ping -n 60 127.0.0.1

    Exit /B 0


  • 10.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 17, 2009 10:31 AM

    Have you tried using shortcuts?  I call them forwarding scripts though, but basically what they do is its a blank script that on a success it tells another job to run.  So you put one that forwards to the job you have that you know is working.  Also what PXE are you using to distribute the image and install the OS?  If it is windows you might want to make sure you have a job that forces it to boot to windows XP instead of WinPE.  For example, but in a run script that runs calc (just for testing) and if calc runs correctly it is being run in xp instead of the PXE.  as for the error 1 if you are trying to do the installs from the network and the script is using a specific user on the domain to run the script you will have problems.  I haven't be able to do any installs on the network with a computer that is not on the domain by using a run script. 

    For my post scripted OS install installs i use the unattended.ini to install my needed programs.  I have them copied locally during the imaging process (i have the files in the image) and once the computer boots up and autologs in as the admin (i set it to auto log in 5 times, this helps for windows updates and some other stuff) and then it automatically runs the installs for the programs. 

    This is an example of what I use to install IE7 after i copy it to the c drive during the imaging process.
    [GUIRunOnce]
    Command0="c:\iesetup.msi"



  • 11.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 17, 2009 07:56 PM
    Hi Spazzzen do you have an example of a script you would use for this forwarding purpose?

    I'm currently eorme's script to wait and the funny thing is that it runs before windows XP has even reached the desktop. It starts running in the final stages of the installation when there is six minutes left or more so I've currently set my script to wait six minutes before installing and hopefully this will help.

    I install the aclient by using the GUIRunOnce within the unattended install file so I'm wondering as soon as the unattended install runs this file it then obviously starts checking in to find out what the next job is? Should I put this in a different location. I did try putting it in the cmdlines.txt but it didn't seem to run however all my other reg hacks etc run from this file.

    Ok the install has finished and its  booted into windows and has started installing all my software. So it looks like the wait script has helped. Thanks heaps. Spazzzen i'm still interested in seeing the way you can achieve this also?

    Ok the final thing I need to do then is a token replace command I believe this is what you use in order to name the computer what it is named in the altiris database is that correct?

    Could someone please explain to me how that works and then if we could look at incorporating that into my script.

    Thanks again everyone for your help

    Byron


  • 12.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 18, 2009 10:23 AM
    Tokens are really easy to use.  Just put them in your run script task and when the task is run, the'll automatically be replaced with a value from the database.  Here's some of the tokens:

    %ID% - Machine ID assigned by DS for this computer
    %NAME% - Complete Computer Name
    %NICyMACADDR% - Mac Address of NIC (replace y with a number from 1-8)
    %SERIALNUM% - Serial number from BIOS
    %NODENAME% - First 8 characters of the node name

    for example:

    @echo off
    echo This computer is %NAME% with a serial number of %SERIALNUM%
    pause


    As for integrating tokens into your scripts, what would you like to do?  Installing software doesn't require tokens.  By the way there is also something called "custom tokens" that allow you to put SQL statements directly into the token itself, thus being able to pull out pretty much any information you need from the database, here's an example:

    %#*"select data from dbo.mytable where id='123'"%

    So if your table was set up with the key being the machine ID of the machine, you could do something like this:

    %#*"select data from dbo.mytable where id='%ID%'"%

    Good luck,



  • 13.  RE: Scripted OS - OS + Applications: How do I join now to be one process?

    Posted Jun 21, 2009 07:47 PM
    Hi Thankyou all,

    I now have a script os build working for one model of PC as they are the only drivers i've injected. I will now need to look at ensuring this process works across all computers that we have.

    Thankyou eorme for all your help I have now started using a basic token replace script to name the computer what its called in the DS and this is working successfully.