views:

372

answers:

2

Making sense out of an .MSI verbose trace. I created the .MSI using VisualStudio 2008.

Here's the background on what I'm trying to do: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454

The goal is to run a program called XmlPreprocess.exe similar to this: xmlpreprocess.exe /x:"SettingsFileGenerator.xml" /i:"web.config" /e:QA /v

The /x: parm comes from one of my user interface forms, and the /e: value comes from a choice of four radio buttons.

I set property "InstallerClass" to False, and property "CustomActionData" to: /x:"[SETTINGSFILE]" /i:"[TARGETDIR]web.config" [CUSTOMSETTINGS] /e:[ENVIRONMENTBUTTON] and I'm leaving property "Arguments" empty.

Here's what the trace is telling me. It looks like my parms are going to the appropriate places (I selected "QA" from the Radio Button). The error is the same that I'm seeing on the GUI screen - that "A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." I'm not sure if the ErrorIcon information is just noise, or if it is relevant.

MSI (s) (A4:58) [10:46:09:130]: Executing op: CustomActionSchedule(Action=_78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2,ActionType=3090,Source=C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe,,CustomActionData=/x:"c:\Source\TFBIC.RCT.BizTalk\TFBIC.RCT.BizTalk.Deployment\EnvironmentSettings\SettingsFileGenerator.xml" /i:"C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\web.config"  /e:QA)
MSI (s) (A4:58) [10:46:09:728]: Note: 1: 1722 2: _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2 3: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe 4:  
MSI (s) (A4:58) [10:46:09:728]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (c) (E0:C8) [10:46:09:763]: Note: 1: 2262 2: Error 3: -2147287038 
DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog, 
**Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.**  Action _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2, location: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe, command:  
MSI (s) (A4:58) [10:46:11:630]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (s) (A4:58) [10:46:11:630]: Product: TFBIC.RCT.WCFWebServices -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.  Action _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2, location: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe, command:  

Action ended 10:46:11: InstallExecute. Return value 3.
MSI (s) (A4:58) [10:46:11:633]: User policy value 'DisableRollback' is 0
MSI (s) (A4:58) [10:46:11:633]: Machine policy value 'DisableRollback' is 0

NOTE: got the above trace by doing this:

msiexec /i "TFBIC.RCT.WCFWebServicesSetup.msi" /L*V "C:\logs\WebServiceInstall.log"

Update: Based on comments below - the XmlPreprocess.exe (my CustomAction) is returning a non-zero return code. So how can I debug that? I need to see the results that would normally be in the command window.

Update 01/07: Seems like this is impossible to debug without seeing the output of the program - that's what I really need. When the installer gives an error, I can see the files in that dir until I click the OK button and it deletes them all. I go to command prompt, type in xmlpreprocess.exe then copy/paste the exact same string from the log above "/x:"c:\Source\TFBIC.RCT.BizTalk\TFBIC.RCT.BizTalk.Deployment\EnvironmentSettings\SettingsFileGenerator.xml" /i:"C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\web.config" /e:QA" and it runs fine.

I see Ryan's point about a missing file, thanks for that. But there could be dozens of potential errors that should be clearly displayed in the output of the XmlPreprocess program. Surely there is someway to see the output?

The two potential missing files are: 1) the web.config itself (it's there) 2) the name of the file the user types in.

As far as I can tell, there is no way to validate that the user typed in a valid filename, and there is no "file picker" available in the dialog boxes of the install. Correct? or no?

So even if the user did type in bad filename, I need to give him a better message than "A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor."

Maybe I should write my own C# wrapper for XmlPreprocess and call it, then intercept the output and read it???

+1  A: 

Yes, the ErrorIcon is just noise and can be ignored. I'm in the process of removing this 'noise' from my MSI now so I can properly debug.

The error is being caused by your custom action returning a Windows Error of 1722.

Running 'net helpmsg 1722' at the cmd prompt yields;

 The RPC server is unavailable.

So that command is doing something that either depends on the local RPC server service (not started, which is odd because it is critical to Windows I think) or a remote server is reporting that back.

Ryan ONeill
You got the right error from the log, but wrong interpretation. In Windows Installer Error Messages (http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx), 1722 is as shown in the log. It means the program returned a non-zero error code. Either the program is reporting an error, or it needs its return code to be ignored.
Michael Urman
Thanks. The non-zero return code makes more sense. But I'm still at a loss of how to debug it? I need to see the output of what would normally be shown in the command window. I was hoping that maybe it would be in the trace. This is just an XmlPreprocess.exe (provided from CodePlex). It massages the web.config file. Naturally, I can run it outside of the install, and it works. Of course, it can throw errors, but I need to know what those errors are. How can i do that?
NealWalters
OK, another go. The Win32 error is normally in there somewhere and I think it is the -2147xxxx number. So type that into calc (or copy / paste) and then switch to hex. Ignore all the leading FFFF characters as this is due to the sign bit. You should have a number 80030002 which is Googleable. Searching for this, it looks like a simple file not found error. I could be wrong, but it looks likely. Try running procmon at the same time to see which files might be missing or copy your MSI contents to the target manually and run it from a console.
Ryan ONeill
Thanks, See 01/07 update above.
NealWalters
+2  A: 

Like in your previous question where I suggested using cmd.exe /C XmlPreProcess.exe ... for redirection, for debugging you can try with /K instead of /C. Then any output should stick around, and you'd be able to work within the context of the MSI at the time of error.

What I really suspect is the problem is the scheduling of your custom action. If this action is immediate, scheduled before InstallFinalize, and intended to operate on a file you will be installing, it will run before files are installed to the location you expect. The proper fix for this is generally to run the action in-script (also called deferred) so that by scheduling it between InstallFiles and InstallFinalize, it actually runs in that corresponding location.

As for providing better errors for your end users, or allowing them to browse for a file, these would both take custom actions, and probably need to be DLL actions (EXE actions can provide only pass/fail feedback). It will be your choice whether it's better (or easier) to provide a browse dialog or to verify the path the user provides. I'm not certain how much of this you can do in a Visual Studio Installer project (which is what I'm assuming you're using by your tags).

Michael Urman
Thanks, a forgot about the previous question I had posted because I thought this trace was going to be the panacea. I'm probably going to try an alternative approach of including the web services in the BizTalk Deployment Framework (BTDF) since they will be deployed to the same server at the same time. I've done some installers with NSI before, but this is the first "fancy" install I have tried with Microsoft's built-in Visual Studio tools (not too impressed).
NealWalters
For anyone in the BizTalk world, here's a discussion of what I'll be trying: http://biztalkdeployment.codeplex.com/WorkItem/View.aspx?WorkItemId=5675
NealWalters
Correction, that was NSIS (not NSI). http://nsis.sourceforge.net/Main_Page
NealWalters

related questions