View Single Post
Old 23rd October 2015, 09:43   #101
Jamesn_xD
Junior Member
 
Join Date: Oct 2015
Posts: 2
Question

Hi all,

I have a little Problem with this issue.

Quote:
Another issue is that if want to call a .NET dll from your .NET dll, you will find that the installer cannot find the second .NET dll. For the moment the remedy is to wrap your installer in another installer. This other installer should place the .NET dlls in the same directory as the installer will run from. When the installer runs, the .NET dlls can now be found. There will only be distributed one setup file.
I have written a dll in C#, which makes changes on a .config file. In my dll, i use System.xml.dll.

If i have understood the solution correctly, the system.xml.dll must be in the same directory which the Installer.exe. But this isn't working by me.

This is my own dll: (for testing i have only one line)

code:
public void WriteConfigFile(string path, string datasource, string dbName, string user, string pw)
{
XmlDocument doc = new XmlDocument(); //needs System.xml.dll
}



And here is my call in the NSIS script:
code:
Section "Test Write" SEC01
SetOutPath $INSTDIR
File "Test Data\InvoiceConfigurator.exe.config"
InitPluginsDir
SetOutPath $PLUGINSDIR
File "WriteConfigFile.dll"
File "system.xml.dll"
CLR::Call /NOUNLOAD "WriteConfigFile.dll" "WriteConfigFile.WriteClass" "WriteConfigFile" 5\
"$INSTDIR\InvoiceConfigurator.exe.config" "test" "test" "testuser" "testpw"
pop $0
MessageBox MB_OK $0
SectionEnd



The NSIS scipt, Installer, WriteConfigFile.dll and System.xml.dll are in the same folder.

Here is a Screenshot of the Error MessageBox:
https://www.dropbox.com/s/o0lvmvtezp...issue.PNG?dl=0
Message in english means: "Exception has been thrown by the target of an invocation."

I hope anybody can help me!

Thanks in advance
Jamesn_xD is offline   Reply With Quote