Lynx Exploration Archivist Online Help

Program: FileReg

Title: Register LEA File Types

Version: 1.8

Introduction

The FILEREG utility can be used to register file extensions used by Lynx applications with associated icons and double-click/context menu actions in Windows Explorer. It will also register ActiveX/COM Servers required for some Lynx applications.

FILEREG reads its INI file to retrieve a list of file extensions, icons, actions and COM Server file names to register with Windows. FILEREG will also search the its containing folder for other INI files with the type=package in the [lynx] section. Items are displayed in two list views - the upper list view displays the file extensions and their associated actions, the lower list view shows the COM servers that will be registered. Each file extension can have one or more associated actions, which will be displayed in the context menu shown when the file is right-clicked in Windows Explorer. The first action shown for each file extension will be performed when the file is double-clicked. Click the Register button to update Windows with the file information displayed.

The files referenced in the INI files need not include full path specifications (see Configuration below). This allows the LEA system to be deployed on client machines on a network where the path to the LYNXSYS directory may vary without running an installation script on each client


Configuration

FILEREG will search for INI files in the LYNXSYS folder which list file extensions to be registered, and COM server files to be located and registered. Any INI file containing type=PACKAGE in the [lynx] section will be parsed for the following sections:

[register_extension]
ext=type
	 

This section lists the extensions to be registered.
ext is the file extension to register (including the leading dot) and type is a name used to identify the file extension - this should contain no spaces. Different extensions can use the same type identifier, which is used in the INI sections described below to link the file extension to an icon and actions. For example, file extensions .tr1 and .tr2 both refer to Lynx Trace Files.
The INI section to register the basic files used by Lynx LEASSV system could look like this:

[register_extension]
.sv4=SV4_File
.tpx=TPX_File
.tr1=LynxTR_File
.tr2=LynxTR_File
.tr3=LynxTR_File
.tr4=LynxTR_File
.tr5=LynxTR_File
.tr6=LynxTR_File
.tr7=LynxTR_File
.tr8=LynxTR_File
.tr9=LynxTR_File
		

[register_description]
type=description
    

This section lists the description for each file type that is displayed in the 'Type' column of the details view in a Windows Explorer window.
The type must match one of the values from the [register_extension] section above. The description should be a user-friendly short description of the file type. For the LEASSV example above, this section could look like this:

[register_description]
SV4_File=SSV Parameter File
TPX_File=TRCPLOT Parameter File
LynxTR_File=Lynx Trace File
		

[register_icon]
type=exefile,index
	 

This section lists the icon displayed for the file type in Windows Explorer. exefile is the name (or path) of the .exe, .dll, or .ico file that contains the icon. The index is the number of the icon within the file. If the full path of the file is not specified here, FILEREG will search for the file in the following locations:

  1. The directory containing FILEREG.EXE
  2. FILEREG's current directory - usually the same as (1) above
  3. The Windows 32bit SYSTEM directory directory (C:\WINDOWS\SYSTEM32 on Windows 2000/XP and 32bit Windows Vista and 7; or C:\WINDOWS\SYSWOW64 on 64bit Windows Vista or 7)
  4. The Windows NT/2000/XP 16-bit SYSTEM directory
  5. The WINDOWS directory
  6. The directories listed in the PATH environment variable
  7. The LYNXSYS directory (specified in LEASTART.INI) - usually the same as (1) above

If the file cannot be found in any of the above locations, the registry keys under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths will be searched to determine whether the named file is an installed executable.

If the file is found, the filename will be expanded to its full path.

For the LEA example above, this section could look like this:

[register_icon]
SV4_File=SETPARMW.EXE,0
TPX_File=SETPARMW.EXE,0
LynxTR_File=TRCFIX.EXE,0
      

[register_action]
type=action_description|command,action_description|command,...
    

This section contains the actions that will be displayed by the context menu that appears when a file with the registered extension is right-clicked in Windows Explorer.
Each action_description -command pair are separated by a vertical bar. action_description is the caption that will appear in the context menu. The first action is the default action that will be performed when the file is double-clicked.
command is the command line to execute for the action. The file on which the action is to be performed (ie the double-clicked file) should be referenced as "%1" - always ensure that the quote marks are present as these are required if the file path includes spaces. As with the icon definition above, the executable file will be expanded to its full path by searching in the directories listed above. A number of actions can be defined - separate multiple actions with a comma.

For the LEASSV example above, this section could look like this:

[register_action]
SV4_File=Edit|SETPARMW.EXE -pSSV "%1"
TPX_File=Edit|SETPARMW.EXE -pTRCPLOT "%1"
LynxTR_File=Open in TRCFIX|TRCFIX.EXE "%1",View in SEISVIEW|SEISVIEW.EXE "%1"
      

