开发者

MSI Error. 1001. Usage: InstallUtil .. error on production server

开发者 https://www.devze.com 2022-12-10 04:00 出处:网络
We have created an MSI installer using the tools on Visual Studio 2008. This has some custom actions implemented in a Installer class.

We have created an MSI installer using the tools on Visual Studio 2008.

This has some custom actions implemented in a Installer class.

It works fine on all the test servers but for some reason it fail in one of the production servers. The error message is:

Error. 1001. Usage: InstallUtil[/u|/uninstall][option[..]] assembly[[option[...]]assembly]

installUtil executes the开发者_如何学JAVA installer in each given assembly.||If the /u or /uninstall switch is ...


Indeed this has been plagueing me for days.

The parameters passed on the line to msiexec come through fine and show up properly in the Properties collection as veiwed through the log.

For example :

msiexec /i setup.msi /L* log.txt TargetDir="D:\Samples\Test\" CustAddOnDir="D:\Samples\Test\AddOns\" 

Show up in the log the way you expect:

Property(C): TARGETDIR = D:\Samples\Test\
Property(C): CUSTADDONDIR = D:\Samples\Test\AddOns\

However when you try to pass either on of these to a custom action via the CustomactionData on the properties page You get this error:

/addOnDir="[CUSTADDONDIR]"

It seems stupid, but removing the trailing "\" from the msiexec command line fixes the issue.

msiexec /i setup.msi /L* log.txt TargetDir="D:\Samples\Test" CustAddOnDir="D:\Samples\Test\AddOns" 

The problem now being that trying to pass TargetDir to your custom action always fails.

/destDir="[TARGETDIR]"

This seems to be due to a trailing "\" always being appended if it does not exist. This really kind of sucks if you want to the let the user choose a new directory to install to. How would you pull that in to your custom action?

You need to unescape the trailing slash:

/destdir="[TARGETDIR]\"


Is one of the parameters you pass to a Custom Installer class a directory? If so, most likely it is appending an extra \ to the end of the parameter name, which in turn is not properly escaped and thus causing this error.

Try running a command similar to this: msiexec /i .msi /L*V ""

Inspect the log file to locate the offending parameter.

Unfortunately I haven't yet found a way around this other than to pass the parameters to the custom assembly in some other way (hard coding - yikes!), or to re-read my path value from the registry in C# code.

0

精彩评论

暂无评论...
验证码 换一张
取 消