Error with Windows Installer ... "Unable to get installer types"

I got an error when using Windows Installer to set the event source in the product that I am deploying.

The error message I get contains the following ...

Unable to get installer types in c: \ temp \ program.exe. β†’ Failed to load one or more of the requested types. Check out the LoaderExceptions property for more info.

Here is the code block that the event source installer creates ...

using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration.Install; using System.Diagnostics; namespace myapplication { [RunInstaller(true)] public partial class EventSourceInstaller : Installer { public EventSourceInstaller() { InitializeComponent(); string eventSourceName = "MyAppSourceName"; if (!EventLog.SourceExists(eventSourceName)) { EventSourceCreationData data = new EventSourceCreationData(eventSourceName, "Application"); EventLog.CreateEventSource(data); EventLog.WriteEntry(eventSourceName, "Source Added."); } } } } 

In the installer project, I added a custom installation action called "Initial Output from MyApplication (Active)" to start the event source installer.

I have the following questions:

  • Does anyone else run into this and what is the problem?

  • How do I restore the installer's LoaderExceptions property?

+4
source share
3 answers

I have never seen this error, but the path c: \ temp \ program.exe is very strange. Are you trying to run the installer from the c: \ temp \ directory?

Are you sure that the results of all projects and all third-party DLLs that you use are included in the deployment project? Click on all included files in the deployment project and check their SourcePath property; Are they the source source files and not the destination output folder? Not a temporary folder?

+2
source

The "detected dependencies" of your installation project are not updated. In my case, the dependency update does not work. Due to the addition of dll to the project project dependencies, the visual studio updated them all. After restoring the installation project, the error no longer repeated!

+2
source

I had exactly the same problem.

I assume that your program references other DLL files that the installer installs in the GAC or somewhere else outside the application directory. You cannot expect these DLLs to install before your installation action starts.

Decision. Create a separate DLL for your installation action and make sure that the DLL does not reference other DLLs (directly or indirectly) that are not installed inside your application folder.

By the way, if you can, switch to another technology. I don’t know which competitors are better, but if you do non-standard things, the VS installation project will cause you nothing but trouble.

+1
source

All Articles