Making sense out on .MSI verbose trace - running a

2019-03-06 02:53发布

问题:

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:

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).



回答2:

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.