Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created November 8, 2012 23:22
Show Gist options
  • Save springmeyer/4042566 to your computer and use it in GitHub Desktop.
Save springmeyer/4042566 to your computer and use it in GitHub Desktop.
Details on how TileMill is packaged for windows desktop

TileMill on windows details

Setup

  • visual studio 2010 32 bit
  • works on Windows XP -> Windows 8 without any code changes
  • client-server model - no fancy integration between browser window and server
  • node v0.8

Overview

User clicks on Start TileMill startup menu item. This hits TileMill.exe, a simple C program that shells out to the main node application in a relative directory. The node application starts and mounts to http://localhost:20009. The node app then uses topcube to start a subprocess that launches the graphical browser window (internally calls cefclient.exe when on windows). That browser window opens by default to the port the main node application is now listening on: http://localhost:20009 Topcube's javascript wrapper exits when the UI is closed causing the whole application to shut down.

Details

NSIS installer

We use NSIS to 1) drop all the code into place, 2) add node.exe to the windows firewall list, and 3) try to install the c++ 2010 runtimes since our node binary (other other C++ stuff) does not statically link the runtime. code

TileMill.exe

Simple program that shells out to node.js code. We originally just installed a start menu entry that hit a .bat file to start the whole app, but this never displayed correctly in the start menu across windows version so we moved to an .exe wrapper. code.

Topcube

Simple app handling the launching of cefclient on windows or webkit window on linux (no attempt to do anything for mac yet, since we rolled our own wrapper as seen here) code

Chromium embedded client

This is in topcube, but we ripped a bunch out of it to remove UI elements and to be able to pass an arbitrary URL on the command line to control the startup page. The code we modified is at here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment