Microsoft KB Archive/238501

= SAMPLE: InstlDLL.exe Installs Applet and Native DLL Onto a Client Machine =

PSS ID Number: 238501

Article Last Modified on 4/22/2003

-

The information in this article applies to:


 * Microsoft virtual machine

-



This article was previously published under Q238501



SUMMARY
InstlDLL.exe illustrates how to install Java classes and a native dynamic-link library (DLL) onto a client machine.

The sample contains two projects:
 * InstlDLL is the C DLL project built using Visual C++ 6.0. This contains a single method that displays a string.
 * TestDLL is the Java project built using Microsoft SDK for Java 3.2. This includes TestDLL.java that calls the C DLL created in the Step1 method using J/Direct. The TestDLL project contains the following files:
 * TestDLL.bat is the batch file that contains the commands to cab and sign.
 * TestDLL.html is the HTML file that loads the native DLL and the applet.
 * InstlDLL.inf is an .inf file that contains information regarding where you want to install the native DLL on the local computer.
 * InstlDLL.osd is the modified .osd file that installs Java classes into the Java Package Manager, JPM, and points to InstlDLL.inf to install the DLL.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

InstlDLL.exe

Using InstlDLL

 * 1) Run TestDLL.bat from the TestDLL folder. This batch file assumes that you have set up the path to the  folder correctly. Once the batch file succeeds, it displays a Test Certificate asking whether you want to install and run the Installcab.cab, which contains the signed applet native DLL. Select Yes. The applet displays a Hello Message window. The test certificate does not appear for any subsequent loading of this applet.
 * 2) From File Explorer browse to %windir%/DownLoaded Program Files. (where windir is either winnt or windows).
 * 3) The Friendly Name, InstlDLL Friendly Name, appears under the Program File column. This shows that the Install.cab file was successfully installed into the JPM. (Refer to InstlDLL.osd and InstlDLL.inf to see how the Friendly Name is used.)
 * 4) This sample also illustrates how to modify your .inf file to install the Native DLL both in <%windir%> as well as <%windir%/system>.
 * 5) The key in getting the native DLL to install on the local computer is to use an .inf file to specify where you want the native DLL to be placed, as well as write an .osd file that points to this .inf file. Then you create an installcab using cabarc that includes this .inf file, .osd file, and Nativedll.dll file, and signs it with LowX permission. For more details, please refer to the Instldll.inf file, Instldll.osd file, and the Installcab.cab file in the TestDLL folder.

