FAKE Script for ClickOnce Packaging of F# Apps

ClickOnce is very useful technology for delivering applications. Applications are published to the server but run on the client. If a new version is published to the server, the clients can easily upgrade to the new version via a single click. Such applications are sometimes called ‘smart clients’ because they fall somewhere between traditional rich clients and web applications.

In this post I share a build script for packaging F# projects for ClickOnce deployment.

Packaging applications for ClickOnce requires the construction of signed XML documents called Application Manifest and Deployment Manifest. For C# applications the tooling exists in Visual Studio and is fairly easy to use. For F# projects (and to automate build processes) one has to use the command line tool Mage.exe. Using Mage can get a bit involved and not all settings can be controlled via the command line interface. For some settings one has to modify the generated XML. This makes the build task more complex.

Luckily FAKE allows one to handle the entire build process using F# itself so complex steps such as XML manipulation are made much simpler.

Here is the build script: GIST

The following snippet taken from the script shows the tasks involved and their dependencies:

==> “BuildApp”
==> “Prune”
==> “CreateAppManifest”
==> “SignAppManifest”
==> “AddDeployExt”
==> “CreateDeploymentManifest”
==> “UpdateDeploymentManifest”
==> “SignDeploymentManifest”

Advertisements

One thought on “FAKE Script for ClickOnce Packaging of F# Apps

  1. Pingback: F# Weekly #33 2013 | Sergey Tihon's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s