简体   繁体   English

Windows 安装程序 (C#) 错误代码 2869

[英]Windows Installer (C#) error code 2869

I have a project, in VS 2005, which has a console application and a setup project associated to install the application.我在 VS 2005 中有一个项目,它有一个控制台应用程序和一个与安装该应用程序相关的安装项目。 I also have an installer class in the console application that the setup project will use to do some validation before installation.我在控制台应用程序中还有一个安装程序类,安装项目将使用它在安装前进行一些验证。 Those tasks are checking the database connection string and checking some directory locations to make sure they exist prior to installation.这些任务是检查数据库连接字符串并检查某些目录位置以确保它们在安装之前存在。

I am getting an error code of 2869 when I try to install the application.当我尝试安装应用程序时,我收到错误代码 2869。 All the code is written in C#.所有代码都是用C#编写的。 I have googled for this error code on Windows XP, but only found articles that deal with Vista and Windows 7. Any ideas what might be happening?我在 Windows XP 上用谷歌搜索过这个错误代码,但只找到了有关 Vista 和 Windows 7 的文章。有什么想法可能会发生什么吗? Is there a workaround?有解决方法吗?

This won't help with fixing the installer code, but just in case this happens to anyone when doing in install on a Windows 2008 Server you probably need to run the installer from an elevated command prompt:这无助于修复安装程序代码,但万一有人在 Windows 2008 Server 上进行安装时发生这种情况,您可能需要从提升的命令提示符运行安装程序:

  1. Open a command prompt with Run As Administrator and then run the installer使用以管理员身份运行打开命令提示符,然后运行安装程序
  2. msiexec /i installer.msi msiexec /i installer.msi

Installer errors are difficult to debug, you can try to :安装程序错误很难调试,您可以尝试:

  1. Look in Event Viewer / Application for logged exceptions在事件查看器/应用程序中查看记录的异常
  2. Surround your code with a big try/catch and a MessageBox.Show(ex.ToString()) in the catch clause在 catch 子句中用一个大的 try/catch 和一个MessageBox.Show(ex.ToString())包围你的代码
  3. Generate a log when installing: msiexec /i "installer.msi" /lvx "log.txt" and look in it for clues安装时生成日志:msiexec /i "installer.msi" /lvx "log.txt" 并在其中查找线索

Error 2869 is documented as a dialog issue with the Windows Installer dialogs.错误 2869 被记录为 Windows 安装程序对话框的对话框问题。 The only reason you see it is that the setup is showing the error dialogs and there is a minor issue with it.您看到它的唯一原因是设置显示了错误对话框,并且存在一个小问题。 The true error will be earlier in the log.真正的错误将在日志中更早出现。 In other words it's a meaningless downstream error from an install that has already failed.换句话说,这是来自已经失败的安装的无意义的下游错误。 Look earlier in the log for the actual error, which nine times out of ten will be a failed custom action.更早地在日志中查看实际错误,十有八九是失败的自定义操作。

To get an idea of what happened, you can use Sysinternals' Process Monitor.要了解发生了什么,您可以使用 Sysinternals 的 Process Monitor。 It automatically instruments your operating system and is portable so you just need to do the following:它会自动检测您的操作系统并且是便携的,因此您只需要执行以下操作:

  • Download Process Monitor from https://technet.microsoft.com/sysinternals/processmonitor.aspxhttps://technet.microsoft.com/sysinternals/processmonitor.aspx下载进程监视器
  • Start Process Monitor启动进程监视器
  • Set Filter "Process Name is msiexec.com" to monitor your installer设置过滤器“进程名称是 msiexec.com”以监视您的安装程序
  • Start your installer (eg setup.exe) (no need to modify or run it with special command line switch)启动您的安装程序(例如 setup.exe)(无需修改或使用特殊命令行开关运行它)
  • Check the monitoring log for errors (file access, registry, etc.)检查监控日志是否有错误(文件访问、注册表等)

In my case Process Monitor showed me the cause "DISK FULL" at file extraction leading to error code 2869.在我的情况下,Process Monitor 在文件提取时向我展示了导致错误代码 2869 的原因“磁盘已满”。

I had this error as well and pursued the wrong course going after what was thought to be a "Run as Administrator" issue as explained above and in other forums.我也遇到了这个错误,并在上面和其他论坛中解释的被认为是“以管理员身份运行”问题之后采取了错误的做法。

I tried many solutions all dealing with Run as Administrator....Nothing worked.我尝试了许多解决方案都以管理员身份运行......没有任何效果。

I built a Windows 10 VM and tested the install in the purest environment I could and got the same error during the installation execution.我构建了一个 Windows 10 VM 并在我能做到的最纯粹的环境中测试了安装,并在安装执行过程中遇到了相同的错误。

At the end of it all.... it turned out I got the error code 2869 because the Serial Number I entered was not valid.最后......结果我得到了错误代码 2869,因为我输入的序列号无效。 (The serial number I was given by my predecessor had more entries than needed). (我的前任给我的序列号比需要的条目多)。

Once I entered the correct serial number it turned out "right as rain".一旦我输入了正确的序列号,结果“就像下雨一样”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM