This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- call a function in dll dotnet !!!!
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 26, 2007
02:04 AM
call a function in dll dotnet !!!!
Hi,
I have a basic msi project made with installshield 2008 who installs some dll dotnet, xml file and others.
I have a library CheckUserLogon who have a method CheckUser who take 3 string parameters.
this dll is in the package.
Now when i call this method in installscript with this code :
the installer fails without no message !!! i call this dll in a dialog when a user click next !if a click next i go to the end of the installation !!!!!!
Someone can tell me how i can call a method made in net in installscript !?
Thanks for all
Christophe
I have a basic msi project made with installshield 2008 who installs some dll dotnet, xml file and others.
I have a library CheckUserLogon who have a method CheckUser who take 3 string parameters.
this dll is in the package.
Now when i call this method in installscript with this code :
begin
cchbValueBuffer = 512;
nResult = MsiGetProperty(hMSI, "SOURCEDIR", szPathSupport, cchValueBuf);
szPathCompletDll = szPathSupport+"program files\\****\\****\\CheckUserLogon.dll";
MessageBox("Path complet :" + szPathCompletDll, INFORMATION );
nResult=UseDLL(szPathCompletDll);
if (nResult = 0) then
MessageBox ("UseDLL successful \n\n.DLL file loaded.", INFORMATION);
else
MessageBox ("UseDLL :"+ szPathCompletDll +" failed.\n\nCouldn't load .DLL file.", INFORMATION);
abort;
endif;
//Gets the domain
cchValueBuf = 512;
nResult = MsiGetProperty(hMSI, "WINDOMAINNAME", szWinDomain, cchValueBuf);
//Gets the user
cchValueBuf = 512;
nResult = MsiGetProperty(hMSI, "WINUSERNAME", szWinUser, cchValueBuf);
//Gets the password
cchValueBuf = 512;
nResult = MsiGetProperty(hMSI, "WINUSERPASSWORD", szWinPass, cchValueBuf);
//Test all properties
MessageBox("Domain name :"+ szWinDomain + " User name : " + szWinUser+ " Password : " +szWinPass, INFORMATION);
//Call the dll
szRet = CheckUserLogon.CheckUser(szWinDomain, szWinUser, szWinPass);
MessageBox(szRet, INFORMATION);
the installer fails without no message !!! i call this dll in a dialog when a user click next !if a click next i go to the end of the installation !!!!!!
Someone can tell me how i can call a method made in net in installscript !?
Thanks for all
Christophe
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 26, 2007
05:46 AM
If you haven't yet, perhaps see if CoCreateObjectDotNet or DotNetCoCreateObject will help; UseDLL is for C-callable DLL functions...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 26, 2007
09:26 AM
Yo Robert,
That"'s works really fine and i've use the function :
DotNetCoCreateObject
Ouf ..i'm happy one problem less 🙂
thanks for your reply and have a nice week end
Christophe
That"'s works really fine and i've use the function :
DotNetCoCreateObject
set objectUserLogon = DotNetCoCreateObject( szPathCompletDll, "CheckUserLogon.CheckUserLogon", "");
try
szRet = objectUserLogon.CheckUser( szWinDomain, szWinUser, szWinPass );
//MessageBox(szRet, INFORMATION);
if (szRet = "OK") then
....
Ouf ..i'm happy one problem less 🙂
thanks for your reply and have a nice week end
Christophe
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 26, 2007
10:45 AM
It's enough me !
I'm not on week end ..:-) !
that's work as i said but if i try to install my package on a share network with the path for example \\mycomputer\myshare ... the package can't load the dll !
i can solve the problem by copy the complete package in the computer and run again ! but how i can use the function DotNetCoCreateObject with a network path or there is a other solution !
thanks for all
Christophe
I'm not on week end ..:-) !
that's work as i said but if i try to install my package on a share network with the path for example \\mycomputer\myshare ... the package can't load the dll !
i can solve the problem by copy the complete package in the computer and run again ! but how i can use the function DotNetCoCreateObject with a network path or there is a other solution !
thanks for all
Christophe
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 30, 2007
04:13 AM
We have found why we can load the dll with a network drive !
the problem comes if you try to execute some net code in a network path \\...
the problem is the security permission of the net framework doesn't ALLOW this operation !
Have a nice day
Christophe
the problem comes if you try to execute some net code in a network path \\...
the problem is the security permission of the net framework doesn't ALLOW this operation !
Have a nice day
Christophe
![](/skins/images/04FED02024358F0FDF89E0836F432D6F/responsive_peak/images/icon_anonymous_message.png)