Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Build Report


3 replies to this topic

cmyanko

cmyanko
  • Members
  • 13 posts

Posted 09 March 2001 - 15:24

Ok, I need to generate a build report. Something more like the old one in IS5.5. I have something work through the automation interface like this

Set pProj = CreateObject("ISWiAutomation.ISWiProject")
sProj = "F:\MSI_Projects\Dieworks32.ism"
pProj.OpenProject sProj

Then I loop through the features and components and dump info to a comma delimitted file.

Now I want to do this at runtime through the Session object. Do I then do the same things throught he Installer Object?

The last part of this is detecting command line arguments. How do I detect them?


cmyanko

cmyanko
  • Members
  • 13 posts

Posted 26 March 2001 - 15:26

Ok gang, little help here. I'm getting confused with the object models. What I did through the automation interface woks fine but I can't get my head around doing it at runtime. The session object does expose a list of components but I'm not sure I can drill down any further. I want to run this as an IMMEDIATE CA and get the names of the files, size, date/time and version info.

SteveP

SteveP
  • Members
  • 126 posts

Posted 30 March 2001 - 01:59

Is there information that you need for your report that does not exist in the log file for the installation?

At any rate, I am making the assumption that you want to know the final state, not the requested state, of your components and features.  I am doing something similar, for a different purpose.  I created a VB applet, but the same kind of thing can be done in script.

Here is a bit of my code:

...

Public oAppIDList As Collection
...

Dim oSession As WindowsInstaller.Session
Dim oInstaller As WindowsInstaller.Installer
Dim oDatabase As WindowsInstaller.Database

'   Initialize oAppIDList collection

Set oAppIDList = New Collection

'   Initialize WindowsInstaller.Session

Set oInstaller = CreateObject("WindowsInstaller.Installer")
Set oSession = oInstaller.OpenProduct("<Product ID>")

Set oView = oSession.Database.OpenView("Select AppId from AppId")

oView.Execute

Set oRecord = oView.Fetch
Do Until oRecord Is Nothing
   oAppIDList.Add oRecord.StringData(1)
   Set oRecord = oView.Fetch
Loop

oView.Close

This gives me a listing of the AppID's that were installed by the product.  I sequence this just before InstallFinalize so that the SessionObject returned by opening the product is the current session.  At this point in the code, I have the Session object, the Installer object, and the Database object available for read access.  I suspect something similar would work for your needs.  Because the sequence is so late in the game, I can use files that I install with the package, and I can also rely on the fact that the objects are already registered.

As to passing command line arguments, that is not a problem if you are using VBScript.  Include your script as a VBS file in your install.  Include the full path to WScript.exe on the target machine as a record in the Property Table.  Use a CA, base type 50, to run your script.

In the Source column of the CA table, list the property for the path to the scripting host.  In the Target column, list the complete command line, just as though you were executing from a Run command.