[register_com]
n=servername
    

This section is independent of all the above sections. It contains the file names of COM servers to locate and register on the local machine. COM servers are specialised DLL files that allow more complex communication and interaction with modern Windows programs.
n is a number. The value of n is not important, as long as each entry in the section has a unique value.
servername is the file name of the COM server. If the full path of the file is not specified here, FILEREG will search for the file in the following locations:

  1. The directory containing FILEREG.EXE
  2. FILEREG's current directory - usually the same as (1) above
  3. The Windows 32bit SYSTEM directory directory (C:\WINDOWS\SYSTEM32 on Windows 2000/XP and 32bit Windows Vista and 7; or C:\WINDOWS\SYSWOW64 on 64bit Windows Vista or 7)
  4. The Windows NT/2000/XP 16-bit SYSTEM directory
  5. The WINDOWS directory
  6. The directories listed in the PATH environment variable
  7. The LYNXSYS directory (specified in LEASTART.INI) - usually the same as (1) above

If the file cannot be found in any of the above locations, the registry keys under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths will be searched to determine whether the named file is an installed executable.

If the file is found, the filename will be expanded to its full path.

An example section could look like this:

[register_com]
0=leaobcom.dll
1=mapcom.dll
		

The FILEREG.INI file can contain these sections, as well as an extra section which lists other INI files containing registration instructions:

[register_packages]
index=ininame
    

index is a number, and ininame is the name of an INI file
For example:

[register_packages]
0=LEAVIEW.INI
1=LEASSV.INI
		

Each INI file will be searched for in the standard LEA directories. If the INI file cannot be found, it will be ignored, and a message written to the log file FILEREG.TXT in the user's CUSTOM directory.

It is possible that different INI files may define conflicting actions for the same file extensions (eg LEAVIEW - open TR files with SEISVIEW, LEASSV open TR files with TRCFIX)
Each INI file may contain a [register_defaults] section which can be used to define the default double-click action for file extensions used in more than one INI file.

[register_defaults]
type=default
      

type is a file type defined in this INI file, and default is a keyword. This specifies that the first action defined in this INI file for this type will be the default action, and actions defined for files with the same extension in other INI files will be available on the context menu, but not as the default double-click action. If there is no [register_defaults] section, or a type is not included in it, then the default action will be determined by the order of the INI files in the [register_packages] section

Errors encountered in parsing the information in FILEREG.INI are displayed to the user (see the error messages below), and written to the log file FILEREG.TXT in the user's CUSTOM directory. Errors encountered while reading the INI files listed in the [register_packages] section are not displayed to the user, but are written to the log file.


Error Messages

The following errors may be displayed during program startup, while FILEREG is reading the list of file extensions, icon files, actions and COM servers from its INI file.

Type description/icon/action count mismatch

The INI sections [register_description], [register_icons] and [register_action] must contain the same number of entries. Each type listed in these sections is a value from the [register_extension] section which lists the file extensions to register.
See Configuration above.

Extension has invalid type

The type string listed for the named extension is invalid.
See the description of the [register_extension] section above

Type has no description

The description for the named type is missing from the INI file section [register_description].

Type has no icon defined

The icon definition for the named type is missing from the INI file section [register_icon].

Icon not found in file

The specified file is not an EXE, DLL or ICO file, or the index number of the icon is invalid. See the [register_icon] section

Type has no defined actions

The named type has no entry in the [register_action] section of the INI file. This section defined what will happen when a file of this type is double-clicked in Windows Explorer.

Type has invalid action name

The named type has a bad entry in the [register_action] section.

Type has invalid action command

The named type has a bad entry in the [register_action] section.

Executable file not found

The named executable file, listed in either the [register_icon], [register_action] or [register_com] section, could not be found in any of the system's default locations (see above for the list of directories searched). Either the file is not installed or accessible from this machine, or is installed in a non-standard location. If necessary, you can add a relative path specification to the file name in the INI file to make the path relative to one of the standard search directories.

File is not a COM server

The named file is not recognised as a COM server (see the [register_com] section of the INI file, above. The additional text in the error box will give more indication of the reason for this.

You do not have administrative privileges to write to the registry

On Windows 2000 and XP, you may have to log in as ADMINISTRATOR, or contact your network administrator to run this utility.

Exception

An unspecified exception occurred. The error message will give some indication of the cuase or problem. Contact Lynx with details of the error.


Copyright © Lynx Information Systems Ltd 2013