run c# .dll(or .exe) to validate password

Got a problem you cannot solve? Try here.
Post Reply
joao_bana
Posts: 4
Joined: Thu Feb 08, 2007 6:55 am

run c# .dll(or .exe) to validate password

Post by joao_bana »

hi,
Could anyone tell me how can i use a c# dll that just validates the password inserted during installation?

i have seen another post mencioning just running an .exe to do this but i really cant understand how they send and receive the variables in the .exe

thanks
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Just use Call DLL Function to call your DLL.

Some of the built-in sample projects make use of the Call DLL Function command with the Win32 API. Check them out.

As long as .NET is installed and your C# DLL can be called from regular Win32 apps, you will be set.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
joao_bana
Posts: 4
Joined: Thu Feb 08, 2007 6:55 am

Re: export dll function

Post by joao_bana »

ok, I did like you suggested and used the Call dll function. It seams fine but unfortunately I getting the FUNCTIONNOTFOUND error.

a little research tells me that "C# DLLs cannot be exported due to the underlying nature of .NET". In fact, Installware's help says that "The function must be available under the specified function name and use the __stdcall calling convention." which c#'s functions, I think, do not.

Can you give some more help?
Thanks once again
epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Post by epohl »

One way around this would be to put your validation procedure in a command-line .exe file, distribute it to SUPPORTDIR, and then call it via the Run Program command.

Eric
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

If you cannot support the required calling convention, Call DLL Function will not work for you. Sorry!
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply