htmlHost

htmlHost combines an instance of the Internet Explorer rendering engine with a localhost web server to allow for testing and review of web pages and applications without moving the files to a dedicated web server. htmlHost can serve files either directly from the filesystem or from a ZIP-format archive. Version 3 includes a new version of the web server redesigned for improved performance and also supports both the newer PKZip 4.5 format and the old PKZip 2.0 format for .ZIP files.

htmlHost has no installation requirements under Windows 2000 (SP4 or higher) or newer. You can copy it to a CD or DVD and distribute it.

Download (version 5.0 build 0779, released 13 May 2019)

More Information

This page is excerpted from version 5.0 build 0779 of the htmlHost application.  Some material has been reformatted to fit the display.  Links to htmlHost functionality will not work.  Run the application without arguments and without a default file (hold down SHIFT on startup, if necessary) for the latest version of the complete document.

changes

This build includes the following changes:

Version 5.x includes the following changes:

purpose

htmlHost combines an instance of the Internet Explorer rendering engine with a localhost web server to allow for testing and review of web pages and applications without moving the files to a dedicated web server.  htmlHost can serve files either directly from the filesystem or from a ZIP-format archive.  Starting with version 4, htmlHost can also act as a runtime hosting utility for content developed in the Impression Content Creation Tool.

how serving works

When the viewer receives a request to display a file, whether from initialization (from a command-line parameter or locating the default file) or by drag and drop, the server switches the path it is serving to one appropriate for the file.  If the file request contains an absolute path, it is used; otherwise, the path of the application is used.  The ServeFromRoot parameter is used to determine how much of the absolute path is available.  The now fully-qualified file reference is converted to a localhost-based URL, and the viewer is instructed to request this URL instead (cancelling the filesystem request).  Localhost-based requests are processed by retrieving the file from the appropriate folder and returning it.

If the server is using a ZIP-format archive as its filesystem, localhost requests are served by extracting the appropriate file from the archive and passing the file data back to the requester.

usage

To bypass file detection/load (and display this screen), hold the <SHIFT> key down on startup.  This screen can be displayed at any time by navigating (in the viewer window) to about:htmlHostClick here to create an internet shortcut in the application directory that can be dropped onto the viewer window.

startup files

htmlHost can serve and display a file immediately on startup.  If a directory is passed as an argument, it is used, otherwise, the application's directory is used.  The initial directory is examined for the following files, in order:

