Endjin - Home

A step by step guide to installing an F# REPL environment on Windows

by Matthew Adams

header-a-step-by-step-guide-installing-f-repl-environment-windows-p1-1024px

Getting set up on Windows

You need to be running Windows 7 or Windows 8 (or later).

If you’re running Windows Vista or Windows XP, I’m sorry, but this isn’t going to work for you.

First, we need to make sure that the .NET Framework V4.5 is installed.

If you happen to have installed Visual Studio 2012, then you’ve got it already.

If you are running Windows 8, then you’ve got it already.

If you are running Windows 7, then go to this link to download and run the .NET V4.5 installer.

http://go.microsoft.com/?linkid=9810134

Follow the instructions in the wizard to get .NET installed on your operating system. This may require a reboot.

Next, we have to install the Windows SDK.

If you have installed Visual Studio 2012, then you’ve got it already.

If you are running Windows 8, you need the Windows 8 SDK

Go to the Windows 8 SDK download page:

clip_image001

Find the download button and run the installer. Follow the instructions in the Wizard to install the SDK with the default options.

If you are running Windows 7, you need the Windows 7 SDK

Go to the Windows 7 SDK download page:

clip_image002

Find the download button, and run the installer. Follow the instructions in the Wizard to install the SDK with the default options.

Next, we can install the F# Runtime environment and tools.

Download and run the F# tools from here.

Agree to the license, and click next. The tools will be setup for you.

Once you’ve done that, the tools are on your computer, but getting at them is a bit tricky!

To make things easier, we need to add the Fsharp tools to our environment PATH.

Open up a Windows Explorer window, and find Computer. Right click it and choose ‘Properties’.

clip_image003

This opens the system properties Window (the picture is of the Windows 8 version, but Windows 7 is very similar).

clip_image004

First take note of whether you are running a 32bit or 64bit operating system, this will be important in a minute.

clip_image005

Then, on the left hand side of the window, click ‘Advanced System Settings’.

clip_image006

This pops open the System Properties Dialog. Click ‘Environment Variables’

clip_image007

This opens the Environment Variables window. In the ‘System Variables’ section, scroll down until you can see the ‘Path’ item, and select it. Then click the ‘Edit’ button.

clip_image008

This opens the Edit window.

clip_image009

Put the cursor at the end of the ‘Variable Value’ text field and type a semi-colon to separate this new path from the next one:

;

Then add the path to the directory where the F# tools were installed:

If you have a standard 32bit installation of Windows 7, this will be

C:\Program Files\Microsoft SDKs\F#\3.0\Framework\v4.0

If you have a standard 64bit installation of Windows 7 or Windows 8, this will be

C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0

Now, click ‘OK’ to close the ‘Edit System Variable’ window, ‘OK’ again to close the ‘Environment Variables’ window, and ‘OK’ again to close the ‘System Properties’ window.

You can then start a command prompt:

On Windows 8 go to the start screen and start typing

cmd

make sure Command Prompt is highlighted and press enter (or click it)

On Windows 7 click the start button and type

cmd

make sure Command Prompt is highlighted and press enter (or click it)

clip_image010

Finally, we can check that the environment is installed correctly.

To start the interactive F# environment, just type

fsi

You should see the F# interactive command prompt.

clip_image011

To quit, type

#quit;;

Matthew Adams on Twitter

About the author

Matthew was CTO of a venture-backed technology start-up in the UK & US for 10 years, and is now a Founder of Endjin Ltd, which provides technology strategy, experience and development services to its clients who are seeking to take advantage of Microsoft Azure and the Cloud. You can follow Matthew on twitter.