Question

Je suis en train de créer une action personnalisée WiX qui me permettra d'arrêter et de dégager vers le bas un package COM + dans le cadre d'une installation de mise à niveau, ou créer et configurer un nouveau package COM + dans le cadre de l'installation initiale. J'avais déjà cette course comme CustomAction dans un MSI standard de Visual Studio, mais cela permet que l'action personnalisée à exécuter après que les fichiers ont été copiés - qui échouera comme le paquet sera encore en cours d'exécution

.

Le COMAdmin.dll a été ajouté en tant que référence pour le projet CustomAction et est fixé CopyLocal = true. Dans le dossier bin pour le projet d'action personnalisé le Interop.COMAdmin.dll est présent. La réponse à cette question semble suggérer que cela devrait fonctionner.

Je reçois l'exception suivante dans le journal MSI lorsque vous essayez d'installer:

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)
Était-ce utile?

La solution

Au lieu d'utiliser les classes d'installation de Visual Studio, je vous conseille de passer à DTF qui fait partie du jeu d'outils WiX. DTF est beaucoup plus souple et intègre mieux avec Windows Installer que les classes d'installation font.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top