错误 LGHT0301:无法打开数据库 [英] Error LGHT0301: Failed to open the database

查看:32
本文介绍了错误 LGHT0301:无法打开数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 WiX 3.5.最近,以下 WiX 错误开始在构建服务器上频繁发生:

I'm using WiX 3.5. Recently, the following WiX error started occurring frequently on the build server:

light.exe (,):错误 LGHT0301:无法打开数据库.在验证期间,当尝试使用不受支持的代码页或不是有效 Windows Installer 数据库的文件打开数据库时,最常发生这种情况.请在 Module/@Codepage、Package/@SummaryCodepage、Product/@Codepage 或 WixLocalization/@Codepage 中使用不同的代码页;或确保您提供有效的 Windows Installer 数据库的路径.

light.exe (,): error LGHT0301: Failed to open the database. During validation, this most commonly happens when attempting to open a database using an unsupported code page or a file that is not a valid Windows Installer database. Please use a different code page in Module/@Codepage, Package/@SummaryCodepage, Product/@Codepage, or WixLocalization/@Codepage; or make sure you provide the path to a valid Windows Installer database.

错误指的是哪个数据库"?(WiX 源文件在很长一段时间内都没有改变,所以我怀疑这是代码页问题.)

Which "database" does the error refer to? (None of the WiX source files have changed in a long time, so I doubt it's a code page problem.)

其他人已经报告这个错误可能是由趋势科技Office Scan引起的,这确实是安装在构建服务器上.我要求系统管理员从扫描中排除构建目录,但仍然出现此错误.如何确定病毒扫描是否是罪魁祸首?(错误并不总是发生,所以如果我禁用病毒扫描并且下一次构建成功,我仍然不知道错误是否发生已永久消失.)

Other people have reported that this error may be caused by Trend Micro Office Scan, which is indeed installed on the build server. I asked the system administrator to exclude the build directories from the scan, but this error still occurs. How can I determine whether the virus scanner is the culprit? (The error doesn't always occur, so if I disable the virus scanner and the next build succeeds, I still don't know whether the error has gone away permanently.)

推荐答案

在学习了 WiX 源代码并运行 Process Monitor,我发现从病毒扫描中排除构建目录是不够的.

After studying the WiX source code and running Process Monitor, I found that excluding the build directories from the virus scan is insufficient.

说明: light.exe 运行时,它会在临时目录中创建目标 MSI 文件.(此文件是LGHT0301错误信息所指的数据库.)light.exe关闭MSI文件后,ntrtscan.exe打开MSI文件进行读取访问和只读共享.随后,在数据库验证步骤中,light.exe 尝试重新打开 MSI 文件进行读/写访问,并发生共享冲突.

Explanation: When light.exe runs, it creates the target MSI file in a temporary directory. (This file is the database that the LGHT0301 error message refers to.) After light.exe closes the MSI file, ntrtscan.exe opens the MSI file for read access and read-only sharing. Later, in the database validation step, light.exe tries to reopen the MSI file for read/write access, and a sharing violation occurs.

解决方案: 从实时病毒扫描中排除临时目录.例如,在 Windows Server 2008 上,此目录为 C:\Users\«username»\AppData\Local\Temp.

Solution: Exclude the temporary directory from the real-time virus scan. On Windows Server 2008, for example, this directory is C:\Users\«username»\AppData\Local\Temp.

这篇关于错误 LGHT0301:无法打开数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