Jump to content

post-build app install script question


Recommended Posts

I am working on a script that will install my main applications once the OS is installed, and one of the apps I want to install has several patches that need to be installed afterwards. Does anyone know if it's possible to have a batch file that will call the install of an app and wait for it to finish before continuing on to install the updates? Or is that something I will have to look at WSH or something to be possible?

Hopefully, this isn't off topic...thanks all!

Link to comment
Share on other sites


in a batch file, if you use start /wait, the batch will wait before proceeding.

In a RunOnceEX, it should wait on it's own

there is a program in the download section of the unattend site, that is called sleep, you could use that if you program does some wierd things.

Link to comment
Share on other sites

I've just tested both of these methods and the problem is still there. Is that something that they need to fix on their end? It looks like the setup.exe file for FileMakerPro7 just calls an MSI file, which could be why the scripts think that the process has finished, when it has actually just called another process. The problem is that the setup.exe file has a setup.ini file which is where the licensing info and silent install info is, so I don't think I can just install it off of the .MSI file.

Is there any place that focuses on dealing with these sort of problem installers? I'm thinking that I might need to add some code to the script to keep looking for the existence of the installer process and then proceed once it's no longer there, but that would far exceed my current scripting knowledge. I look forward to that challenge, but I would also be interested if anyone has any other ideas that are more elegant.

Thanks everyone!

Link to comment
Share on other sites

I have decided to start looking into a script that will start monitoring the processes and wait for the one that is spawned by the filemaker installer to finish. I am currently looking into just looking for the process name of the executable, iassist.exe in this case, and then waiting for it to no longer be there before moving to the next part of the script.

Does anyone have any sample code that does something similar to this? I am trying to figure out the best way for it to detect the process, and while I am new to all of this, I am starting to look into WMI for this functionality.

Any suggestions as to which way to start would be greatly appreciated...as you can see I've already started, but anyone with a better understanding of WMI or VBScript that can point me in a useful direction would be great, as right now I am in a trial and error stage that could take a long time to get out of.

Link to comment
Share on other sites

  • 3 years later...
I have used one in my ImageX HTA gui here is a sample code with some comments.

[code]Sub ProcessWait

'Define the objects
Set objShell = CreateObject("WScript.Shell")
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")

'Lets run our setup here, in hidden mode
ObjShell.Run "cmd /c setup.exe",0

'A small sleep is required here, because the process doesn't exist if we go too fast ahead.
Wscript.Sleep 1000

'Here comes the WMI query
Dim objWMIService : Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

'In the end of the line comes the process name
Dim colItems : Set colItems = objWMIService.ExecQuery("Select * From Win32_Process Where Name = 'setup.exe'")
Dim intCount : intCount = colItems.Count

'Loop until the setup.exe process count is bigger than 0
Do While intCount > 0
Set colItems = objWMIService.ExecQuery("Select * From Win32_Process Where Name = 'setup.exe'")
intCount = colItems.Count
Wscript.Sleep 3000
Loop
Set colItems = Nothing
Set intCount = Nothing
Set objWMIService = Nothing
End Sub[/code]

I didn't test the sample code here, but you can get it to work with a little modification. Edited by geezery
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...