Windows Installer (C#) error code 2869

2019-04-21 02:45发布

问题:

I have a project, in VS 2005, which has a console application and a setup project associated to install the application. 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. All the code is written in 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? Is there a workaround?

回答1:

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:

  1. Open a command prompt with Run As Administrator and then run the installer
  2. msiexec /i installer.msi


回答2:

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
  3. Generate a log when installing: msiexec /i "installer.msi" /lvx "log.txt" and look in it for clues


回答3:

To get an idea of what happened, you can use 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.aspx
  • Start Process Monitor
  • Set Filter "Process Name is msiexec.com" to monitor your installer
  • Start your installer (e.g. setup.exe) (no need to modify or run it with special command line switch)
  • 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.



回答4:

Error 2869 is documented as a dialog issue with the Windows Installer dialogs. 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.