2010-04-14 59 views
0

我正在嘗試創建一個WiX自定義操作,這將允許我關閉並清除作爲升級安裝一部分的COM +軟件包,或創建並配置新的COM +軟件包作爲初始安裝。我以前曾經將它作爲標準Visual Studio MSI中的CustomAction運行,但這隻允許在複製文件後執行自定義操作 - 這將會因爲程序包仍在運行而失敗。使用COMAdmin interop運行WiX CustomAction時出現FileNotFoundException

COMAdmin.dll已作爲對CustomAction項目的引用添加並且已設置CopyLocal = true。在自定義操作項目的bin文件夾中存在Interop.COMAdmin.dll。 this question的答案似乎表明它應該起作用。

我正在試圖安裝時,MSI內的下列異常日誌:

MSI (s) (C4:04) [10:40:34:205]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI119.tmp, Entrypoint: BeforeInstall 
SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installer\MSI119.tmp-\ 
SFXCA: Binding to CLR version v2.0.50727 
Calling custom action MyCustomAction!MyCustomAction.CustomActions.BeforeInstall 
Exception thrown by custom action: 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
File name: 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 
    at MyCustomAction.CustomActions.BeforeInstall(Session session) 

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value . 

    --- End of inner exception stack trace --- 
    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean skipVisibilityChecks) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture) 
    at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr) 
+0

爲了澄清,我在VS2008上使用了WiX 3.0。 – 2010-04-14 10:26:02

回答

0

而不是使用Visual Studio的安裝程序類的,我建議切換到DTF那是WiX的工具集的一部分。 DTF比安裝程序類更靈活,並且與Windows Installer更好地集成。

相關問題