Associating file extensions

Author: BitRock Support       Date: May 16, 2008 02:12       Tags: Installation
Actions
Windows

This action allows you to create file associations for Windows, defining commands such as "open" for a given file extension.

Properties:

  • icon: Path to the icon file that contains the icon to display.
  • friendlyName: Friendly Name for the progID.
  • commandList: List of commands that can be invoked on each given file type.
  • extensions: Space-separated list of extensions for which the given commands will be available.
  • progID: Programmatic Identifier to which the extensions are attached, contains the available commands to be invoked on each file type.
  • mimeType: MIME type associated to all the file extensions.
Supported Platforms: Windows.

Example:
<associateWindowsFileExtension>
    <extensions>.ext</extensions>
    <progID>mycompany.package</progID>
    <icon>${installdir}\images\myicon.ico</icon>
    <mimeType>example/mycompany-package-ext</mimeType>
    <commandList>
        <!-- Defining the "open" command -->
        <command>
            <verb>open</verb>
            <runProgram>${installdir}\yourprogram.exe</runProgram>
            <runProgramArguments>"%1"</runProgramArguments>
        </command>
    </commandList>
</associateWindowsFileExtension>

For the <runProgramArguments> tag, you can use the following wildcards:
  • %1 : is replaced by the short name of the file being executed
  • %L : is replaced by the long name
  • %* : is replaced by the name of any arguments to the file
Note:
Be careful when using %L. Eventually, any quotation marks in the value of %L are stripped off and the argument passed to the command may contain file names with spaces. Such file names can cause problems with some commands. If this is a concern, you should use %1 instead of %L.

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up