Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

ExitCode Property?

Ok, been beating my head against the wall too long at this. So, heres the story...

I created a generic MST and have it successfully creating the history of installations in the registry. The last thing I am trying to do is get the exitcode. What property or method can I use to determine what the exitcode of the install is?

Example of what I have:

HKLM\SOFTWARE\Contoso\InstallHistory\[ProductName] [ProductVersion] - [Date] - [Time]

name\values in the key are like:
InstalledFrom = [OriginalDatabase]
Transforms = [TRANSFORMS]

I also need something like this:
ErrorCode = [ErrorCode]...or whatever this property may be.

So in the end it would look like this:
ErrorCode = 0
or ErrorCode = 1614
or ErrorCode = 1624

With the error code I could even add the error message to this reg key. I've looked all over the forums and the net. Am I missing something? It is probably so simple and staring me in the face. :confused:

I've looked at, session.installer, installer... The only thing that comes to mind now is setting the MsiLogging property and parsing the output. There must be a better way!
And help greatly appreciated!
Labels (1)
0 Kudos
(1) Reply
Level 3

Ok, I guess its not possible to get the exitcode of the msiexec that originally executed the MSI because the windows installer service hasn't closed it yet. Right? So, I...

Capture the PID of the original msiexec in a CA, then I run an asynchronous EXE that I created which uses kernel32's OpenProcess and GetExitCodeProcess functions. I loop until OpenProcess shows the PID is no longer pending and get the exitcode using the GetExitCodeProcess function. Now I can update my audit key with the exitcode of the actual install.

This should not that difficult to do but it appears that there is no other way. That I can think of atleast...
0 Kudos