Setup of Development Environment for Windows: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
= Required software =
= Required software =


== Microsoft .Net 3.5==
== Microsoft .NET 3.5==
Download and install the two Microsoft .Net dependencies. They allow execution of and development for .NET applications (such as openPETRA).
Download and install the two Microsoft .NET dependencies. They allow execution of and development for .NET applications (such as openPETRA).


* Free downloads from Microsoft
* Free downloads from Microsoft
** '''Microsoft .Net 3.5 SP1 Redistributable'''
** '''Microsoft .NET 3.5 SP1 Redistributable'''
*** http://www.microsoft.com/downloads/details.aspx?familyid=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
*** http://www.microsoft.com/downloads/details.aspx?familyid=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
**** Follow the 'Instructions' section on that web page and read the 'Important' section.
**** Follow the 'Instructions' section on that web page and read the 'Important' section.
*** This is ''not needed'' (and will indeed not work!) if you are installing on ''Windows 7'', because the Redistributable is already pre-installed (or even the Microsoft .Net 4 Redistributable, which will also work).
*** This is ''not needed'' (and will indeed not work!) if you are installing on ''Windows 7'', because the .NET Redistributable is already pre-installed (or even the Microsoft .NET 4 Redistributable, which will also work).
** '''Windows Software Development Kit (SDK), .NET 3.5 SP1'''
** '''Windows Software Development Kit (SDK), .NET 3.5 SP1'''
*** http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
*** http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
*** There is no need to install all the components that are available - many involve huge further downloads! Only ".Net Development Tools" and "Debugging Tools for Windows" are needed for developing openPETRA.
*** There is no need to install all the components that are available - many involve huge further downloads! Only ".NET Development Tools" and "Debugging Tools for Windows" are needed for developing openPETRA.


Microsoft recommends to run 'Windows Update' ''before'' installing those two dependencies. It might also be a good idea to run 'Windows Update' ''after'' installing those two dependencies to check whether any updates or security patches are available.
Microsoft recommends to run 'Windows Update' ''before'' installing those two dependencies. It might also be a good idea to run 'Windows Update' ''after'' installing those two dependencies to check whether any updates or security patches are available.


Note: Both the Redistributable '''and''' the SDK are needed! (We only use .Net 2.0 for openPETRA, but the SharpDevelop IDE requires .Net 3.5 SP1 Redistributable and SDK)
Note: Both the Redistributable '''and''' the SDK are needed! (We currently only use .NET 2.0 for openPETRA, but the SharpDevelop IDE requires .NET 3.5 SP1 Redistributable and SDK)




== SharpDevelop 3.x ==
== SharpDevelop 3 ==
SharpDevelop is the IDE (Integrated Development Environment) we use for developing openPETRA.
SharpDevelop is the IDE (Integrated Development Environment) we use for developing openPETRA.


