wiki:CompilingMapGuide22Windows

Building and Installing MapGuide from source code on Windows XP/7

this guide is the non-programming-language version of build.bat or build64.bat. If you are reading this document, I assume you know what you are going to do. This instruction also applies to building trunk code.

Environment Setup

  1. Install Microsoft Visual Studio 2008 SP1.
  1. Checkout the source from Subversion to, for example, C:\
    cd c:\
    svn checkout http://svn.osgeo.org/mapguide/branches/2.2/MgDev mgdev
    OR 
    svn export http://svn.osgeo.org/mapguide/branches/2.2/MgDev mgdev
    

Alternatively, you could use TortoiseSVN, a GUI client of subversion for windows.

  1. Download FDO 3.5 RC1 SDK tarball from Here to C:\mgdev\Oem\FDO\ created in previous step.
    cd C:\mgdev\Oem\FDO
    tar xvvf <tar>
    cd Bin
    mkdir Release
    

Move all contents under Bin to Release folder. The structure of fdo should be like this:

C:\mgdev\Oem\FDO\Bin\Release
C:\mgdev\Oem\FDO\Inc
C:\mgdev\Oem\FDO\Lib

Note: if you are working on a 64-bit windows machine and download the 64-bit FDO SDK, rename folder Release into Release64 and Lib into Lib64

  1. Install the following dependencies.
    • JAVA SDK 1.6
    • ANT 1.7 or above

and set the following environment variables. Depending on where you install JAVA SDK and ANT, the value may be different.

JAVA_HOME = C:\Program Files\Java\jdk1.6.0_21
ANT_HOME = =C:\Program Files\apache-ant-1.8.1

Please do a google search if you don't know how to set an environmental variable on windows.

Build Process

  1. Build OEM tree
    • Launch Microsoft Visual Studio
    • File->Open->Project/Solution and browse to oem.sln and click Ok. this will open all 35 Oem projects in Visual Studio
    • In Solution Explorer tree, select Solution 'oem', then click Build->Build Solution, build process will start and should be successful.
  1. Build CSMap. Though CSMap is under folder Oem, it resides on a different subversion vault from other oem projects, and it should be built seperately
    • File->Open->Project/Solution and browse to Oem/CsMap/OpenSource.sln, click Ok to open CsMap project in Visual Studio
    • In Solution Explorer tree, select Solution OpenSource, then click Build->Build Solution, build process will start and should be successful.
  1. Build MapGuide Server
    • File->Open->Project/Solution and browse to c:\mgdev\Server\server.sln, click Ok to open 29 server projects in Visual Studio
    • In Solution Explorer tree, select Solution Server, then click Build->Build Solution, build process will start and should be successful.
  1. Build MapGuide Web Extension, which will later be deployed to Apache HTTP Server or IIS. The output of this building process are HTTP mapagent for IIS and Apache, and extension for PHP, .NET and Java.
    • File->Open->Project/Solution and browse to c:\mgdev\Web\src\WebTier.sln, click Ok to open 30 web extension projects in Visual Studio
    • In Solution Explorer tree, select Solution Web Tier, then click Build->Build Solution, build process will start and should be successful.

Note: In Visual Studio, before each build process, make sure the configuration for these 4 build processes are consistent, i.e Release and Win32 are recommende for 32-bit windows machine, Release and x64 for 64-bit windows machine.

Install MapGuide Server and MapGuide Web Extension

You don't have to follow below instructions to install MapGuide Server and MapGuide Web Application, the installation of these two components are just moving and organizing files around, nothing fancy, which can be seen from "build.bat". After successful building, MapGuide Server should be able to brought up and running from where it is built, i.e. bin folder, though you still need to configure web server to access the mapviewer from a browser, which requires the advanced knowledge of the entire project.

Apache and PHP must be installed before the web component of MapGuide can be installed. The process of installing MapGuide's web component is to copy mod_mgmapagent.so and other MapGuide libraries to Apache modules and PHP extensions.

  1. On 32-bit windows machine
    cd c:\mgdev
    build.bat -o=c:\mapguideopensource-2.2 -a=install -w=server
    build.bat -o=c:\mapguideopensource-2.2 -a=install -w=web
    
  2. On 64-bit windows machine
    cd c:\mgdev
    build64.bat -o=c:\mapguideopensource-2.2 -a=install -w=server
    build64.bat -o=c:\mapguideopensource-2.2 -a=install -w=web
    

your final installation should look like:

c:\mapguideopensource-2.2\Server
c:\mapguideopensource-2.2\Web\www
c:\mapguideopensource-2.2\CS-Map

Note 1: these two batch files might be out-of-date, if you are working on trunk code, the chances are bugs or issues might be introduced by developers, so look into the file with a text editor to see what it does to decide how to use or edit it to install mapguide server in your system.

Testing Installation

  1. Create a environment variable MENTOR_DICTIONARY_PATH, which points to <path to CsMap>\Dictionaries
  1. Start MapGuide Server
    cd <path to mgserver.exe>
    mgserver.exe run
    
  1. Configure and Start Web Extensions
  1. Open a browser to http://localhost:8008/mapguide/phpviewersample/ajaxviewersample.php

Troubleshooting

  • Most of the problems during building are path issues. in Visual Studio, right click a project name from the project explorer tree, open properties windows, check links, dependencies, libraries for clues
  • mgserver throws an error mg_resources.res, locale "en" can not be found: caused by the wrong values of path properties in webconfig.ini and serverconfig.ini.
Last modified 7 years ago Last modified on Sep 8, 2010 2:19:07 PM

Attachments (1)

Download all attachments as: .zip