Error code 2869 with Vista
We have our application Setup program created using Visual Studio 2005 (Setup & Deployment project). Our application setup program runs fine on Windows XP / 2003, however we get the following error message when we try to run the setup program under Vista:
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869.
According to the Windows Installer documentation, error 2869 means "The dialog [2] has the error style bit set, but is not an error dialog."
I don't understand what the issue could be here? Do we need to create/build a separate installer for Windows Vista?
所有回覆
This indicates that a dialog in your setup is improperly authored. But it may not the root cause for the failure. I guess your setup is encountering whatever error, and when it tries to display the error message it detects a problem with the error dialog. So I'd suggest you generate a verbose log of the install to find the root cause:
msiexec.exe /i your.msi /L*v c:\logfile.txt
And of course: fix the dialog.
I receive the same message trying to install Guidance Automation Toolkit on Windows Vista. A workaround is to create a shortcut:
msiexec.exe /i <name of the msi>.msi
And run this shortcut as an Administrator.
The source of problems occur when the installer tries to execute another application under Vista. The new process will not have the required credentials to run and so it might fail if any of its actions requires elevated credentials. For more on this see: Teach Your Apps To Play Nicely With Windows Vista User Account Control (http://msdn.microsoft.com/msdnmag/issues/07/01/UAC/).
- Snippet from the article above:
To specify that a package can only be installed by an administrator into the Public profile, set ALLUSERS="1" or ALLUSERS="2" and set bit 3 of the Word Count Summary property to 0. To specify that a package is a per-user installation that can be installed by a standard user, set ALLUSERS="" or don't define the property, and set bit 3 of the Word Count Summary property to 1.
We use VisualStudio 2005 to create our installer, and I'm guessing that ALLUSERS = "" can be set by specifying InstallAllUsers=False in the Deployment Project Properties window. However, I don't know how to set bit 3 of the Word Count Summary property to 1. Could someone point me to the correct place where I could set this?
Another snippet:
.. these MSI files fail because the CustomActions attempt to do something that requires administrator privileges. Usually this can be fixed by merely adding the msidbCustomActionTypeNoImpersonate attribute to the CustomActions.
I'm guessing this is an attribute I attach to my CustomActions class, does anyone have a C# sample of what the attribute looks like?
Thx! - I encountered the same problem a while back and for the most part the only information I could find was to run the installer from a command prompt with administrative priveleges or other work arounds. In my case, the MSI package needs to be distributed through SMS. I want a clean and simple solution. The MSI I have been building is built with Visual Studio 2005. It doesn't exactly give the option of setting the impersonate settings for CustomActions included in the MSI. My installer has a managed custom action that was not getting the Administrative priveleges that the rest of the installer is running under. To fix this I installed a program named ORCA. Once installed i opened ORCA and used it to open the MSI package. On the left-hand side a list of editable regions of the MSI are listed. I navigated to the CustomAction package and located an action with a value of 1025. There are probably a few different values that this can contain. using the wonderful MSDN documentation i located a value that turns ont he impersonation feature, 3137. After changing the 1025 -> 3137 i saved the file, closed ORCA, loaded the MSI on to a vista machine and it installed without any problems.
I've solved this long time ago in a way that enables it to be added to automated build using some help from the internet (links are shown below). Run this script after creating the MSI file. Save this script to a file called "NoImpersonate.vbs" and invoke it from a command line as this:
cscript NoImpersonate.vbs MSI-FILE
Here is the script code:
'' --------------------------------------------------------------------------------------------------------------------------------------------------------------------
'' From:
'' http://blogs.msdn.com/mshneer/archive/2007/03/02/windows-installer-fails-on-vista-with-2869-error-code.aspx
'' http://www.shahine.com/omar/VSTOAddinsAndVista.aspx
'' http://msdn2.microsoft.com/en-us/library/aa368069.aspx
'' Since I had the same problems, I combined the 2 scripts, Aaron and Misha proposed to 1.
'' For those, who are not developers and try to install an existing Msi, just run the script on the msi:
'' cscript <path to the script> <path to the msi>
'' Here is the script, most of it is taken from Aarons post of setting the NoImpersonate-Flag:
'' prepare MSI-Files for use on Vista-Systems
'' Visual Studio forgot to include 2 things:
'' 1. Mark Custom Actions as NoImpersonate, otherwise an Security-Error results in Error 2869
'' 2. User-Exceptions in CustomActions are not shown. Instead a plain Error 2869 without description occurs.
'' Therefore Error-Message for this case has to be defined.
'' cscript NoImpersonate.vbs <msi-file>
'' Performs a post-build fixup of an msi to change all deferred custom actions (CA) to NoImpersonate
Option
Explicit'' Constant values from Windows Installer
Const
msiOpenDatabaseModeTransact = 1Const
msiViewModifyInsert = 1Const
msiViewModifyUpdate = 2Const
msiViewModifyAssign = 3Const
msiViewModifyReplace = 4Const
msiViewModifyDelete = 6Const
msidbCustomActionTypeInScript = &H00000400Const
msidbCustomActionTypeNoImpersonate = &H00000800Dim
databaseFileDim
installer : Set installer = NothingDim
database : Set database = NothingDim
sqlDim
View, RecordDim
openMode : openMode = msiOpenDatabaseModeTransactOn
Error Resume NextCall
Main()Sub
Main()If WScript.Arguments.Length <> 1 Then
Fail("Usage is: cscript " & WScript.ScriptName & " [msi file]")
End If
databaseFile = WScript.Arguments(0)
'WScript.Echo(WScript.ScriptName & ": operating on file '" & databaseFile & "'")
'' Instantiate Windows Installer object
Set installer = WScript.CreateObject("WindowsInstaller.Installer") : CheckError
'' Open the MSI database
Set database = installer.OpenDatabase(databaseFile, openMode) : CheckError
Proc1 : CheckError
'Proc2 : CheckError
If openMode = msiOpenDatabaseModeTransact Then
database.Commit
End If
WScript.Quit 0
End
SubSub
Proc1()'' 1. problem: CustomActions in Vista have to run with NoImpersonate
sql = "SELECT `Action`, `Type`, `Source`, `Target` FROM `CustomAction`"
Set View = database.OpenView(sql) : CheckError
View.Execute : CheckError
Do
Set Record = View.Fetch
If Record Is Nothing Then Exit Do
'typeVal = Record.IntegerData(2)
If (Record.IntegerData(2) And msidbCustomActionTypeInScript) <> 0 Then
'WScript.Echo "Here 1, Type=" & Record.IntegerData(2)
Record.IntegerData(2) = Record.IntegerData(2) Or msidbCustomActionTypeNoImpersonate
'WScript.Echo "Here 2, Type=" & Record.IntegerData(2)
View.Modify msiViewModifyReplace, Record : CheckError
End If
Loop
View.Close
End
SubSub
Proc2()'' 2. problem: explicit format User-Errors, otherwise they are not visible in Vista, the User just sees Error 2869
sql = "INSERT INTO `Error` (`Error`, `Message`) VALUES (1001, 'Error [1]: [2]')"
Set View = database.OpenView(sql) : CheckError
WScript.Echo "Here 2"
View.Execute : CheckError
WScript.Echo "Here 3"
View.Close
End
SubSub
CheckErrorDim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText
End If
Fail message
End
SubSub
Fail(message)Wscript.Echo message
Wscript.Quit 2
End
Sub'' --------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Visual Studio 2008 Setup Projects generate MSI files that have that "no impersonate" bit already set, so the Orca fix isn't necessary.
I got this error when I try to run the MSI file. If I start the EXE file (thet in the next fase use the MSI file) i works without any problem.
I use VS2008- Some our customers receiving this error during the installation on Windows XP Professional SP2. MSI runs Custom Actions that uses .Net dll that invokes web service.
Users are administrators and PC connected to the internet. Any ideas?
Best regards,
Michael- 已提議為解答NatureBoiy Monday, 26 January, 2009 16:05
- Try starting a new thread rather than resurrecting this old one. Describe what kind of setup it is (a web setup or ordinary setup&deployment) and which version of Visual Studio. Error 2869 is a generic one that unfortunately obscurs the actual error just prior to it. Doing the install with an MSI log may tell you what's going wrong:
msiexec /i <path to msi> /l*vx <path to some text log file>
Phil Wilson - You are having the same problem as described above. XP Professional has the same user access security turned on by default like Vista, this causes programmes run by users (even if that user is an administrator) to run with less privileges unless the programme has a manifest to elevate its privileges. Unfortunately as far as I know you can not attach manifests to customer actions of MSI files. The MSI , running under administrator, is starting new processes for the custom actions and they start with the lower privileges. Setting the NoImpersonate flag stops the administrator from pretending to be a user with less privileges when starting these new processes.
- Hi, I appologise for starting up this old thread again. Not sure where to post this otherwise. If anyone could point that out the that would be helpfull.
I'm experiencing the MS Installer 2869 error as explained above in thread on Vista with VS 2005. I've run scrip to set the NoImpersonate bit on the custom action. I am running my setup.msi from the command prompt with admin rights (selected the cmd.exe as run as administrator).
I have used the .Net Framework 2.0 Configuration tool to set my Runtime Security Policy Machine Code Groups My_Computer_Zone permission set to Everything. In this state the install fails. When the permission is set to Full Trust the install succeeds no problem. I've done this at the recommendation of the MS Self Paced Exam Prep for 70-536.
Am I right in thinking that when set to Full Trust any CAS statements in my code are completely ignored? The setup project attempts to install an untouched windows forms application. It doesn't do anything but do the default stuff provided by the template.
I seems as though an end user of an application might install it with at least an Everything permission set, otherwise CAS is ignored.
Any feedback would be most appreciated.
Thanks.

