Fixing the Creation of Setup/Deployment Packages on Windows Vista (Fixing the dreaded "error code 2869")

There are a few Visual Studio 2005 bugs that surface when building installation packages on a Windows Vista machine.

  1. If your installation package performs a custom action you will get the dreaded “error code 2869” error during installation
  2. Exceptions thrown during the install process are obscured

I found answers to these problems in Aaron Stebner’s Web Log and at Omar Shahine’s Web Log — thanks to these folks for posting their solutions!

Some of the instructions were not as clear as they could be, so I have repeated them here with a few modifications:

To fix both of these problems:

  1. Download this sample script and extract the contents to the root directory of your Visual Studio Setup/Deployment project
  2. If you haven’t already done so, download and install the Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components
  3. In Windows Explorer, go to this folder:C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\SysMgmt\MSI

    Locate the file WiRunSQL.vbs and copy it to your Setup/Deployment project’s root folder

  4. Open the Setup/Deployment project in Visual Studio 2005
  5. Press F4 to display the Properties window
  6. Click on the Setup/Deployment project in the Solution Explorer
  7. Click on the PostBuildEvent property in the Properties window to display the ellipses button
  8. Click on the ellipses button to display the Post-build Event Command Line dialog
  9. Add the following command lines to the Post-build event command line text box:cscript.exe “$(ProjectDir)CustomAction_NoImpersonate.js” “$(BuiltOuputPath)”
    cscript.exe “$(ProjectDir)WiRunSQL.vbs” “$(BuiltOuputPath)” “INSERT INTO `Error` (`Error`, `Message`) VALUES (1001, ‘Error [1]: [2]’)”
  10. Build your project in Visual Studio 2005


Best Regards,

Kevin McNeish
Microsoft .NET MVP
President, Oak Leaf Enterprises, Inc.
Chief Architect of the MM .NET Application Framework

3 thoughts on “Fixing the Creation of Setup/Deployment Packages on Windows Vista (Fixing the dreaded "error code 2869")

  1. After applying those solution to get rid of error 2869
    I have an error like this:
    “Error 1001: Exception has been thrown by the target of an invocation. –> Could not load file or assembly ‘ExecutionEngine, Version=3.0 … etc The application has failed to start because its side-by-side configuration is incorrect. Please see the application..”

    How can I fix this error?

  2. This is the first article that explains, first how to use WiRunSQL.vbs and get rid of 2869 error. Excellent.

Leave a Reply

Your email address will not be published. Required fields are marked *