Line 79: Line 79:
* download [https://sourceforge.net/projects/nant/files/nant/0.90-alpha1/nant-0.90-alpha1-bin.zip/download NAnt 0.90-alpha1]
* download [https://sourceforge.net/projects/nant/files/nant/0.90-alpha1/nant-0.90-alpha1-bin.zip/download NAnt 0.90-alpha1]
** please use ''this'' version as it works for us. Some of the released alpha or beta versions do not work (Example: [http://sourceforge.net/project/showfiles.php?group_id=31650&package_id=23704&release_id=560184 0.86-beta1]; it breaks with message: Property 'sdkInstallRoot' has not been set.)
** please use ''this'' version as it works for us. Some of the released alpha or beta versions do not work (Example: [http://sourceforge.net/project/showfiles.php?group_id=31650&package_id=23704&release_id=560184 0.86-beta1]; it breaks with message: Property 'sdkInstallRoot' has not been set.)
* unzip the files to e.g.  
* unzip the files to e.g. <code>c:\program files\nant</code>
c:\program files\nant
* create file <code>c:\windows\nant.bat</code> with content:  
* create file <code>c:\windows\nant.bat</code> with content:  
  @echo off
  @echo off
Line 98: Line 97:
** '''MySQL'''. See [[Notes about MySQL]]
** '''MySQL'''. See [[Notes about MySQL]]
*** get the latest Windows version from http://dev.mysql.com/downloads/mysql/. It is called MySQL Community Server. The MSI essential package works fine for me.
*** get the latest Windows version from http://dev.mysql.com/downloads/mysql/. It is called MySQL Community Server. The MSI essential package works fine for me.


= Optional Software =
= Optional Software =

Revision as of 09:29, 13 July 2010

Overview

All the development tools we use are open source themselves, so developers do not need to spend money to be able to partly or fully join the openPETRA development!

If you already have some or all of the software installed that is listed here, please make sure it is the same version that we specify before skipping the relevant section on this page!


Required software

Microsoft .NET 3.5

Download and install the two Microsoft .NET dependencies. They allow execution of and development for .NET applications (such as openPETRA).

Microsoft recommends to run 'Windows Update' before installing those two dependencies. It might also be a good idea to run 'Windows Update' after installing those two dependencies to check whether any updates or security patches are available.

Note: Both the Redistributable and the SDK are needed! (We currently only use .NET 2.0 for openPETRA, but the SharpDevelop IDE requires .NET 3.5 SP1 Redistributable and SDK)


SharpDevelop 3

SharpDevelop is the IDE (Integrated Development Environment) we use for developing openPETRA.


PuTTY / Plink

PuTTY is a SSH and telnet client for the Windows platform. Plink is a command-line interface to the PuTTY back ends, which is used by Git and TortoiseGit (see below).

Free download: PuTTY Download Page

  • In the section 'Binaries', choose the installer under the heading 'A Windows installer for everything except PuTTYtel', e.g. putty-0.60-installer.exe
  • Run the installer and remember the path where you install PuTTY into - you need to specify the path during the installation of Git and TortoiseGit (the installers need to be pointed to the file 'plink.exe' in that directory when they ask for it).


Git and TortoiseGit

The Git Source Code Management System is a distributed source code versioning system (as opposed to central source code versioning systems, such as CVS and SVN). We use Git for the maintenance of the openPETRA source code repository.

TortoiseGit is a Windows client for Git which integrates nicely into the context menu of the Windows Explorer.


Git on Windows

Free download: Git on Windows

Note: use the official git installer from that site, eg. Git-1.7.0.2-preview20100309.exe, labelled 'Full installer for official Git', not the packages that have 'fullinstall' or 'netinstall' in their name, or any other packages.

Installation options

  • 'Select Components' page of the installer: leave everything as it is.
  • 'Adjusting your PATH environment' page of the installer: leave the radio button on 'Use Git Bash only'.
  • 'Choosing the SSH executable' page of the installer: Set the radio button to 'Use (Tortoise)Plink' and specify the path to the 'plink.exe' executable by using the '...' button (this is the path that you installed PuTTY into).
  • 'Configuring the line ending conversions' page of the installer: leave the radio button on 'Checkout Windows-style, commit Unix-style line endings'.

TortoiseGit

  • Free download: TortoiseGit
    • Note: There are installers for 32bit and 64bit Windows. Choose the correct one according to your operating system architecture.
    • TortoiseGit is still work in progress, but works fine on Windows (we have encountered some minor hiccups, though).
    • Please install "Git on Windows" before installing TortoiseGit (see above)!

Installation options

  • We recommend to use plink.exe from PuTTY, not OpenSSH.

Alternative Windows Client

You also might want to have a look at Git Extensions, which is also a fully functional git GUI for Windows.


Setting up the Git repository

After installing Git and TortoiseGit (or Git Extensions), please follow our Notes about Git to configure your local git repository for openPETRA use!


NAnt

NAnt is our build system. It is used for ongoing compilation, for creation of Builds/Releases of openPETRA, and for the automation of quite a few tasks in the development lifecycle of openPETRA - including auto-generation of source code and Forms.

  • download NAnt 0.90-alpha1
    • please use this version as it works for us. Some of the released alpha or beta versions do not work (Example: 0.86-beta1; it breaks with message: Property 'sdkInstallRoot' has not been set.)
  • unzip the files to e.g. c:\program files\nant
  • create file c:\windows\nant.bat with content:
@echo off
"C:\Program Files\NAnt\bin\NAnt.exe" %* -t:net-2.0

See also our Notes about NAnt.


Database systems

openPETRA works with a number of Database Management systems.

  • Choose one (or more) of the following Database Management systems. (If you want to start development quickly, SQLite is sufficient, so there is no immediate need to install PostgreSQL or MySQL. PostgreSQL is recommended for serious development, however).

Optional Software

  • For the editing of YAML files (which we use for defining the layout of screens, the main menu entries, and code hierarchy) we use Notepad++, which has syntax highlighting support for YAML files.
    • Download Notepad++
    • Once the software is installed, it needs to be set up once to accept our file extension, '.yaml', in addition to the one is built in, '.yml' for the syntax highlighting to work:
      • Menu 'Settings' -> 'Style Configurator'. Select 'YAML' in the 'Language' list and enter 'yaml' in the 'User ext.' field. Choose 'Save & Close'. (You might need to close and re-open any .yaml file that you already have open to get the syntax highlighting working.)
  • The following pieces of software are only required when you want to build releases of OpenPetra:


Get the source code

The source code is managed with Git.

Please understand that we will provide write permissions only to the core members of the development team, just to keep the project on one track. We very much need your contributions though, and we will aim to quickly deal with submitted patches and code via the forum. This still has to be worked out how this works best to submit code that way.

You can get the source code in several ways:

for anonymous access, you can use this URL to clone the repository with TortoiseGit:

git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg

for developer access (with write permissions), use this URL to clone the repository with TortoiseGit:

ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg

For development, I recommend you create a local branch, and switch to it. Then you pull updates from the server ("master") into your local branch, and push your updates up to the server in the master branch. Otherwise you get all sorts of problems with pushing and pulling, so don't commit to master at all. see also Notes about Git


Configuration of Development Environment

The recommended way of installing OpenPetra.org for development is to somewhere map a network drive, using the DOS command subst

For example:

mkdir c:\development
subst u: c:\development

Download the Git repository into u:\openpetraorg (it contains the .git directory, and the OpenPetra.build: U:\openpetraorg\OpenPetra.build, etc)

URL of the git repository:
   anonymous access: git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
   developer access: ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
     make sure that you set your username and email address in your git client
  • Make a copy of the file OpenPetra.build-sample-windows.config and call it OpenPetra.build.config
copy OpenPetra.build-sample-windows.config OpenPetra.build.config

Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.


NAnt script

There is a central NAnt script that is able to generate a lot of code and is able to do all automated tasks in the OpenPetra project.

Please see OpenPetra NAnt script for details