Use the INF file from the Internet to download components

xiaoxiao2021-03-06  43

Use INF and OSD files from Internet Download components

As a system service, IE downloads from Internet components often require authentication and inspection. For publishers, there are two mechanisms:

1, INF file release

2, OSD file release (IE4 and later)

It is recommended to use CAB to package all the required files and sign. IE After receiving a CAB file:

First look for whether there is an OSD file, if there is, follow the OSD syntax (XML document). The INF file is also turned on if involved in the INF file.

If there is no existence, the INF file is turned on, and the installation is explained according to the INF file.

CodeBase property

Publishing components on the Internet, extremely important attributes are the codebase properties because this URL specifies where all files needed for a "picky" component run from which to get.

Component developers can package the components in the following ways:

. The PE format (.exe .ocx .dll ...), the advantage is that the file is a placement operation, but the file will not be compressed, downloaded by http.

. INF file. This mode is only low in the browser security setting, and the reason is that the single INF file cannot be signed. The syntax of INF can point to some diverse executables.

. CAB file. All required files are packaged into a compressed file, which can be signed.

INF file format

INF syntax is downloaded and processed by the Internet download component.

All URLs must be overrlencode, that is, spaced by a% 20, and the URL in CodeBase = is interpreted as a base address.

Code downloader understands several of these major fees

[Add.code] and [setup hooks]

If the two sections do not exist, then explain as a standard Win32 INF format.

The Add.code section lists all files that will be installed, including optional files.

[Add.code]

FILENAME1 = Section-Name1

FILENAME2 = Section-Name2

Each file has a section (Document Festival) and describes the installation properties separately.

[section-name1]

Key1 = Value1

Key2 = Value2

In a file section, the following keywords are available:

File-% OPERSYS% -% CPU% = [URL | ignore | thiscab]

% OPERSYS% can be [Win32 | Mac], the current% CPU% can be [x86 | PPC | MIPS | Alpha].

File = [URL | thiscab]

Indicates that the file can be downloaded in those places. If there is no set value and the file does not load the user's computer, the download failed.

FileVersion = a, b, c, d

File version definition

CLSID = {NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN}

Component's CLSID

Destdir = [10 | 11]

Destdir can be set to 10 / Windows Directory

11 Windows / System Directory.

If there is no set value, save in the cache directory

RegisterServer = [Yes | NO]

Whether you register the component you will overwrite the other on the registration settings.

Hook = section-name3

Define conditional hooks. If the minimum version of the CLSID or file does not match and no file = or file-% OPERSYS% -% CPU% = VALUES entry, the installer looks for customized hooks. The hook festival is defined as follows: [section-name3] key1 = value1

Key2 = Value2

You can hang the same hook in multiple components.

The following keys are available:

FILE-% OPERSYS% -% CPU% = [URL | ignore]

File = [URL]

Run = [cmd-line]

Expand the name running after the Temporary folder for the CAB file. If this command is missing, you will look for infile = and infsection = keys to run the hook festival.

Inffile = [Name of Win32 Inf File Inside TEE CAB] can be other INF files in the CAB file

Infsection = [section name in the inffile exerciseed in Above Key]

Unconditional Install Hook specified in the [Setup Hooks] section and executed before the Add.code section.

[Setup hooks]

hookname1 = section-name4

hookname2 = section-name5

If you want to use the HOOK section, you need to specify that the version is as follows (otherwise the download component service will ignore):

[Version]

Signature = "$ chicago $"

Advancedinf = 2.0

Example analysis is finally given.

Internet component download service

The Internet component download service is exported by a single function: COGETCLASSObjectFromurl. This function downloads application code, check and install OLE components, and implemented by IE

The CogetClassObjectFromurl function returns a factory object for a given RCLSID. If there is no CLSID (CLSID_NULL), this function is selected according to the CONTENTTYPE MIME type. If the object is already installed, instantiate, otherwise, download the necessary code from the specified URL or the Internet Search page.

Download and Install Process Processing The following steps:

Use the URL Moniker (s) to download the necessary code.

