Visual Studio 2010:使用 msiexec.exe 的 Windows Installer 返回 MSI 错误 2727
我有一个 Visual Studio 安装项目,它使用 msiexec.exe 文件来创建 卸载 项,如 >>这是关于SO的<<文章。
安装程序不运行。
当我通过双击 setup.exe 文件启动安装程序时,“安装程序启动时请稍候”屏幕几乎没有闪烁,然后我就遇到了错误。
文本是(用于搜索功能):
安装程序在安装此软件包时遇到意外错误。这可能表明此包有问题。错误代码为2727。
我发现了一组 MSI 错误代码,错误代码 2727 转换为
目录表中不存在目录条目“[2]”
。
有人可以指导我解决这个问题吗?我应该怎么办?
[更新]
根据Cosmin Pirvu的建议,我为我的安装程序创建了错误日志。仔细查看后,我的安装错误似乎可能是由于链接到我与项目的 结合使用的 Not Installed 文件 msiexec.exe 造成的>[ProductCode]
创建卸载链接。
下面显示的日志文件似乎表明,当安装程序尝试为 msiexec.exe 创建临时文件时,我的安装失败,然后当它尝试显示错误图标时,又出现另一次失败。
文件>> Google 协作平台上的 install.log << 是我的错误日志文件的输出(提示:只需搜索返回值 3
即可找到错误)。
[更新 2]
我在安装项目中有一个卸载链接,它链接回我的主项目中的批处理文件 uninstall.bat
@echo off
%windir%\system32\msiexec.exe /x %1
: 卸载链接的参数
仅为[ProductCode]
,因为/x
开关被硬编码到批处理中文件。
[解决方案]:
Visual Studio 安装程序未创建其中包含某些所需 DLL 的文件夹。
I've got a Visual Studio Setup Project that uses the msiexec.exe file to create an Uninstall item as outlined in >> THIS << article on SO.
The Installer does not run.
When I launch the installer by double-clicking the setup.exe file, the "Please wait while setup launches" screen barely blips on the screen before I am confronted with my error.
The Text is (for search functions):
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727.
I have found a set of MSI Error Codes, and Error Code 2727 translates to
The directory entry '[2]' does not exist in the Directory table
.
Could someone guide me towards fixing this? What should I do?
[UPDATE]
At the suggestion of Cosmin Pirvu, I have created an error log for my installer. After looking it over, it appears my installation error could be the result of having a link to the Not Installed file msiexec.exe that I use in conjunction with my Project's [ProductCode]
to create an Uninstall link.
The log file shown below appears to indicate that my installation fails when the installer attempts to create a temporary file for msiexec.exe, then it has another failure when it tries to display the Error Icon.
The file >> install.log on Google Sites << is my Error Log file's output (Hint: just do a search for Return value 3
to get to the errors).
[UPDATE 2]
I have an Uninstall link in the setup project that links back to the batch file uninstall.bat
in my main project:
@echo off
%windir%\system32\msiexec.exe /x %1
The Arguments
to the Uninstall link is only [ProductCode]
, since the /x
switch is hard coded into the batch file.
[Solution]:
The Visual Studio Installer was not creating a folder that had some required DLLs in it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我的 2727 错误消息是我添加为项目链接的 *.png 文件的结果。 “复制到输出目录”设置为“如果较新则复制”。不知何故,Visual Studio 安装项目无法解析 *.png 文件的路径,并向安装程序添加了无效路径。
LessMSI 帮助找到了问题 https://lessmsi.activescott.com/ 并删除了项目中的链接并将文件添加到安装程序项目中解决了问题。
希望有人觉得这有帮助
问候
My 2727 error message was the result of a *.png file I had added as a link to my project. "Copy to Output Directory" was set to "Copy if newer". Somehow the Visual Studio Setup Project was not able to resolve the path to the *.png file and added an invalid path to the installer.
LessMSI helped to find the problem https://lessmsi.activescott.com/ and removing the link in the project and adding the files in the installer project solved the problem.
Hope someone finds this helpful
regards
第一步应该是创建安装日志以查看触发错误的原因。
从您发布的日志来看,您的 MSI 似乎尝试使用不在目录表中的目录。您是否使用任何合并模块或特殊的自定义操作?如果是这样,请尝试确定他们是否尝试使用您的包中的目录。
您提到了有关卸载快捷方式的内容。您能给我们提供更多详细信息吗?
The first step should be creating an installation log to see what triggers the error.
From the log you posted, it seems like your MSI tries to use a directory which is not in Directory table. Are you using any merge modules or special custom actions? If so, try to determine if they try to use a directory from your package.
You mentioned something about an uninstall shortcut. Can you give us more details?
老问题,我知道 - 只是想添加一些信息来帮助我在 Visual Studio 2015 中完成 Windows Installer 项目,以防有人遇到这个主题。
我收到了相同的错误消息 2727。我的问题是我将源代码包含到安装目录中的“src”文件夹中。在查看源代码的输出文件时,我注意到有几个这样的文件:
\obj\Release\\TemporaryGenerateFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
是的,它在发布后包含了额外的斜杠。我必须添加排除项(右键单击“源文件输出”->“排除过滤器”)以从安装中排除这些文件。我添加了“*临时*”以仅排除这些文件。
也许其他人可以解释为什么生成这些临时文件,我所知道的是这解决了问题。希望这会帮助其他人寻找这个主题。
Old question, I know - just wanted to add in some information that helped me with the Windows Installer project in Visual Studio 2015, in case anyone comes across this topic.
I got the same error message, 2727. My issue was that I was including my source code into an "src" folder in the installation directory. When looking at the output files for the source, I noticed several files like this:
\obj\Release\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Yes, it included that extra slash after Release. I had to add an exclusion (right click Source Files output -> ExcludeFilter) to exclude these files from installing. I added "*Temporary*" to exclude only these files.
Maybe someone else can explain why these temporary files were generated, all I know is that this fixed the issue. Hopefully this will help someone else looking for this topic.
我知道这是一个老问题,但就像 @Riccaforte 一样,我在 Visual Studio 2015 中修复此问题时遇到了一些麻烦。我所做的只是删除应用程序文件夹中的所有源文件,我不知道为什么,但确实如此窍门。
I know its a Old question, but like @Riccaforte I was having some trouble to fix this in Visual Studio 2015. What I did was just delete all my Source Files inside my Aplication Folder, and I don't know why, but it did the trick.
如果从目录表中删除一个或多个目录,这将导致仍在使用这些目录变量的其他表出现问题。
If you remove a directory or directories from the Directory Table, This will cause an issue with other tables still using those directory variables.