Windows Installer (C#) error code 2869 - c#

I have a project, in VS 2005, which has a console application and a setup project associated to install the application. I also have an installer class in the console application that the setup project will use to do some validation before installation. Those tasks are checking the database connection string and checking some directory locations to make sure they exist prior to installation.
I am getting an error code of 2869 when I try to install the application. All the code is written in C#. I have googled for this error code on Windows XP, but only found articles that deal with Vista and Windows 7. Any ideas what might be happening? Is there a workaround?

This won't help with fixing the installer code, but just in case this happens to anyone when doing in install on a Windows 2008 Server you probably need to run the installer from an elevated command prompt:
Open a command prompt with Run As Administrator and then run the
installer
msiexec /i installer.msi

Installer errors are difficult to debug, you can try to :
Look in Event Viewer / Application for logged exceptions
Surround your code with a big try/catch and a MessageBox.Show(ex.ToString()) in the catch clause
Generate a log when installing: msiexec /i "installer.msi" /lvx "log.txt" and look in it for clues

Error 2869 is documented as a dialog issue with the Windows Installer dialogs. The only reason you see it is that the setup is showing the error dialogs and there is a minor issue with it. The true error will be earlier in the log. In other words it's a meaningless downstream error from an install that has already failed. Look earlier in the log for the actual error, which nine times out of ten will be a failed custom action.

To get an idea of what happened, you can use Sysinternals' Process Monitor.
It automatically instruments your operating system and is portable so you just need to do the following:
Download Process Monitor from https://technet.microsoft.com/sysinternals/processmonitor.aspx
Start Process Monitor
Set Filter "Process Name is msiexec.com" to monitor your installer
Start your installer (e.g. setup.exe) (no need to modify or run it with special command line switch)
Check the monitoring log for errors (file access, registry, etc.)
In my case Process Monitor showed me the cause "DISK FULL" at file extraction leading to error code 2869.

I had this error as well and pursued the wrong course going after what was thought to be a "Run as Administrator" issue as explained above and in other forums.
I tried many solutions all dealing with Run as Administrator....Nothing worked.
I built a Windows 10 VM and tested the install in the purest environment I could and got the same error during the installation execution.
At the end of it all....
it turned out I got the error code 2869 because the Serial Number I entered was not valid.
(The serial number I was given by my predecessor had more entries than needed).
Once I entered the correct serial number it turned out "right as rain".

Related

Visual Studio Installer : How to run application if it already installed?

I have application on C# created in Visual Studio 2015. I added installer project and created installer of my application. My installer saves path to install directory of my app in registry.
Is it posible when run installer to check if app is currently istalled - run it, if not - run installation progress?
My purpose is: I need to create a CD disk with my app. When user inserts this cd disk at first time the installer is run. When user inserts this cd disk another time the installed app must run without install process.
Autoplay of inserted CDs is something that is frequently turned off (the security risk) so I wouldn't count on anything automatic happening.
The normal behavior of inserting a CD and "running" it for an installed product is that a maintenance/repair operation occurs. It's probably not a good idea to change this behavior. Also, if your installed product is broken in some way and goes into repair mode then the user will be asked to insert the CD to get the install repaired (such as installing deleted files) and again it wouldn't be a good idea if inserting the CD broke this behavior and decided to run your app instead (or at the same time).
So this isn't really an install question because it's about the design of the program you put on the CD that deals with all this when the user runs the CD. It will need to see if the product is already installed, and if it is then run the installed app, except that the user may have put the CD in because Windows asked them to for a repair, and I don't know how the program can detect that it was inserted for a repair. If the product isn't installed then you run your setup. This all code you'd need to write, dealing with the issues that people have raised.
There are many issues here, and also I've never seen a product that behaves like this, so that's something else that users don't expect. It's not a good idea, as everyone is saying, and you almost need to decide which features of Windows Installer you want to break, such as repair and maintenance.

SHIM_NOVERSION_FOUND error while trying to run screensaver from preview

I have an not trivial task to do. I need to run website as a screensaver in windows 8. So I used next approach to achieve it:
http://www.codeproject.com/Articles/31376/Making-a-C-screensaver
The solution is working well when I run from the Visual studio or run a compiled .exe or .scr directly. But when I try to set the resulting .scr as a screensaver and try to push preview button in windows 8(on the same machine where the same .scr is running well) I get the error - "SHIM_NOVERSION_FOUND".
I found that this error can appear when required version of .NET framework is not installed, but it's not my case cause when I run directly that '.scr' it's working.
Thanks for any advance!
Problem has been solved, I've just put screensaver.scr to c:/temp folder and all started working, probably I didn't have some kind of rights to access screensaver from c:/windows/system32

ServiceInstaller and "service already exists" 1001 error

I have an application with a project- and serviceinstaller in it. The installation usually works fine except in some cases when installed through PSEXEC remotely.
I wonder, where in the code I can intercept and check if the specific service is already installed and either, depending of best option, uninstall it or skip the current installation of service (but still continue with the overall install).
You can try uninstalling it unconditionally every time before you install.

c# error on windows service

I have the following error:
OpenSCManager Failed 5: Access is denied.
Can someone help me? Is there another way besides using installutil to install the windows service ?
P.S : I am using Visual studio 2008. I did look for installutil in C:\VisualStudio... but i can't find it either.
I found the InstallUtil.exe executable. I run the application and now i have the error: c:...\InstallUtil,installLog is denied. WHY?
There are two questions here:
For the access denied problem. Chances are you are don't have permissions. Run the command with administrative privilegies. This means that you have to be a member of administrators group and your process has to be elevated, i.e. you have to right-click -> Run As Administrator to lauch the process.
There are many ways to install service. Since you already know InstallUtil, I don't have to mention it.
There is Win32 API called CreateService.
There is command line utility sc.exe -- it comes with OS by default
If you are so inclined, you can hack registry -- it is not that difficult to reverse engineer records under HKLM\System\CurrentControlSet\Service\
I personally prefer sc.exe. It installs managed services just fine.

MSI not running the current version of the code in .NET Setup project

I'm not sure what happened, but my installer is in a weird state--when I install my MSI, it doesn't seem to be running the current version of the code (I'm using Custom Actions). I verified it by placing some MessageBox.Shows and sure enough, they are not popping up.
It's possible I may have had a few unsuccessful installs previously which may have put the installer in a bad state...but how do I go about resolving this?
Thanks...
If you think you are running older copies of your .msi code, the best way to resolve it is to delete all files from your %temp% directory (type "%temp%" in the windows explorer address bar and you'll see the contents of this directory and delete everything, then try again.)
You shouldn't expect MessageBox.Show to work in a .NET custom installer action. Those actions run in the context of the Windows Installer service, which doesn't run on the interactive desktop. Try logging to the event log (or any other I/O operation that doesn't depend on the current windows desktop and doesn't require an administrative or current-user security token) if you want to debug your custom action.

Categories

Resources