Call WinverifyTrust to confident that all download file installation is safe

All self-registration components complete registration

Add a registration item for the tracking of the downloaded components

Use RCLSID to call CogetherClassObject

Under normal browser settings, the necessary parameters are obtained directly through the HTML Object element. Example: For a tag "codebase = http://www.foo.com/bar.ocx#version=a ,b, c", szcodeurl is "http://www.foo.com/bar .ocx ", dwfileversionms is Makelong (B, A), DWFileVersionls is Makelong (D, C).

Storage / cache download code

The downloaded code is stored in Windows / Occache .. This location can be overwritten by the HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Internet Settings / ActiveXcache value of the registry. Some components are installed in / windows and / windows / system.. All jurisdictions are registered in a new "Module Usage" Registry to keep track of this code. The downloaded code cannot be automatically deleted but can be removed by the user through the control panel. Internet Search Path

When the Internet component download calls download code, it traverses the Internet search path to find the referenced components. The path here is a list of object-owned servers and is called by GetClassObjectFromurl. Even if the tag does not specify a CodeBase download OLE control, the Internet component download service will still use the Internet search path to find the necessary code.

Internet search path syntax

Search path storage in Registry HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Internet Settings / CodeBaseSearchPath., As follows:

CodeBaseSearchPath = ; ; ... ; codebase; ;

... ;

Every URL is an absolute path, searched in turn, follows the SzcodeURL specified by CodeBase.

Specific variables in Win32 INF syntax:

EXTRACT_DIR

Cap files after the CAB file

Run =% extract_dir% / mysetup.exe

Object_dir

Downloaded Program Files Directory / Windows Directory under Windows.

An example of an Internet INF.

Through the Terminal Services service, we can control the remote computer, in addition to the remote connection manager, we can also publish the ActiveX control in a web, this control information is: http://msdn.microsoft.com/library/default .asp? url = / library / en-us / termserv / termserv / Embedding_the_remote_desktop_activex_control_in_a_web_page.asp

The Internet release INTERNET release INF file is as follows:

; Inf file for terminal server Web client comment; beginning

[Version]; Determine the version, otherwise the download service does not recognize the content

Signature = "$ chicago $"

AdaNCedinf = 2.0

[Add.code]; Install festival, tell us that this INF file is definitely known as msrdp.ocx

MSRDP.OCX = MSRDP.OCX; this INF file is installed only one component

[msrdp.ocx]; Add.code section designated

FILE-WIN32-X86 = thiscab; file in the current CAB file

CLSID = {9059F30F-4EB1-4BD2-9FDC-36F43A218F4A}; component CLSIDFILEVERSION = 5, 1, 2600, 1094; file version

RegisterServer = YES; whether to register the component, register the component

[Setup hooks]; unconditional hook, this section specifies how many unconditional hooks, only one

Addtoreghook = Addtoreghook

[Addtoreghook]; unconditional hanging hook festival

Infding = msrdp.inf; read information from MSRDP.INF

Infsection = defaultInstall; Specify standard installation file

[DefaultInstall]; Sections need to be explained according to the installation file

AddReg = addimeregentries; looking for the AddImeRegenTries section

[AddImengntries]; in accordance with the AddReg class in the standard INF file to explain this section

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "MSIME95.IME", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "MSIME97.IME", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "Imejp98.ime", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "Imejp.IMe", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "IMJP8.IME", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / JPN", "IMJP81.IME", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / KOR", "MSIME95.IME", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / KOR", "MSIME95K.IME", "NULL"

HKLM, "Software / Microsoft Table / Kor", "Msuni95k.ime", "Null" HKLM, "Software / Microsoft / Terminal Server Client / Ime Mapping Table / KOR", "IMEKR.IME "," NULL "

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / KOR", "Imekr98u.ime", "NULL"

HKLM, "Software / Microsoft / Terminal Server Client / IME MAPPING TABLE / KOR", "Imekr61.ime", "NULL"

转载请注明原文地址:https://www.9cbs.com/read-76432.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.054, SQL: 9