Microsoft SDK for Java

Creating a .inf File

Use the Master.inf file in the %SDKDIR%\Readmes directory as a template for creating a .inf file. The Master.inf file is heavily commented and includes placeholders for required information.

To create your .inf file

  1. Make a copy of the Master.inf file, give it a new name, and open it for editing.

  2. Include the name of the inner cabinet file that contains your classes. Replace CabFileName.cab with your class cabinet name in the following line:
    run=extrac32.exe /e /a /y /l %49000% CabFileName.cab
    
  3. Include the name of the .inf file that you are using. Replace Master.inf with the name of your .inf file as indicated in the following code example:
    [hook2]
    
    ; Change the name of master.inf to the name you are assigning this
    ; file. Leave the second line alone.
    
    InfFile=master.inf
    InfSection=RegistryData
    
  4. Include a unique ClassId, generated by running Guidgen.exe from the %SDKDIR%\Bin directory. The following code excerpt from the Master.inf template file sets the identifier:
    [Strings]
    ; Running guidgen in the SDK generates the ClassId you need to fill
    ; in here. This classId also goes in the OBJECT tag.
    ; Don't forget the set braces!
    
    ClassId="{99999999-9999-9999-9999-999999999999}"
    
  5. Include the name of your libraries. The following code excerpt from the Master.inf template file sets the library name:
    ; Put the name by which your packages should be referred to
    ; (for example, "My Text Viewer") here.
    
    PackageName="name"
    
  6. Decide whether to place the libraries in the \Lib or \TrustLib directory. In the .inf file, find the lines that determine whether the libraries are placed in the %Windir%\Java\Lib or %Windir%\Java\TrustLib directory and comment out the line that does not apply. The following code sample shows the default that is in Master.inf:
    ; If you use one of these, you will use exactly one.
    
    HKLM,"SOFTWARE\Classes\CLSID\%ClassId%\InProcServer32","Lib",,
    "%49000%"
    ;HKLM,"SOFTWARE\Classes\CLSID\%ClassId%\InProcServer32",
    "TrustedLib",,"%49000%"
    
  7. Optionally, you can also include the following information:

.inf File Example

The following code excerpt shows the mandatory edits made in a .inf file called Sample.inf:

[hook1]

; In this line, replace CabFileName.cab with the inner .cab file name
; that contains your classes.

run=extrac32.exe /e /a /y /l %49000% MyClasses.cab

[hook2]

; Change the name of master.inf to the name you are assigning to this
; file. Leave the second line alone.

InfFile=Sample.inf
InfSection=RegistryData


[Strings]
; Running Guidgen in the SDK generates the ClassId you need to fill
; in here. This classId also goes in the OBJECT tag.
; Don't forget the set braces!

ClassId="{4439E200-6FCC-11d0-89AA-00A0C9054129}"

; Put the name by which your packages should be referred to
; (for example, "My Text Viewer") here.

PackageName="My Sample Java Classes"

© 1999 Microsoft Corporation. All rights reserved. Terms of use.