SAMPLE: InstlDLL.exe Installs Applet and Native DLL Onto a Client Machine
ID: Q238501
|
The information in this article applies to:
-
Microsoft virtual machine
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 INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file:
InstlDLL.exe Using InstlDLL
- Run TestDLL.bat from the TestDLL folder. This batch file assumes that you have set up the path to the <SDKForJava32/Bin> 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.
- From File Explorer browse to %windir%/DownLoaded Program Files. (where windir is either winnt or windows).
- 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.)
- This sample also illustrates how to modify your .inf file to install the Native DLL both in <%windir%> as well as <%windir%/system>.
- 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.
REFERENCES
For more information on CABARC and Code-Signing, please refer to the SDK32 For Java documentation available on the Microsoft Technologies for Java site.
For more information about constructing an .inf file to download native code, please refer to Component Development available on the Microsoft Web Workshop and the Platform SDK documentation found on the MSDN Online Library.
Other great references on the MSDN Web Workshop:
For additional information on how to make your java code trusted under Internet Explorer, click the article number below
to view the article in the Microsoft Knowledge Base:
Q193877 HOWTO: Make Your Java Code Trusted in Internet Explorer
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
Additional query words:
cabarc, Java Package Manager
Keywords : kbfile kbsample kbGrpJava kbDSupport kbSDKJava320
Version : WINDOWS:
Platform : WINDOWS
Issue type :
|