Where [appname] is the current name of the htmlHost executable (in the case of this instance, these files would be  #appname#.zip, #appname#.html, and #appname#.htm).

If ZIP support is enabled, and a ZIP archive is loaded (either by finding [appname].zip or by passing a valid archive on the command line, htmlHost looks for a suitable file to display by searching the root of the ZIP archive for the following files, in order:

If no suitable startup file can be found, the viewer window will display this screen.  If UseExternalBrowser is true, and no startup file was found, the external browser is not launched.

default files

When the serving root directory changes (by dropping a ZIP-format file or a directory reference onto this window), htmlHost will look for the default file as described above in the root of the directory or archive.  When a request for a folder is received, htmlHost will try to serve one of the default files.  If no default files can be found, the server will return HTTP 403 FORBIDDEN.

If a request for a directory is received without a trailing slash character, the server will return HTTP 301 MOVED PERMANENTLY, and return the directory name with a trailing slash as the new location.

autorun

If you're distributing content with htmlHost on a removable disk, you can create an autorun.INF file that will automatically start htmlHost (and display your web pages).  Click here to create a basic autorun.INF file in the application directory.  For more information about autorun entries, visit the Microsoft web site.

redistribution

If unzip support is not required, htmlHost has no additional dependencies under Windows 2000 SP4 or higher; and is freely redistributable.  Simply copy the file to a CD- or DVD-ROM, flash drive, network share, or local folder and run.

If unzip support is required, htmlHost requires the Xceed Zip Compression Library file xceedzip.dll.  This file must be in the same directory as htmlHost, or in one of the PATH directories on the client machine.  htmlHost contains a copy of this file embedded within the application.  Click here to write a copy of it to the application's directory.  This DLL has no additional runtime dependencies.

debugging

htmlHost maintains an extensive log of program actions that can be used to help troubleshoot display problems.  See the debugging-related INI settings below for more information.

Starting with version 4.2, htmlHost now allows web pages to add entries to the log.  To do this, navigate to about:log%MESSAGE%, where %MESSAGE% is the message you wish to add to the log.  Note that messages are not unescaped by the server, and are added exactly as they are passed. 

Note:  Adding log entries can only be done from the htmlHost client window.

ZIP format

htmlHost supports both PKZip 4.5 and older 2.x compatible archives, meaning that the enchanted deflate and AES encryption schemes supported by many new archive utilities are also supported by htmlHost.  Files in the archive may be password protected, and relative paths are supported. 

To use ZIP archives, note that the UseServer INI property must be set to truehtmlHost does not support display of files from a ZIP archive without using the server.  As noted above, ZIP archive support requires the Xceed Zip Compression Library file xceedzip.dll.  This file must be in the same directory as htmlHost, or in one of the PATH directories on the client machine.  htmlHost contains a copy of this file embedded within the application.  Click here to write a copy of it to the application's directory. 

image capture

Starting with version 3.1, htmlHost supports capturing the client window area to an image.  This image can either be placed on the Clipboard for later retrieval, or saved as a high-quality JPEG file.  If the JPEG option is specified, the user will be prompted for a filename.  The default filename is a filename-safe version of the current page's title.  Image capture is only supported within the htmlHost display window.  External viewers are not supported. 

To copy the client window area image to the Clipboard, navigate to about:CaptureWindowClipboard.  To copy the client window area image and prompt the user to save the image as a JPEG, navigate to about:CaptureWindowJPG..

Notes: Only the visible area of the window is captured.  Capturing images can only be done from the htmlHost client window.

executing programs

Starting with version 4.3, htmlHost supports executing programs from script.  To execute a program, navigate to execute:[program or document name], where [program or document name] is the name of the executable program or document you wish to execute.  Relative paths are supported.  htmlHost will URL decode/unescape the string and convert any forward slashes to backslashes prior to execution.  Executing a document performs the same action as double-clicking on the file in Windows Explorer.

Notes:  The local filesystem is used for program and document execution, even if htmlHost is serving pages from a ZIP archive.  Executing programs can only be done from the htmlHost client window.

Remember:  Javascript uses the backslash character as an escape character.  Use two backslashes –"\\"– to represent a single backslash character.

Warning:  Regardless of the value of the ServeFromRoot .INI file entry, the entire filesystem is available for execution.  Because of this, htmlHost builds starting with 565 require the AllowExecute .INI entry to be explicitly set to true for execute commands to be processed.

impression runtime hosting

Starting with version 4.0, htmlHost supports "Runtime Hosting Utility (RHU)" mode, allowing courseware developers using the Impression Content Creation Tool (CCT) to preview their content as it would be hosted from a web server.

In RHU mode, htmlHost expects three parameters to be passed via the command line.  The first parameter is the name of the lesson XML file to display, the second is the (fully-qualified) path where media files can be found, and the third is the hWnd of the CCT instance that launched htmlHost.  These parameters are automatically passed by the CCT when a Preview command is invoked.

The [RHU] section of the .INI file specifies additional RHU-specific options, including the name of the HTML file to initially load.  When running in RHU mode, htmlHost begins by serving the initial file specified in the [RHU] section of the .INI file; this file's location is used as the root for serving most files.  When the initial file is first loaded, htmlHost creates a querystring value (accessible from the JavaScript via the window.location.search string) containing GUID values that are used as placeholders for the lesson XML file and the media path passed from the CCT.  The querystring is appended to the initial URL before the client window or external browser is opened.  Starting with version 4.2, if the AppIcon INI entry is blank or not found, htmlHost will use a grayscale version of the normal icon or an Impression icon to indicate that it is running in RHU mode.

Note:  The actual filenames are NOT passed to the HTML page, only the substituted GUIDs are passed.  If the actual files were passed, the runtime would attempt to load these files from disk.  Since the runtime is running from localhost, attempting to access the local filesystem would cause a sandbox violation error.  When using htmlHost as a runtime hosting utility, any variables in your code that reference the media path or the lesson XML file will contain these GUIDs.

When htmlHost receives a request containing one of these GUIDs, the lesson XML file or media path (depending on the GUID used) is retrieved and used to service the request.  Note that both GUIDs are prepended with a slash (/) character, and htmlHost considers the slash character to be part of the GUID.

limitations

htmlHost supports GET and HEAD type requests.  You can turn on support for POST requests (see the customization section below), but no processing is performed.  All other request types receive an HTTP 501 (NOT IMPLEMENED) response in return.

htmlHost creates a server on localhost (127.0.0.1).  Other machines cannot access the server.  Note that other processes on the current machine will still be able to access the server.

internet explorer compatibility mode

As noted above, htmlHost uses an instance of the Internet Explorer rendering engine for its internal display.  By default, this instance will default to IE7 behavior for pages that specify a standards-based <!DOCTYPE> directive.  You can use the x-ua-compatible meta tag to override the default behavior.  Generally, you will want to specify that the page should be rendered using the newest version of IE found on the system, this can be done with the following tag:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

customization

This program can be customized through the use of an .INI file.  The file must be located in the same directory as the application and must be named [appname].ini.  There are three sections that control customization, as described below.

Click here to generate the #appname#.INI file with default values in the #appname# application directory.

INI - RHU section

The following entries can be changed in the RHU section:

Entry Values Default Description
SuppportsRHUMode true, false true Specifies whether or not RHU mode is supported.

If this value is true, htmlHost determine whether or not RHU mode is enabled based on the command line values passed to the running instance.  If the parameters are valid RHU parameters, RHU mode is enabled.  To be valid, The command line parameters must:
  • Consist of exactly 3 parameters (ignoring information passed from the server instance to the client)
  • The first parameter must identify a file that exists in the disk filesystem.
  • The third parameter must be a 32-bit integer.
Note that the second parameter (the media path) is not validated, since the CCT cannot guarantee that the media path identified for the specific lesson to be previewed is valid.

Read the section on impression runtime hosting, above, for more information on RHU mode.
DeleteLessonXMLOnClose true, false true Specifies whether or not the lesson XML file passed by the CCT should be deleted when the application closes.

The CCT creates a temporary XML file for the lesson when previewing, and assumes that the previewing application will delete the file when it is finished with it.  If this value is true, the server will delete this file before shutting down.  If this value is false, the file will not be deleted.

Note that if the file is deleted, it is moved to the recycle bin and can be restored if necessary.

If the program is in RHU mode as a result of specifying RHU parameters in the DefaultCommandLine entry, this value is ignored and the application will not delete the lesson XML file.
InitialFile (filename) "" Specifies the initial file to load.

Both absolute and relative paths (relative to htmlHost) are supported.  If InitialFile specifies an existing path, the path is searched for a default file.  If one is found, it is used.  If InitialFile does not specify either a valid path or a valid file, this screen will be shown.
QuerystringTemplate (string values) "lessonXML=
%LESSON_XML_FILENAME%
&mediaPath=
%MEDIA_PATH%"
Specifies the format of the query string to build and pass to the initial file.

Each instance of %LESSON_XML_FILENAME% is replaced with the GUID generated by htmlHost that represents the lesson XML filename passed from the CCT, while each instance of %MEDIA_PATH% is replaced with the GUID that represents the media path passed from the CCT.
UseImpressionDefaultIcon true, false false Specifies the default icon to use in RHU mode.

If this value is true, the grayscale Impression icon will be used. If this value is false, a grayscale version of the htmlHost icon will be used.

INI - General section

The following entries can be changed in the General section:

Entry Values Default Description
DefaultCommandLine (string value) "" Specifies a default value for the command line.

If this value is not empty, and the actual command line is empty, this value will be used as the command line arguments to the program.

You can use this setting to specify any valid command arguments supported by the program, including RHU mode settings.

Note that if this value is used to force the application into RHU mode, the value of the DeleteLessonXMLOnClose RHU section entry is ignored - the application will not delete the lesson XML file.
UseServer true, false true Specifies whether or not the localhost server should be used to serve files.

If this value is true, the localhost web server will be started on program initialization.  Requests from the filesystem will be converted to a localhost-based URL before being sent from the viewer. 

If this value is false, the localhost web server will not be started and file requests will be served without any processing.  In this mode, htmlHost acts as a very simple wrapper around Internet Explorer.  This is of limited use, but does still allow for automatic display of pages and allows Flash content to run in a trusted security context.  If this value is false, only a single instance of htmlHost will be created, regardless of the value of the UseSingleProcess entry.  Note that if this value is false, htmlHost will not search for or serve ZIP-compatible archives.
Port [0-65536] 0 Specifies the port to listen to for incoming requests. 

If this value is not 0, htmlHost will attempt to use the port specified.  If the port is in use, htmlHost will not attempt to use any other port and will display an error message. 

If this value is 0, and the DontUsePort80 value is false, htmlHost will first attempt to use port 80.  If port 80 is already in use, or the DontUsePort80 value is true, htmlHost will ask Windows for an available port.

If UseServer is false, this entry is ignored.
DontUsePort80 true, false false Specifies whether or not htmlHost should try port 80 before asking Windows for an unused port.  If Port is not 0, or UseServer is false, this entry is ignored.
ServeFromRoot true, false true, false Specifies how the localhost URLs should be constructed when filesystem files are requested.

If this value is true, localhost URLs are constructed relative to the root of the file requested. For example, the localhost URL for "C:\Foo\Bar.txt" is converted to "http://localhost/Foo/Bar.txt". This approach allows for testing pages in subfolders without first loading a parent folder page and traversing (via relative links) to the subfolder.

If this value is false, localhost URLs are constructed relative to the path of the file requested. The example above "C:\Foo\Bar.txt" would be converted to "http://localhost/Bar.txt". This approach allows for an additional level of security (malicious entities who already have access to localhost cannot access files above the "C:\Foo" folder), at the expense of flexibility.

If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and the extra precaution is justified.

If the application is serving files from a ZIP-compatible archive, this value is ignored.
AllowPathChange true, false true, false Specifies whether or not the served path can change after startup.

If this value is false, attempts to change the path being served (either by drag-and-drop or by direct reference) will result in an error message.

If this value is true, the path can be changed.

If UseServer is false, this value is ignored.

If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and the extra precaution is justified.
AllowHTTPPost true, false true Specifies the server's behavior when responding to HTTP POST requests.

If this value is false, HTTP 501 (NOT IMPLEMENTED) is returned to the browser when a POST request is sent.

If this value is true, the server responds in the same fashion as a GET request.

If UseServer is false, this value is ignored.
UseSingleProcess true, false false Specifies whether or not the localhost server should run in a separate process.

If this value is false, htmlHost starts by launching the localhost server portion of the program.  Once the server is active, the program creates a second instance of itself and passes the server data (along with any command-line parameters) to the second instance.  This second instance does not create a server, instead it uses the information passed from the previous instance for the client window.  When the client window closes, it will automatically close the server instance.

If this value is true, both the server and the client window are created in the same instance. 

If UseServer is false, this value is ignored (no server is created).

Note: If you set UseSingleProcess to true, be careful of blocking calls which can freeze the application.  For example, setting the .async property of an MSXML.DOMDocument to false causes the MSXML engine to halt all work in the process until data is received (or an error occurs).  Because the server is running in the same process space as the MSXML engine, the data is never served back to the client (because MSXML has blocked work) and the application freezes.  To avoid this, either set UseSingleProcess to false, or set OpenPagesInNewWindow to true.
ValidateZIPFiles true, false true Specifies whether or not ZIP files should be validated before use.

If this value is true, htmlHost uses the Xceed library's tools to determine if a dropped or referenced file is a .ZIP file (and can be used as a filesystem).  If this value is false, all files with an extension of .ZIP are assumed to be valid .ZIP files.

Large .ZIP files stored on a device with slow data transfer times can take a significant amount of time to validate.  In these cases, set this value to false to improve performance.
AppIcon (filename) [appname].ico Identifies the external icon to use.

If this value contains a reference (either fully qualified, or relative to the application directory) to a valid .ICO file, that file will be used as the application's icon.  If this value is empty, or the file referenced cannot be loaded as an icon, the application default icon will be used instead.
InitialBackgroundColor (valid CSS color) #FFFFFF Specifies the background color of the client window while the application is first initializing.
UseExternalBrowser true, false true, false Specifies how pages should be opened.

If this value is true, htmlHost will cancel all navigation requests for the client window and redirect them to a new window.

If this value is false, navigation is not redirected and pages will open in the client (this) window.

If UseSingleProcess is true, the default value for this entry is true.  If UseSingleProcess is false, the default value for this entry is false.  If UseServer is false, this entry is ignored.
UseDefaultBrowser true, false true Specifies the application to use to open pages when pages should be opened in a new window.

If this value is true, htmlHost uses the Win32 ShellExecute function to open the localhost URL using the system's default browser.

If this value is false, the internal Internet Explorer rendering engine receives the request to open the page in a new window - on the author's system, this results in the page opening in Internet Explorer.

If UseExternalBrowser is false, or UseServer is false, this entry is ignored.
AllowDrop true, false true, false Specifies whether or not the client window responds to drop requests.

If this value is true, files can be dropped on the client window.  After changing server paths (if necessary), the file will be displayed either in the internal instance of Internet Explorer or in an external browser (depending on the value of the UseExternalBrowser and UseDefaultBrowser entries).  Similar behavior occurs for internet shortcuts, but no action is taken by the server.

If this value is false, the client window will not respond to drop requests.
 
If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and the extra precaution is justified.

If DebugMode is true, this entry is ignored and files can be dropped on the client window.
AllowExecute true, false false Specifies whether or not the application supports execution of programs via the execute: URI type.  If this value is true, pages served from the client window can execute a program (or open a document using the default action) by navigating to execute:[program or document name].  If this value is false, execution will not occur, and the navigation will be cancelled.

For more information, see the section on executing programs, above.
WindowPosition "auto",
"centered"
"auto" Specifies the starting location of the client window.

If this value is auto, the client will be displayed in the default position for a new window.

If this value is centered, the client will be displayed centered both horizontally and vertically on the primary monitor. If RHU mode is active, the client will be displayed centered both horizontally and vertically on the CCT window.

If WindowType is fullscreen, this entry is ignored.
WindowSize "auto",
(custom)
"auto" Specifies the starting size of the client window.

If this value is auto, and an initial file has been specified, the client will use the default size for a new window.  If no initial file has been specified, the application default size will be used.

If this value is not auto, then it must be a string of the form:
x[%][c|w],y[%][c|w]
Where:
  • x is the numeric component of the width
  • y is the numeric component of the height
  • % is an optional character indicating that the value is a percentage of the primary monitor's size
  • c is an optional character indicating that the value represents the client (browser) area
  • w is an optional character indicating that the value represents the entire window (non-client area)
If the size component is a percentage, then w (entire window) is assumed.  If the size component is not a percentage, then c (client area) is assumed.

Examples:

Value Description
320,200 Creates a window with a client area of 320x200 pixels.
320w,200w Creates a window of 320x200 pixels.  The actual client area size will be smaller, depending on the value of the WindowType entry.
640,80% Creates a window with a client area 640 pixels wide, and a height of 80% of the primary display's height.

If WindowType is fullscreen, this entry is ignored.
WindowType "default",
"fixedDialog",
"fixedDialogNoCaption",
"fixedSingle",
"fullscreen",
"minimized"
"default" Specifies the type of client window.  WindowType can be one of the following values:
  • default - A resizable window with caption.
  • fixedDialog - A non-resizable window with caption.
  • fixedDialogNoCaption - A non-resizable window with a thick (dialog) frame and no caption.
  • fixedSingle - A non-resizable window with a thin frame and no caption.
  • fullscreen - A borderless, captionless window that covers the entire desktop (minus the taskbar and any other docked windows).
  • minimized - A resizable window with caption (same as default), but the window is minimized when first displayed.
Note: When this entry is set to fixedDialogNoCaption or fixedSingle the application will not display a close button, although right-clicking on the taskbar entry will show the close command.  The Alt+F4 keypress to close the window will still work.  You may wish to include a link invoking the window.close() or self.close() methods - either will close the htmlHost client window.
RestrictSize true, false true Specifies whether or not the client window should restrict its size.

If this value is true, the client window will not be larger than the primary monitor's dimensions, nor smaller than 32x32 pixels.

If this value is false, the client window size will not be restricted by the application.
IncludeApplicationCaption true, false true, false Specifies whether or not the client window should include the default information from the application.

If this value is true, the client window will display the current page's title, the name of the application, and the port in use (if applicable).

If this value is false, only the page title will be displayed.

If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false.. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and the extra data is not wanted.
Silent true, false false Specifies whether or not the client window should display script errors and other browser notifications.

If this value is false, the client window will display browser UI notifications, including script error notifications, certificate revokation errors, proxy authentication dialogs, NTLM logon prompts, and ActiveX installation prompts.

If this value is true, browser notifications will not be displayed.

If the UseExternalBrowser property is true, this value is ignored.

Note:  Take care when setting this value to true.
UseInternalPopups true, false true Specifies whether or not popup windows should be displayed using the htmlHost popup window or in a browser window.  If this value is true, the htmlHost popup window will be used; if this value is false, a browser window will be used.

Some versions of Internet Explorer running on 64-bit systems can open popup windows using the 64-bit version of Internet Explorer, even when (as is the case with htmlHost) the opening window is hosted in a 32-bit instance of IE.  This can present problems if the popup window is attempting to host plugins that are not supported in 64-bit IE.

Note:  The internal htmlHost popup window does not support display of any browser UI elements, including the address bar, toolbars, or status bar.  If you need this functionality, set this value to false.

Note:  Internal popup windows are closed automatically when the client window is closed.  If you need the popup windows to remain open after the client window has closed (and the htmlHost server is no longer running), set this value to false.

If the UseExternalBrowser property is true, this value is ignored.
ClientOwnsInternalPopups true, false false Specifies whether or not popup windows should be displayed using the htmlHost client window as an owner.

If this value is true, popup windows will always appear on top of the client window; if this value is false, popup windows will initially appear on top of the client window, but can be placed behind it.

Some versions of Internet Explorer running on 64-bit systems can open popup windows using the 64-bit version of Internet Explorer, even when (as is the case with htmlHost) the opening window is hosted in a 32-bit instance of IE.  This can present problems if the popup window is attempting to host plugins that are not supported in 64-bit IE.

If the UseInternalPopups property is false, or the UseExternalBrowser property is true, this value is ignored.
InternalPopupIcon (filename) "" Identifies the external icon to use for popup windows.

If this value contains a reference (either fully qualified, or relative to the application directory) to a valid .ICO file, that file will be used as the icon for popup windows.  If this value is empty, or the file referenced cannot be loaded as an icon, the application default icon (or the value of AppIcon, if available) will be used instead.

If the UseInternalPopups property is false, or the UseExternalBrowser property is true, this value is ignored.
RegisterInternalPopups true, false false Specifies whether or not internal popup windows should be registered as browsers with the operating system.

If this value is true, any created internal popup windows are registered as web browsers (via the underlying Internet Explorer instance's .RegisterAsBrowser property) when they are created.  Registering the internal popup windows allows named windows created by pages in the main client window to be reused.

If this value is false, internal popup windows are not registered as browsers when created.  Issuing multiple calls to open a popup window with the same name will result in multiple windows being created.

Note: Communication from the popup window to the main window (via the window.opener DOM element) or from the main window to the popup window (via the return value from the window.open command) is supported regards of the value of this property.

Note:  Setting this value to true when the UseServer property value is false can cause security warnings, since any pages or items loaded into the popup window are running in a web browser in the local filesystem domain.
SilentInternalPopups true, false false Specifies whether or not internal popup windows should display script errors and other browser notifications.

If this value is false, internal popup windows will display browser UI notifications, including script error notifications, certificate revokation errors, proxy authentication dialogs, NTLM logon prompts, and ActiveX installation prompts.

If this value is true, browser notifications will not be displayed by internal popups.

If the UseExternalBrowser property is true, or the UseInternalPopups property is false, this value is ignored.

Note:  Take care when setting this value to true.
PasswordPrompt (any string value) "" Specifies the prompt to display to the user when a password-protected file is requested from a ZIP-compatible archive.  The default value, "", means that the built-in prompt should be used.

You can specify line breaks in the prompt by using the string %LF%.  If you want to include the filename as part of the prompt, use the string %FILE%.
PasswordPromptLimit (number) 0 Specifies how many concurrent password prompts can be shown to the user before failing the request.  A positive integer here limits the number of prompts, while 0 or a negative value indicate unlimited prompts.

Note that htmlHost tracks entered passwords, and passwords entered in a session are tried before the user is prompted.  If the user cancels the password dialog, the file request fails - this value does not affect this.
ExtendedPasswordDialog true, false true, false Specifies whether or not to display the extended password dialog for password-protected files in archive mode.

If this value is true, an "advanced" link is shown on the basic password dialog.  Clicking on this link unfolds the dialog to show additional controls, including information about the current file and number of attempts made, as well as a checkbox that turns off password "hiding".

If this value is false, the advanced link is not shown.

If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and the extra precaution is justified.
ShowPassword
DialogExtended
true, false false Specifies whether or not the extended password dialog should initially be unfolded and the password unobscured.

If this value is true, the password dialog is initially shown as if the user had previously clicked on the "advanced" link and cleared the "obscure password" checkbox.

If this value is false, the password dialog is initially shown in its default state.
ModalPasswordDialog true, false false Specifies how the password dialog should be shown.

If this value is true, the dialog is shown modally, if false, the dialog is shown modelessly.  If UseSingleProcess is true, or UseServer is false, this value is ignored and the dialog is shown modally.

Note that the password dialog originates from the server.  Modal dialogs from an out-of-process server display properly, but do not appear in the task bar.  In this case, it's possible for the password prompt to be "lost" if the user switches to another window.

You should only change this value if you run into problems with the default value.
PasswordDialogTopmost true, false true Specifies how the password dialog should be shown.

If this value is true, the dialog is shown on top of all other windows, even those in a different process.  If this value is false, the dialog is shown normally.
DebugMode true, false true, false Specifies whether or not the application runs in debug mode.

If this value is true, pressing CTRL+F4 at any time will close the current page and display this one.  If this value is true and DebugWindow contains an appropriate value, one or both of the debug log windows will be displayed at startup.  Setting this value to true overrides the value of the AllowDrop entry and forces it to true.

If this value is false, the CTRL+F4 shortcut will not work, and no debug windows will be shown, regards of the value of DebugWindow.

If the application EXE name is "htmlHost.exe", the default value for this entry is true (to provide maximum flexibility). If the application EXE name is not "htmlHost.exe", the default value for this entry is false. In this case, the application assumes that a renamed executable is being used to provide a reviewing mechanism for others and access to this page should be restricted.

Note: The CTRL+F4 shortcut key may not work with all builds of Internet Explorer, and some content may also prevent CTRL+F4 from working correctly.  In these cases, use the about:htmlHost shortcut to return to this screen.
DebugWindow ("client"|"server"),
"both",
""
"" Specifies which log windows will be shown at startup.

The value is a string.  If the string contains the word "client", the log window associated with the client process will be shown.  If the string contains the word "sever", the log window associated with the server process will be shown.  If the string contains the word "both", both log windows will be shown.  If UseSingleProcess is true, or UseServer is false, there is only a single process active.  In this case, the single (unified) log window will be shown if either window is requested.

If UseServer is false, or UseSingleProcess is true, only one debug window is available.  In this case, any of the valid strings listed above will cause the debug window to be displayed.

Regardless of the value of DebugWindow, the debug windows can be opened from the links on the top of the page.  Additionally, the client link can be opened by navigating to about:showClientDebugger, the server can be opened by navigating to about:showServerDebugger, and both debuggers can be opened by navigating to about:showDebugger.

Click here to create shortcuts in the application directory to open the debugging windows.
UseOutputDebugString true, false true Specifies whether or not the application should also use the Win32 OutputDebugString call when it logs an event.

If this value is true, each log entry created is also sent out via OutputDebugString.  This allows developers to use various 3rd party tools to examine the htmlHost processing flows instead of using the built-in log windows.

If this value is false, log entries are not sent to the system.

Note: Sysinternals (now owned by Microsoft) provides an excellent free tool named Dbgview that displays the data sent to Windows via OutputDebugString.  The latest version of Dbgview is available from Microsoft at http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx.

Warning:  htmlHost log entries may contain sensitive information.  htmlHost log entries do not contain passwords.
DebugIncludeTimestamp true,false false Specifies whether or not the time each log entry was created should be added to the log.

If this value is true, htmlHost adds the time the entry was generated to each log entry.  This affects both the internal log windows as well as any information sent via OutputDebugString.

If this value is false, timestamp information will not be added.

INI - MimeTypes section

The MimeTypes section allows the user to override the default mime types included in htmlHost.  Each key on the left represents a single file extension, while the value on the right represents the mime type associated with that extension.  Use "*" (without the quotes) to define the default mime type to use when a specific value is not present.  To remove a specific mime type from the program, add a key with a blank value.

The following table shows the default mime type extensions and values:

Extension MimeType
* application/zip
txt text/plain
html text/html
htm text/html
png image/png
gif image/gif
jpeg image/jpeg
jpg image/jpeg
xhtml application/xhtml+xml
css text/css
js text/javascript
swf application/x-shockwave-flash
mp3 audio/mpeg
mp4 video/mp4
oga audio/ogg
zip application/zip
xml text/xml
xsl text/xsl
323 text/h323
aif audio/x-aiff
aiff audio/x-aiff
asf video/x-ms-asf
asx video/x-ms-asf
au audio/basic
avi video/x-msvideo
bas text/plain
bin application/octet-stream
bmp image/bmp
c text/plain
doc application/msword
docx application/msword
eps application/postscript
gz application/x-gzip
h text/plain
hlp application/winhlp
hta application/hta
htc text/x-component
ico image/x-icon
jar application/x-jar
m3u audio/x-mpegurl
mdb application/x-msaccess
mht message/rfc822
mhtml message/rfc822
mid audio/mid
mov video/quicktime
mp2 video/mpeg
mpeg video/mpeg
mpg video/mpeg
mpp application/vnd.ms-project
pbm image/x-portable-bitmap
pdf application/pdf
ppm image/x-portable-pixmap
ppt application/vnd.ms-powerpoint
pptx application/vnd.ms-powerpoint
ps application/postscript
qt video/quicktime
ra audio/x-pn-realaudio
ram audio/x-pn-realaudio
rgb image/x-rgb
rmi audio/mid
rtf application/rtf
svg image/svg+xml
swf application/x-shockwave-flash
tif image/tiff
tiff image/tiff
vcf text/x-vcard
vrml x-world/x-vrml
vtt text/vtt
wav audio/x-wav
wmf application/x-msmetafile
wri application/x-mswrite
xbm image/x-xbitmap
xls application/vnd.ms-excel
xlsx application/vnd.ms-excel
z application/x-compress

commands

The following commands are included in this page, and are gathered here for convenience.

write default page link
Creates a shortcut in the application directory that, when dropped onto the viewer window, displays this page.

show server log
show client log
show both client and server logs
Displays the specified log window.
create "show log" links
Creates three shortcuts in the application directory that, when dropped onto the viewer window, show one or both of the log windows.

write xceedzip.dll
Creates a copy of the xceedzip.dll embedded within the application in the application directory.

write #appname#.ini
Creates an INI file with default values in the application directory, then opens the file for editing.
edit #appname#.ini
Opens the INI file in the application directory for editing.

write autorun.INF
Creates an autorun.INF file with default values in the application directory, then opens the file for editing.
edit autorun.INF
Opens the autorun.INF file in the application directory for editing.

write autorun.INF
Creates an autorun.INF file with default values in the application directory, then opens the file for editing.
edit autorun.INF
Opens the autorun.INF file in the application directory for editing.

about:CaptureWindowClipboard
Copies the client window area image to the Clipboard.
about:CaptureWindowJPG
Copies the client window are image and prompts the user to save it as a high-quality JPEG file.
about:log%MESSAGE%
Adds the message %MESSAGE% to the log.

credits

Flash detection is done through Geoff Stearns' SWFObject, available at http://code.google.com/p/swfobject/. The Xceed Zip Compression Library is licensed from Xceed, on the web at http://xceed.com/.

Copyright ©2007-2019 Logicdriven, LLC.  All rights reserved.  Permission is hereby granted to freely redistribute this software.