-1

I am creating a C# CustomAction DLL from which I have to use another DLL that is not (yet) installed on the target system, but included in my installer.

How will I be able to use this DLL in my C# CustomAction?

The reason is that I have to check whether the provided credentials are accepted by the Web service this DLL hooks into before I write the credentials into web.config and encrypt web.config.

Alexander
  • 19,906
  • 19
  • 75
  • 162
  • 1
    Since the dll is included in your installer, after the installation the dll will be stored in the client's machine. So you custom action dll could have the ability to use this dll. Am I wrong anywhere in my argument? – Christos Jul 22 '14 at 13:11
  • The custom action is to be executed _before_ any changes are made to the system. – Alexander Jul 22 '14 at 13:25
  • Try this option `/LoadDllFromFileBeforeTheFileExists` and if that doesn't work you could give `/HaveCakeAndEatIt` a go. In other words, your expectations seem to me to be unrealistic. Save the DLL to a temp location and load it from there. – David Heffernan Jul 22 '14 at 13:35
  • You think my expectation that I could call a DLL that is inside the installer package after the installer has started, but before the content of the installer package is put into the appropriate directory, is unrealistic? The Library DLL would possibly exist somewhere, since the CustomAction DLL does also exist somewhere... otherwise it couldn't have been loaded, right? – Alexander Jul 22 '14 at 14:38

2 Answers2

1

You could always try this - seems to be what you're looking for, a way to get the Dll and call it without installing it:

http://www.codeproject.com/Articles/528178/Load-DLL-From-Embedded-Resource

PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

I think you can go to the DLL Properties and set Copy To Local = true. By default is false.

Nahum Fabian
  • 180
  • 1
  • 2
  • 15