IWML Runner

IWML Runner

IWML Runner allows simple and quick testing of .iwml files and even full IW17 applications without the need to install or configure a web server. Even with a full web server installed and configured, IWML Runner is still useful for simple testing.

More

How It Works

IWML Runner accepts as a command line argument a pathname to an .iwml file. IWML Runner then sets up a simple web server to serve the .iwml, IW Libraries, and other necessary resources to a browser that it auto launches.

IWML Runner is necessary because of browser security restrictions regarding local file access. Because of this, IW17 applications cannot be run using file:// references in the browser and must be served using normal http or https requests.

Usage

To use IWML Runner pass a pathname to an .iwml file, or simply double click an .iwml file in Explorer.

First Run

This will launch IWML Runner. If this is your first time running IWML Runner, it will first ask you to locate the IW17 libraries. After you select the library path, IWML Runner will store the location in the registry and not ask again.

Default Document

If a matching *.html file exists in the same location as the specified .iwml file, it will be served instead and must load the .iwml file. Any script reference ending in Loader.js will be rewritten by IWML Runner to ensure that it can run easily both with IWML Runner, or other webservers which require a qualified  URI reference.

If not corresponding .html file exists, IWML Runner will use Loader.html from the application directory for the default document to load the specified .iwml file.

IWML Runner is now active and ready:

IWML Runner will create a web server on a free port, and automatically launch the default browser and serve the selected .iwml file.

While this is a simple .iwml file with no interactivity, so long as IWML Runner is left running you can fully use an IW17 application including multiple pages and other interactions.

Speed

The first execution of IWML Runner may seen a little slow because by default it uses the full debug .js files which causes many HTTP requests. In deployment mode, merged and compacted .js file are used.

After the first run it will be faster because the .js files are cached by the browser.

Security

IWML Runner is a simple testing server and not intended for any production deployment. No security considerations have been implemented in IWML Runner and it can easily be used to serve unintended files from your local disk

Auto Create HTML Wrapper

IWML Runner can create a default .html wrapper for customization or use with a normal web server. If no matching .html file exists for the specified .iwml file, then a create button will be visible.

The path in the .html file for Loader.js is set to ~IWLib which will work with IWML Runner, but will need to be adjusted for use with other web servers. The template file is copied from Loader.html which must be found in the same directory as IwmlRunner.exe.

Source Code

IWML Runner is written in Delphi using Indy. IWML Runner is less than 150 lines of code.

Source code is available.

Install and Run in Less Than 60 Seconds

No Loader.js file?

Loader.js will only appear after building the extracted files in VS Code. If you haven’t yet built your IW17 folder, simply navigate to VS Code and with the window in focus, press Ctrl + Shift + B. If the build fails and VS Code shows “problems” in the problems tab, delete the IW17 folder and extract a fresh one from the .zip file. Then, return to VS Code. In the “terminal” tab, run the command “npm install”. Now, go back to the newly extracted directory. Open the “cleanJS.bat” file in your favorite text editor. Select all of the contents and delete them. Return to VS Code once more, and build. Navigate to the IW17 -> Intraweb  and Loader.js will be there.