Solved

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

Posted on 2006-07-11
2
231 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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