【发布时间】:2017-07-21 20:48:39
【问题描述】:
这似乎是一个环境问题,因为它目前正在影响一位用户(据我们所知)。
我们使用 C# 自定义操作 dll,它依赖于 MSI 中的实用程序 dll。使用这些文件调用第一个自定义操作时,用户将获得:
SFXCA: Extracting custom action to temporary directory:
C:\Windows\Installer\MSIBAA4.tmp-\ SFXCA: Binding to CLR version
v4.0.30319 Calling custom action
CustomActions!CustomActions.CustomActions.InitializeInstallationValues
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.IO.FileLoadException:
Could not load file or assembly 'InstallerUtils, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
at CustomActions.CustomActions.InitializeInstallationValues(Session session)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
CustomAction InitializeProperties returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
由于 MSI 可以写入文件但不能从中读取,在我看来,某种形式的安全软件/策略可能已经到位;是否有 Windows API 可以让我确定原因:
访问被拒绝
【问题讨论】:
-
让您的(预防)信息技术部门解除对该用户计算机和/或帐户的文件权限。
-
“无法加载文件或程序集 'InstallerUtils [...]' 或其中一个依赖项。访问被拒绝。” - 所以可能依赖项丢失或无法访问。
-
这不是我们的 IT,而是我们的客户之一。这只发生在一个客户身上; MSI 在数百个其他环境中工作。我正在尝试以编程方式确定可能会阻止对文件的访问,以便我可以将该信息传递给用户。
-
今天我注意到有问题的 .dll 没有经过数字签名(它只是暂时提取到目标 PC)。我认为这可能是根本原因。
标签: c# windows windows-installer custom-action advanced-installer