Reputation: 742
I have an MSI for a .NET application that I created using Visual Studio 2005 that includes a custom action to write some registry keys at the end of the install. I found that the installer works fine on Windows XP SP2 and SP3. However, when I try to run the installer on a Vista PC, the installer seems to get almost all the way to the end, but then dies and rolls back giving an Error Code 2869.
I logged in with an account that is an Administrator, but I still get the same error.
Upvotes: 4
Views: 7816
Reputation: 1
You need to install the .NET Framework 3.5 for a lot of these old apps on Windows 10 as its not longer on by default.
Upvotes: 0
Reputation: 20848
I found the definitive answer to this problem. Error 2869 is a meaningless error that means "Can't display the error for the real problem". The real error is obscured. In many cases, that error has to do with impersonation, but not always!
This solution both fixes the error display bug, and also fixes the Impersonation/Admin priv issue on Vista and Windows 7.
The one thing that is missing is the hand-holding (for someone that doesn't want to know anything about javascript, like me) to get this to work.
Grab the script, and save it to your Deployment project folder as PostBuildVistaFix.js
Changed PostBuildEvent to
cscript.exe ..\PostBuildVistaFix.js your_installer.msi
Upvotes: 3
Reputation: 1975
The problem has to do with Vista enforcing the NoImpersonate bit on Custom Actions. This was previously ignored by XP.
You cannot set the bit in Visual Studio 2005, but here is a process to go thru to get it to work.
Upvotes: 1
Reputation: 22426
The solution I've come up with is to distribute customers an EXE with a manifest configured to trigger UAC elevation at the beginning of the install, rather than an MSI (our app must be installed per-machine anyway)
Upvotes: 1
Reputation: 742
Ok, I found one solution to my problem:
If I log in as an administrator user and instead of just running my installer by double clicking the msi or setup.exe, if I right click and select "Run as Administrator" my program installs successfully.
Looks like this has to do with the fact that UAC was enabled on the machine. I tried it on a Vista machine with UAC turned off and the installer worked just fine when run normally by an Admin user.
A similar quick and dirty approach to fixing this can be found here
Upvotes: 2