Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

14 Experts available now in Live!

Get 1:1 Help Now