Ask a questionAsk a question
 

Proposed AnswerError code 2869 with Vista

  • Monday, January 22, 2007 6:42 PMAmeya Barve Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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?

     

     

     

All Replies

  • Monday, January 22, 2007 10:38 PMStefan KruegerMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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.

  • Thursday, February 01, 2007 6:03 AMGabriel Lozano-Morán Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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.

  • Tuesday, April 10, 2007 10:11 PMkatrash Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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/).

  • Wednesday, May 16, 2007 8:58 PMAmeya Barve Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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!


  • Friday, March 28, 2008 4:31 PMcfranchuk Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.
  • Friday, March 28, 2008 7:43 PMkatrash Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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 = 1

    Const msiViewModifyInsert = 1

    Const msiViewModifyUpdate = 2

    Const msiViewModifyAssign = 3

    Const msiViewModifyReplace = 4

    Const msiViewModifyDelete = 6

    Const msidbCustomActionTypeInScript = &H00000400

    Const msidbCustomActionTypeNoImpersonate = &H00000800

    Dim databaseFile

    Dim installer : Set installer = Nothing

    Dim database : Set database = Nothing

    Dim sql

    Dim View, Record

    Dim openMode : openMode = msiOpenDatabaseModeTransact

    On Error Resume Next

    Call 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 Sub

    Sub 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 Sub

    Sub 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 Sub

    Sub CheckError

    Dim 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 Sub

    Sub Fail(message)

    Wscript.Echo message

    Wscript.Quit 2

    End Sub

    '' --------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • Friday, March 28, 2008 7:46 PMPhilWilsonModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Visual Studio 2008 Setup Projects generate MSI files that have that "no impersonate" bit already set, so the Orca fix isn't necessary.

     

  • Thursday, April 17, 2008 10:10 AMTerje Myklebust Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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
  • Thursday, January 15, 2009 4:08 PMMichael Bleterman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    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
    • Proposed As Answer byNatureBoiy Monday, January 26, 2009 4:05 PM
    •  
  • Thursday, January 15, 2009 9:01 PMPhilWilsonModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Monday, January 26, 2009 4:14 PMNatureBoiy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.