Command Line Options, Directives

This page is designed for advanced users: it describes how you can use HTML Executable to create and compile publications (even silently) without navigating through the steps, but with command line switches (useful for daily and automated builds for instance).

What is a switch?

All switches are specified with a forward slash and are sometimes followed by a value. Example of valid switch: /C

Please note that if you are specifying files or folders with spaces in them, you should enclose them in quotation marks.
Examples of switches: /U "C:\Program Files\My Folder" /C

Command line options to manage project files

You can indicate project files to HTML Executable thanks to the command line. When you launch HTML Executable manually (for instance with the “Run” command from the Windows Start menu), you can pass parameters to the program.

The following command line opens a project file: HEBUILD.EXE "c:\mywork\myproject\myproject.hepx".
HTML Executable will be opened and it will read the settings from the project. All you have to do is press the Compile button and the publication will be created.

HTML Executable supports some command line switches for the project files:

  • /b will load the project and show the Output page.

  • /c forces HTML Executable to compile the publication whose project file was specified.

  • /q will force HTML Executable to exit after a successful compilation.

  • /s will force HTML Executable to run silently (no progress bar).

You can of course make some combinations with the preceding switches. For example, HEBUILD.EXE "c:\mywork\myproject\myproject.hepx" /c/q/s will force HTML Executable to compile the publication silently and then exit.

Introduction to directive files

HTML Executable introduces a specific file type called “directive file“: HTML Executable’s directive files are given the extension .hed. They are text based and they contain instructions for HTML Executable in order to create a publication. Directive files are useful for external applications which need to create publications or to create automatic building processes.

How do directive files work?

Directives files work like the old Windows configuration (.ini extension) files. Below you can see an example:

; HTML Executable Directive File

; Version 1.1



[General]

Title=My publication

ProjectTemplate=c:\mywork\myproject\baseproj.hep

Output=c:\mywork\myproject\output\myarc.exe

PubType=2

DefHomepage=c:\mywork\myproject\source\index.htm

SourceFolder=c:\mywork\myproject\source  

SubFolders=1

OutputLog=c:\mywork\myproject\output\result.rtf

They contain the two following sections at least: “General” and “Source”.

The “General” section counts several parameters at this time:

  • Title (required): defines the title for the package.

  • NewProjectFile: specifies the path to the project file that HTML Executable should create when compiling the package. Leave the field blank if you do not want HTML Executable to create a project file.

  • SourceFolder: indicates the path to the source folder.

  • DefHomepage: path to the default homepage of your publication (must be in the source folder or one of its subfolders).

  • PubType (required): specifies the type of publication to create. Values: 0: Self-Extracting 1: HTML Viewer and 2: IE Browser

  • Output (required): defines the path to the executable file that HTML Executable will create (i.e. the publication filename).

  • ProjectTemplate: if you would like to build your project starting from an existing project, then specify the full path to this project file. HTML Executable will open it first, read all settings, then it will perform the changes indicated by the directive file and finally compile the publication. This property is useful if you wish to create similar publications but with different files.

  • TOCXML: full path to an external XML file with a Table of Contents template previously exported with HTML Executable.

  • SubFolders: defines whether HTML Executable should include sub-folders when adding folders and wildcards. Boolean type: 1 means true, 0 means false.

  • KeepExistingProjectFiles: if you work with the ProjectTemplate property and your project did contain files, this property tells HTML Executable whether it should keep the existing files or reset the file list when adding files specified by the directive file.

  • OutputLog: if you would like to save the compilation log to an RTF file, then specify the full path to this file.

  • StartPrompt: modify the prompt to be displayed at startup.

  • EndPrompt: modify the prompt to be displayed at end.

  • WinTitle: points to the title of the main window.

  • MainDlgText: sets the text for the main dialog box (SFX publications only).

  • FileDesc: sets the publication’s file description in the Version Information resource.

  • FileVerNum: sets the publication’s file version number in the Version Information resource.

  • ProdVerNum: sets the publication’s product version number in the Version Information resource.

  • MergeRuntime: if set to 1, then the runtime module will be merged into the publication .exe file. Boolean type: 1 means true, 0 means false.

  • ResetGUID: if set to 1, then HTML Executable generates a new GUID for the publication. This option is useful if you use ProjectTemplate.

  • GlobalPassword: optionally defines the global password for the publication.

  • ExpirationDate: optionally defines an expiration date. Must be in the following format: yyyy/mm/dd.

The “Source” section is an additional list of files that should be included. It can contain wildcards. It must be an ordered list: each entry begins with its number in the list and points to a path or a file. Allowed: single files, wildcards (e.g. *.html or *.*). HTML Executable can include sub directories when adding an entire folder: see the “SubFolders” property above.

Please note that all files from the source folder are already automatically added. You do not need to specify them with the Source section.

Example:

[Source]

0=c:\mywork\myproject\source\*.*

1=c:\mywork\myproject\readme.txt

2=c:\mywork\myproject\shared\.swf

How to execute directive files using HTML Executable

Without using the command line, select the “File|Open Directive File” menu command.

Otherwise you need to specify the path to the directive file thanks to the command line. When you launch HTML Executable manually (for instance with the “Run” command from the Windows Start menu), you can pass parameters to the program.

The following command lines will execute a directive file:

HEBUILD.EXE "c:\mywork\myproject\file.hed"

HTML Executable will be opened and it will read the settings from the directive file. All you have to do is to press the Compile button and the package c:\mywork\myproject\output\myarc.exe will be created.

In addition HTML Executable supports command line switches for the directive files:

  • /c forces HTML Executable to compile the publication according to the directive file specified previously.

  • /s will hide HTML Executable when compiling (silent compilation).

  • /q will force HTML Executable to exit after a successful compilation.

You can of course make some combinations with the preceding switches. For example, HEBUILD.EXE "c:\mywork\myproject\file.hed" /c/s/q will lead HTML Executable to compile c:\mywork\myproject\output\myarc.exe silently and then exit.


Copyright G.D.G. Software 2016. All rights reserved