Development:Windows Development Environment

From OpenLP
Jump to: navigation, search

Installing Software

The various applications and packages, as well as the steps to install them are detailed on the Windows Environment page:

Installing a Python IDE

There are a number of IDEs for Python available for Windows. We recommend using PyCharm.

Bazaar Client

Main article: Bazaar

To access the source code, you will need to use Bazaar, an open source distributed version control system. Windows users can download the Bazaar client which includes TortoiseBzr. Ensure you pick the latest stable version, you may need to scroll down the page to find these.

In order to use Bazaar, you will need to configure SSH keys below:

Configuring SSH keys

Main article: Configuring SSH Keys on Windows

One of the things that Windows has no native support for is SSH and SSH keys, therefore you will need to use PuTTY, which is a free implementation of Telnet and SSH for Windows, along with an xterm terminal emulator. It is written and maintained primarily by Simon Tatham. You will need to download the PuTTY Windows installer (we don't need PuTTYtel) and install on your computer.

Generating Public and Private keys

Generating a keypair with PuTTY is very easy.

PuTTY SSH Keys.png

  1. Launch PuTTYgen
  2. Give your key a nice name (on Unix systems it's <username>@<pc_name>)
  3. At the bottom, select SSH2 RSA
  4. Set the bits to 4096
  5. Click the Generate button
  6. Click the Save private key button and save your private key to somewhere safe on your computer
  7. Don't close PuTTYgen just yet!

Using public and private keys

Launchpad needs to use your public key; Bazaar needs to use your private key through Pageant which is part of the PuTTY package.

Adding Your Public Key to Launchpad

  1. Select the text in the box that appears at the top of PuTTYgen
  2. Open your browser to Launchpad and log in
  3. Go to your home page and click on the Change details link
  4. Click on the SSH Keys tab
  5. Paste that public key into the text box at the bottom of the page
  6. Click the Import Public Key button at the bottom of the page

Using Pageant For SSH Key Auth

Unfortunately uploading your public key to Launchpad on it's own is not enough. You also need to make sure Bazaar can speak to your private key.

  1. Run Pageant (you'll see a little icon of a computer with a hat appear in your system tray
  2. Right-click on the icon and click View Keys
  3. Click the Add key button and find your private key
  4. Click the Close button, and you're all ready!

If you want to get Pageant to start and load your key automatically:

  1. Create a shortcut to Pageant in your Windows Startup menu
  2. Right click on that shortcut and bring up the Properties
  3. Change the target to add the path of your ppk file as an argument:
"C:\Program Files (x86)\PuTTY\pageant.exe" "C:\Users\username\Documents\privatekey.ppk"

Check out the latest code

Python code.png

OpenLP uses the Bazaar DVCS (read more about Bazaar) and the main branch is hosted at Do the following to set up your local branch:

  1. Open the "bzr command line tool" that was installed with Bazaar. (Bazaar's GUI rarely works)
  2. Identify yourself to Bazaar:
    bzr whoami "Raoul Snyman <>"
  3. Log in to Launchpad:
    bzr launchpad-login raoul-snyman
  4. Create a shared repository:
    bzr init-repo ~/openlp
  5. Checkout the latest code:
    bzr checkout lp:openlp ~/openlp/trunk

If it doesn't work, try the steps below.

Troubleshooting known problems

Permission denied (publickey)

If when trying to branch the code, you get this error (usually twice),

Permission denied (publickey)

you need to set the environment variable telling Bazaar what to use for the private key:

Either use cmd (as administrator) :

  • set BZR_SSH=paramiko

Or use the control panel:

  1. Go to control panel > All control panel items > System
  2. Click on Advanced system settings
  3. In the Advanced tab, press Environment Variables...
  4. Press New, and enter in BZR_SSH for the name and paramiko for the value, and then press OK.

Other things to check if it goes wrong

  • Ensure that Bazaar is run as administrator
  • Ensure that Pageant is run as administrator
  • Ensure that the private key is loaded into pageant
  • Check the environment variable BZR_SSH above