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.
- If your installation package performs a custom action you will get the dreaded "error code 2869" error during installation
- 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:
- Download this sample script and extract the contents to the root directory of your Visual Studio Setup/Deployment project
- 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
- 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
- Open the Setup/Deployment project in Visual Studio 2005
- Press F4 to display the Properties window
- Click on the Setup/Deployment project in the Solution Explorer
- Click on the PostBuildEvent property in the Properties window to display the ellipses button
- Click on the ellipses button to display the Post-build Event Command Line dialog
- 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 : ')"
- Build your project in Visual Studio 2005
Microsoft .NET MVP
President, Oak Leaf Enterprises, Inc.
Chief Architect of the MM .NET Application Framework