Web Build Configuration

Configuration of the web build is done via url parameters or via changing properties in boxedwine-shell.js
The nature of the parameter determines which mode. In fact the url can override existing parameter values where appropriate.

Storage

By default any changes to d:/ are discarded upon web browser tab close.
Config.storageMode = STORAGE_MEMORY;

2 other options are available:

  • STORAGE_DROPBOX (requires configuration – see below)
  • STORAGE_LOCAL_STORAGE

Settings

  • specify an alternate root zip file system.
    i.e. root=win32.zip. If not set it is assumed the root fs is boxedwine.zip.
  • specify a zip file to appear uncompressed mounted on d:
    i.e. app=chomp.zip would appear under /mnt/d_drive. Use: zip -r9qdgds 10m chomp.zip ./chomp/*
  • change the program to execute via ?p=/home/username/chomp/CHOMP.EXE. surround in quotes if path includes spaces.
  • set the working directory via ?work=chomp. This simplifies p as it can then be relative to the working directory.
  • set an overlay via ?overlay=more.zip;files.zip. Where each zip file contains additional files to add to the root file system. Existing files are overridden.
  • use c:/ as shorthand for /home/username/.wine/dosdevices/c:/ (also works for d:/)

Some simplifications are possible:
boxedwine.html?p=notepad – run notepad in the root fs
boxedwine.html?root=win32&app=chomp&work=chomp&p=CHOMP.EXE – no need to add .zip for root and app zip file name
boxedwine.html?app=chomp&p=CHOMP.EXE – if p does not start with a ‘/‘ and app is set, then the working directory is set to dir + app, i.e. d:/chomp

Useful scratchpad
Drag and drop is supported. Set AUTO_RUN to false. Simply drag a directory into the page. A dialog will appear and list entries for all executable files found.
Getting files into/out of the emulator is provided behind the SHOW_UPLOAD_DOWNLOAD flag in the shell file. Jszip is used to download a directory as an archive.

Other configuration options:
AUTO_RUN – indicates if start button is shown or page auto-runs. default true
ALLOW_PARAM_OVERRIDE_FROM_URL – indicates if url can be appended with params as above for app and p.

Advanced settings:

The default browserfs ZipFs takes as an argument the zipped contents of the file system and lazily unzips files upon request.
Using the &ondemand parameter changes the behaviour to only request the individual zip file entries on demand.

&ondemand=root&root=fullWine1.7.55-v8&overlay=wine1.7.55-v8-min

files in wine1.7.55-v8-min are downloaded on startup, any files not found are loaded on demand from fullWine1.7.55-v8.zip

This approach has the advantage that the downloaded zipped filesystems are smaller, but it has the disadvantage that the network requests for on demand files are synchronous (may block UI thread and also potentially crash the emulator when retrieving large files) and the web server must support range requests.
Provided in /project/linux/buildFiles is wine1.7.55-v8-min.zip which contains the minimum files necessary to load a basic wine application
To generate your own minimal set of files follow the instructions in /tools/common/Main.java

Dynamically sending files
The *-payload parameters can be used to pass in a base64 encoded zip file.
They mirror the existing &app and &overlay parameters but allow the client to supply the app/program/files.
Beware that browsers and web server likely have request size limits.
example:
&app-payload=[base64 string]
&overlay-payload=[base64 string]&p=c:/demo/run.bat

Notes on file system modes:

DROPBOX – OAuth dance provided via dropbox.js library [https://github.com/dropbox/dropbox-js] and oauth_receiver.html.
Because of this boxedwine must be served from a web server when using this option (make sure you copy and comment back in dropbox.min.js script that is found in the source tree).
Also must set DROPBOX_APP_KEY and RECEIVE_URL (absolute path) inside the shell file.
Remember to also set the receive_url in your dropbox app console.

LOCAL_STORAGE – There are limits depending on browser and OS.
MEMORY – default.

other dials/tweaks for emscripten build files.
see var Module inside the html file.

Misc notes:

You can avoid using url params and hardcode the values straight into the shell file. Search for MANUAL: in shell file.