1

I am trying to create a program, allowing silent installation of important updates for Windows. I want it to be a single .exe file, without any additional files, libraries, icons etc. I am using .Net 3.5. I included wuapi.dll to the References folder of my project. After compilation wuapi.dll is copied to the same folder, where goes .exe file (Debug or Release).

I've read different articles about usage of ILMerge for embedding .dll files directly into .exe file. And here is my question - all the Windows computers have wuapi.dll in system32 or SysWow64 folders, so why should I embed it into my project? Is there a way to make a reference to these libraries or use their functions without adding them to project at all?

Sergey Dudkin
  • 169
  • 1
  • 10

1 Answers1

1

On the References, select the wuapi and set the property CopyLocal to false. Also, make sure that the SpecificVersion is set to false, otherways it may not work with whatever version is installed on the user machine.

I would assume that wuapi can be found in any Windows version since XP.

This only works on .Net 4.0 on by setting "Embed Interop Types" to true. On .Net 3.5 you don't need to deploy the wuapi.dll itself but you need to deploy the generated Interop file.

For more info check: http://blogs.clariusconsulting.net/kzu/check-your-embed-interop-types-flag-when-doing-visual-studio-extensibility-work/

Bruno Marotta
  • 443
  • 5
  • 12
  • Thanks for your answer! That was idea of my question from the very beginning - to make application without embedding generated Interop file in .Net 3.5. – Sergey Dudkin Apr 09 '15 at 13:29