2011年7月14日 星期四

Internet Component Download - INF File Architecture

Introduction

An information file (.inf) provide the installation instruction for IE to setup and register your software distribution. It consists of any number of name section. And each section can have multiple items.

Each section will have its own predefined purpose, such as updating the registry, executing a command, copying some file, etc.

Main Sections of an INF File in Internet Component Download:

  • [Add.Code]
    This section lists all the files to be installed, including optional files
    [Add.Code]
    filename1=section-name1
    filename2=section-name2

  • [Setup Hook]
    This section lists all hook that will be executed before setting up files in [Add.Code] section.
    [Setup Hooks]
    hookname1=section-name4
    hookname2=section-name5
    [hookname1]
    run=extrac32.exe /e /a /y /l c:\MyApplication\client MyApp.cab

  • [Version]
    For compatibility, the following lines must be added if we use hooks
    [Version]
    Signature="$CHICAGO$"
    AdvancedINF=2.0

  • [DefaultInstall]
    Installation section that is executed by default. Contains pointers to other sections specifying files to copy and delete, registry updates, .ini file updates, and so on. (for full list of pointer and the systax of this section please refer to here)
    In this post we will just talk about AddReg. AddReg pointer point to a section for adding subkeys or value names to the registory, optionally setting the value.

    [DefaultInstall]
    AddReg=AddRegSection
    [AddRegSection]
    HKLM,Software\MyApp,ProgramName,,"My Application"
    HKLM,Software\MyApp,"Program Location",,"%25%\MyApp.exe"

  • [Strings]
    Defines one or more strings keys. The Installer expands the strings key to the given string and uses it for further processing. You must enclose a strings key in percent signs (%).

    [String]
    String0=”MyApplication”
    String1=”Read me”


    Reference:
    Setup Information File (.inf) Definition
    About INF File Architecture

    沒有留言:

    張貼留言