Solved

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

Posted on 2006-07-11
2
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C#: need to import an entire CSV file 4 60
wordpress limitations 4 136
Example of WebAPI 7 35
Explain Unit of Work pattern 2 76
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…

733 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