Question

I can't seem to find the solution I'm looking for in the similar questions, but that might be because of my lack of searching skills.

Either way, I have a using System.Runtime.InteropServices; in my C# project which I use to unzip a downloaded .zip file.

My problem arises from the following: I hate installers... Thus I need a way to include the Interop.Shell32.dll file into the .exe which is located in the project's \bin\Debug folder.

Thus avoiding the need for an installer which adds the Interop.Shell32.dll into the program's path and avoiding the need for an extra file download along with the .exe if I don't use an installer.

What would be the best/most efficient way for me to do so? (Preferably without having to include a load of extra code into the program)

Was it helpful?

Solution

There are several useful tools; I'm not exactly sure what is being sought, so I will provide a small listing of tools/approaches that I use.

  1. ILMerge for merging multiple managed assemblies such as the project output and external assemblies/PIAs. Make sure the PIA/assembly being merged is allowed to be distributable as such or see #3.

  2. Embedded resources for including "external data" including non-managed DLLs which might be external requirements for managed assemblies. These non-managed DLLs/COM libraries can be bound/loaded at runtime after extraction.

  3. dotNetInstaller for making a unified launcher/installer (it is a bootstrap and can provide embedded resources). This can be used in conjunction with a normal MSI (VS Setup Project) installer to handle prerequisites such as installing official distributable packages or it could simply be used to launch the executable (no "installer" except those for prerequisites).

OTHER TIPS

You can use ILMerge. Taken from the Microsoft webpage:

ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top