Solved

How can I verify the completion of an .msi installation?

Posted on 2006-07-11
2
229 Views
Last Modified: 2013-12-03
Hi experts.

I am developing an html application that will be used to install a number of different programs.  On a page will be a list of programs that will need to be installed.  I have already used a jscript that checks for specific registry entries, determining if any of the programs have already been installed.  If a program has been installed, a check mark image is made visible next to the name of the program.

If a program has not been installed, the user will see an install button.  Clicking on that will then run the normal installer (usually an .msi).  After the installer completes successfully, I would like to put a check mark next to the name of the program.  How can I verify within the hta file that the external installer has completed?  Is there a script I can run that will wait for a process to complete? I would like to stick with jscript, but any solution that accomplishes this will do.

Thanks!!!
0
Comment
Question by:pwi11
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17083907
Check out http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/shop0805.mspx#EOE ("Using Win32_ProcessStartTrace to Handle Process Events") and in particular the paragraph

Listing 3: Asynchronously monitor specific processes with Win32_ProcessStartTrace

On Error Resume Next

strComputer = "."
arrTargetProcs = Array("calc.exe", "notepad.exe", "freecell.exe")

Set SINK = WScript.CreateObject("WbemScripting.SWbemSink","SINK_")

Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
objWMIService.ExecNotificationQueryAsync SINK, _
 "SELECT * FROM Win32_ProcessStartTrace"

Wscript.Echo "Waiting for target processes ..."

Do
   WScript.Sleep 10000
Loop

'******************************************************************************

Sub SINK_OnObjectReady(objLatestEvent, objAsyncContext)

For Each strTargetProc In arrTargetProcs
  If LCase(objLatestEvent.ProcessName) = LCase(strTargetProc) Then
    Wscript.Echo VbCrLf & "Process Name: " & objLatestEvent.ProcessName
    Wscript.Echo "  Process ID: " & objLatestEvent.ProcessID
    Wscript.Echo "  Time: " & Now
  End If
Next

End Sub


seems to do what you want.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now