【问题标题】:How to fix WixCloseApplications: Error 0x8007064f: failed to open view on database?如何修复 WixCloseApplications:错误 0x8007064f:无法打开数据库视图?
【发布时间】:2017-05-31 15:46:02
【问题描述】:

我是 Wix 的新手。在安装 msi 时,我想使用 util:CloseApplication 来检测 notepad.exe 是否正在运行。我的简单代码。

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<util:CloseApplication CloseMessage="no" Target="notepad.exe" RebootPrompt="no"/>

<InstallExecuteSequence>
    <Custom Action="WixCloseApplications" After="InstallInitialize"/>
</InstallExecuteSequence>

在 Wix 3.10 和 3.11 工具集中都失败了。有什么建议吗? 还尝试执行 WixCloseApplications Before="InstallValidate"。结果一样。

MSI 日志文件:(去掉时间戳)

MSI (s) (6C:90) [10:47:42:356]: Doing action: WixCloseApplications
Action 10:47:42: WixCloseApplications. 
Action start 10:47:42: WixCloseApplications.
MSI (s)  Creating MSIHANDLE (1) of type 790542 for thread 60816
MSI (s)  Invoking remote custom action. DLL: C:\Windows\Installer\MSI95B2.tmp, Entrypoint: WixCloseApplications
MSI (s)  Generating random cookie.
MSI (s)  Created Custom Action Server with PID 57776 (0xE1B0).
MSI (s)  Running as a service.
MSI (s)  Hello, I'm your 32bit Impersonated custom action server.
MSI (s)  Creating MSIHANDLE (2) of type 790541 for thread 60964
MSI (s)  Note: 1: 2205 2:  3: WixCloseApplication 
MSI (s)  Note: 1: 2228 2:  3: WixCloseApplication 4: SELECT `WixCloseApplication`, `Target`, `Description`, `Condition`, `Attributes`, `Property`, `TerminateExitCode`, `Timeout` FROM `WixCloseApplication` ORDER BY `Sequence` 
MSI (s)  Creating MSIHANDLE (3) of type 790531 for thread 60964
WixCloseApplications:  Error 0x8007064f: failed to open view on database
MSI (s)  Closing MSIHANDLE (3) of type 790531 for thread 60964
MSI (s)  Creating MSIHANDLE (4) of type 790531 for thread 60964
WixCloseApplications:  Error 0x8007064f: failed to open view on WixCloseApplication table
MSI (s) Closing MSIHANDLE (4) of type 790531 for thread 60964
MSI (s) Closing MSIHANDLE (2) of type 790541 for thread 60964
CustomAction WixCloseApplications returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) Closing MSIHANDLE (1) of type 790542 for thread 60816
Action ended 10:47:42: WixCloseApplications. Return value 3.
MSI (s) Machine policy value 'DisableRollback' is 0
MSI (s) Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) Calling SRSetRestorePoint API. dwRestorePtType: 13, dwEventType: 103, llSequenceNumber: 958, szDescription: "".
MSI (s) The call to SRSetRestorePoint API succeeded. Returned status: 0.
MSI (s) Unlocking Server
Action ended 10:47:42: INSTALL. Return value 3.

【问题讨论】:

  • 忘了说。我不想使用 taskkill 或 WixQuietExec 之类的东西。我不想杀死exe。只是想让用户知道然后退出安装。即使使用 CloseMessage="yes"。结果相同。

标签: windows-7 wix wix3 wix3.10


【解决方案1】:

我想我已经找到了我遇到的问题的根本原因。 如果我将完整的 ClosApplication 代码放在 &lt;Fragment&gt;&lt;/Fragment&gt; 中,则会跳过整个代码片段(仅仅是由于缺乏参考)。

<Fragment>
    <util:CloseApplication ID="StopNotepad" CloseMessage="no" Target="notepad.exe" RebootPrompt="no"/>

    <InstallExecuteSequence>
        <Custom Action="WixCloseApplications" After="InstallInitialize"/>
    </InstallExecuteSequence>
</Fragment>

我之前看到的问题略有不同。我的片段只包含这个

<Fragment>
    <util:CloseApplication ID="StopNotepad" CloseMessage="no" Target="notepad.exe" RebootPrompt="no"/>
</Fragment>

通过外部 wxi 文件包含所需的自定义操作。最后的 msi 包含对自定义操作的调用,但缺少 Util:CloseApplication 声明。结果,msi 部署失败,我看到了奇怪的日志条目,上面写着WixCloseApplications: Error 0x8007064f: failed to open view on database

解决方案: 通过将&lt;util:CloseApplication 片段代码移动到&lt;Product&gt;&lt;\Product&gt; 或其他现有的&lt;Fragment&gt; 中,这些代码引用了外部世界。例如,Directory Id=etc 将解决问题。

除非有办法包含&lt;util:CloseApplication 引用(我不知道),否则不要将&lt;util:CloseApplication 代码放在它自己的片段中!

【讨论】:

    猜你喜欢
    • 2020-05-28
    • 2014-06-18
    • 2011-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-11
    相关资源
    最近更新 更多