Hi there,

 

I am trying to create a script that installs 2 pieces of software.  One is the Microsoft Visual c++ 2005 Redistributable and the other is IBM System I Access for Windows V6R1M0.

At the moment I have them set up in 2 tasks, but it seems that The IBM System I task is kicking off before the C++ Redistributable has finished, thus failing.

I have attached a screenshot of the script. 

If the c++ redistributable is not installed, the script will install it, but the IBM System I installation will fail.  But if the c++ redistributable is already installed, it will skip task 1 and perform task 2 and install IBM System I.


So how can I make Task 2 wait for Task 1 to complete?  As you can see, the Task 2 is referencing an MI, so I do not want to edit the install.bat that I have already created with a pause at the start, unless it is absolutely necessary.


EDIT - Just wanted to let people know that I am fairly new to scripting, so please let me know if I am doing it completely wrong :)

Cheers,

Brendan

Answer Summary:
Hi All, Thank you all for your help. I ended up adding the installation of the Visual C++ redistributable as the first step in the IBM Install.bat file. :: :: Microsoft Visual C++ 2005 Redistributable Installation msiexec.exe /i 2005vcredist_x86\vcredist.msi /q :: :: IBM System i Access for Windows V6R1M0 Installation start /wait AS400\cwbinstall.msi /qn REBOOT=ReallySuppress :: XCOPY "SSLKey" "C:\Program FIles\IBM\SSLKey" /I /Y /E :: regedit.exe /s as400keydatabaseXP.reg :: XCOPY "Session" "C:\Program Files\IBM\Client Access\Emulator\Private" /I /Y /E :: copy "AS400 Display Session.lnk" "C:\Documents and Settings\All Users\Desktop\" :: del "C:\Documents and Settings\All Users\Desktop\IBM System i Access for Windows.lnk" del "C:\Documents and Settings\All Users\Desktop\System i Navigator.lnk"
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

Hi All,

Thank you all for your help.  I ended up adding the installation of the Visual C++ redistributable as the first step in the IBM Install.bat file.

::
:: Microsoft Visual C++ 2005 Redistributable Installation
msiexec.exe /i 2005vcredist_x86\vcredist.msi /q
::
:: IBM System i Access for Windows V6R1M0 Installation
start /wait AS400\cwbinstall.msi /qn REBOOT=ReallySuppress
::
XCOPY "SSLKey" "C:\Program FIles\IBM\SSLKey" /I /Y /E
::
regedit.exe /s as400keydatabaseXP.reg
::
XCOPY "Session" "C:\Program Files\IBM\Client Access\Emulator\Private" /I /Y /E
::
copy "AS400 Display Session.lnk" "C:\Documents and Settings\All Users\Desktop\"
::
del "C:\Documents and Settings\All Users\Desktop\IBM System i Access for Windows.lnk"
del "C:\Documents and Settings\All Users\Desktop\System i Navigator.lnk"

Thanks again guys, what a wonderful community!

Answered 01/24/2013 by: bhallida
Senior White Belt

  • Cool glad that occurred to you, I mentioned that was your problem in the one reply but never thought to tell you to try thats
Please log in to comment
0

Since you are using a batch file you can put start \wait in front of the command to sequence them

for example

start /wait Wmic computersystem where name="%computername%" call unjoindomainorworkgroup

start /wait cscript.exe -b c:\windows\w2d\join_domain.vbs

 

Answered 01/23/2013 by: SMal.tmcc
Red Belt

  • Hi there, thank you for your response.

    I have altered the batch file that I have running in Task 2 (found in the managed installation), but it is still not waiting. When I run the Install.bat on my machine, or if the software in Task 1 is already installed, it works fine.

    Here are the contents of that batch file:

    start /wait AS400\cwbinstall.msi /qn REBOOT=ReallySuppress
    ::
    XCOPY "SSLKey" "C:\Program FIles\IBM\SSLKey" /I /Y /E
    ::
    regedit.exe /s as400keydatabaseXP.reg
    ::
    XCOPY "Session" "C:\Program Files\IBM\Client Access\Emulator\Private" /I /Y /E
    ::
    copy "AS400 Display Session.lnk" "C:\Documents and Settings\All Users\Desktop\"
    ::
    del "C:\Documents and Settings\All Users\Desktop\IBM System i Access for Windows.lnk"
    del "C:\Documents and Settings\All Users\Desktop\System i Navigator.lnk"

    Am I missing something?
    • I miss read the lines. that will only work if both calls are in the same batch file, let me reread.
    • you can always add a line like
      ping 127.0.0.1 -n 2 -w 1000 > NUL
      to your batch to cause a sudo sleep before starting the install
      or get download and add sleep.exe to your dependencies and put that in the batch prior to the install
      http://www.microsoft.com/en-us/download/details.aspx?id=17657
    • windows 7 also has a program called timeout. open cmd window and type timeout /? for details
  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
  • Can you split this into two different scripts and run one 5 minutes after the first ones schedule?
  • Not really, as the batch file is part of a managed install. I will try the ping timeout this morning and see how that fairs.
    • got that info from
      http://superuser.com/questions/48231/how-do-i-make-a-batch-file-wait-sleep-for-some-seconds
Please log in to comment
0

You could also Separate this out into 2 Managed Installs where the first install has a lower deploy order than the second install.

Answered 01/23/2013 by: darkhawktman
Green Belt

  • I tried this after you suggested, but it did not work. I left the first one at 10 and changed the IBM managed install as 11 and 20 and it still did not kick off. Anyone know where the logs are stored for this? I have the logs that I created in the script, but are there any other ones?
Please log in to comment
0

In task 1 when you launch the batch file during the remediation step, is the check box to wait for completion checked? 

Answered 01/24/2013 by: chucksteel
Red Belt

  • Hi Chuck,

    Yes it is. I have another script that is similar to this, and that check box is what fixed that one. But this one does not work. :S
Please log in to comment
0

Could create a smart label with machines that have C++ and not the IBM software then only have script 2 pointing to that label.

Answered 01/24/2013 by: dragon23
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share