English 中文(简体)
How to debug failure of a custom action in an MSI/Setup project
原标题:

For a custom action, I m setting to Name to XmlPreprocess.exe (a CodePlex utility)

and arguments to: /x:"[SETTINGSFILE]" /i:"[TARGETDIR]web.config" /e:[ENVIRONMENTBUTTON] [CUSTOMSETTINGS] >[TARGETDIR]XmlPreProcess.log

SETTINGSFILE is supposed to be coming from a custom form page I added, and ENVIRONMENTBUTTON is the value of one of my radio buttons.

Is there any way to get the redirect to work? It s not creating the .log file. Is there any other way to see the results of the custom action? How can I even confirm if it ran? What if I would like to see what parms were sent to it?

Update 3: - For more scenarios of what I have tried, see here: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454

Thanks,

Neal

Update: I just wrote a quickie VBScript to verify my parms.

dim fso, oFile 
set fso = Createobject("Scripting.FileSystemObject") 
set oFile = fso.CreateTextFile("VBScriptOut.txt") 

if WScript.Arguments.Count < 2 then 
   oFile.Writeline("Number of arguments was only = " & WScript.Arguments.Count)
else 
   oFile.WriteLine("SETTINGSFILE=" & WScript.Arguments.Item(0))   
   oFile.WriteLine("ENVIRONMENTBUTTON=" & WScript.Arguments.Item(1))
end if 

oFile.close

No VBScriptout.txt was created, so I don t think it even ran (so my guess is the XmlPreprocess isn t even running either).

I included the InstalLVerification.vbs file as a Custom Action under "Install". I set the condition= True in the properties window. I set CustomActionData to: "[SETTINGSFILE]" [ENVIRONMENTBUTTON]

Update 2: I realized now Condition should not be "True". I either blank it out or set it to "Not Installed".

I m getting an unexplained error on XmlPreprocess, and I cannot get the VBScript to run. I tried running it also with CScript64.exe.

最佳回答

Only the command prompt (and occasional other tools) use the greater-than symbol to indicate output redirection. Windows Installer just calls the Win32 CreateProcess API which does not process this symbol. Thus your attempt to log the results will not work. Perhaps you can rewrite your command to look like cmd.exe /c XmlPreprocess.exe /x ... > [TARGETDIR]XmlPreprocess.log (some extra quoting may be required).

For debugging purposes, you can generally get a lot more information by taking a verbose log of the installation process. It will include a listing of properties, and of custom actions it launched and their return codes. I think it will even include the fully formatted command line passed to the application in your case.

Like you say in Update 2, note that a condition of True actually means to look up whether a property of the name True is defined. If you want something that s always true, use the value 1.

问题回答

暂无回答




相关问题
Correct place to install demostration projects?

With the new Windows 7 restrictions (well, new to Windows Vista anyways), we can no longer install demo projects to %ProgramFilesFolder%OurApplicationdemo since restricted users will not be able to ...

.deb package conffiles problem

I am distributing one of my applications using a .deb package, but have a problem relating to one of the files. The distribution includes a database file which is constantly updated by the app, on a ...

Closing an application using WiX

In creating my WiX installer I have run into an issue when trying to close an application before installing the upgrade. Below is an example of how I am attempting to do this. <util:...

VS 2005 Setup - HKCU

I am trying to fix an existing application that uses a Visual Studio 2005 setup project. We are requiring it to work on limited user accounts for XP, our app is written in C# for .Net 2.0. It writes ...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

configsource and installer

I have an project csproj, with app.config file, and logging Ent.Library section using configsource attribute. The logging section is in ahother file Configloggingconfiguration.config. I have a ...

热门标签