You need to set up a shared directory on a server such as \\packageserver\software deployment audit$. For each package, create a suitable folder. This is where the custom actions will dump blank files during the un/install. (Make sure you set suitable security on this share)
At the start of the package install it creates a
.SIN file. The end of the install creates a FIN file. Begining of an uninstall a SUN file and the end of the uninstall a FUN file. This file allows you to get a date/time stamp of the PCs package operation.
A program will be required to collect the details from this files (and remove) into an audit database, which would need to be run regularly. I've a bare bones program that does this for me but have near enough tidied this up to a effective gui to manage all packages audits. I will make this available at the end of next week (17th April 04). www.thorny.co.uk/software.htm
For your package:
Create four custom actions called AuditFinishInstall, AuditFinishUninstall, AuditStartInstall and AuditStartUninstall as VBScript code stored directly in the custom action.
Use the Custom Action Wizard for each to be as follows:
The code for each one needs to be as follows:
Set WshNetwork=CreateObject("Wscript.Network")
PcName="\\\Software Deployment Audit$\\" + WshNetwork.computername + "."
Set fso=CreateObject("Scripting.FileSystemObject")
Err.Clear
On Error Resume Next
Set okFile = fso.CreateTextFile(PcName, False)
make this the same folder name as the package is installed in eg: "Registry & File Fixes"
for each VB Script this needs to be amended as follows:
AuditFinishUninstall = ".FUN", AuditFinishInstall = ".FIN", AuditStartUninstall = ".SUN" and AuditStartInstall = ".SIN"
For AuditFinishInstall, AuditStartInstall and AuditStartUninstall set the following:
Return Processing: Synchronous (Check exit code)
In-Script Execution: Immediate Execution
For AuditFinishUninstall set the following:
Return Processing: Asynchronous (Waits for exit code)
In-Script Execution: Commit Execution
Also make the following changes in the sequence:
AuditFinishInstall: Sequence Number = Immediately after "InstallFinalise". Condition = Not Installed
AuditFinishUninstall: Sequence Number = Immediately before "InstallFinalise". Condition = REMOVE="ALL"
AuditStartInstall: Sequence Number = Immediately action in list. Condition = Not Installed
AuditStartUninstall: Sequence Number = Immediately after "InstallInitialize". Condition to be REMOVE="ALL" - otherwise if uninstalled by a direct call to the msi and not add/remove programs, the script will not run.
The above will need tweaking per package.
For example to accomodate any ForceReboot or ScheduleReboots you may need to use the AFTERREBOOT condition on the two finishing custom actions. One I have needed to do is set the AuditFinishInstall to have a condition of only "Not REMOVE="ALL".
Do let me know of any issues or improvements that can be made to this.
So far this has been doing the job I require, espcially doing an assigned installation during bootup.