Skip to content

Windows Build Process

Ross Philipson edited this page Sep 25, 2015 · 36 revisions

DO NOT EDIT: This page has been migrated to Confluence: https://openxt.atlassian.net/wiki/display/OD/How+to+build+OpenXT#HowtobuildOpenXT-Windowsbuildprocess

This page describes how the Windows build process operates and to run a build you must do so on a Windows Build machine. If you have not yet set one of these up, follow the Setup Build Environment instructions, otherwise you can skip to Getting Started.

Setup Build Environment

Install Windows on whatever machine / VM you plan to work in. I think that most people end up using Window 7 32bit. Once you have Windows installed, make sure that everything is up-to-date (control panel->system and security->check for updates).

You should now have a barebones, Windows environment. You will need to install the following to get things up and running:

  • Git
  • DbgView (optional)

Note that once you have this installed, you will run a set of scripts that will download and install a whole bunch of software for you automatically, so the above is all you need to do manually. Also note that this setup script takes a while, so make sure you give yourself enough time.

Git

http://git-scm.com/download/win

Once you have downloaded the latest version of Git for Windows, start the install process. Use all of the defaults except the following:

  • "Adjusting your PATH environment" == "Use Git and optional Unix tools from the Windows Command Prompt".
  • "Configuring the line ending conversions" == "Checkout Windows-style, commit Unix-style line endings"

DbgView

https://technet.microsoft.com/en-us/library/bb896647.aspx

Download and unzip onto your desktop. Once on your desktop, right click the icon, and select "properties". Then select the "compatibility" tab, and then check "run this program as an administrator" and select "ok". Admin rights are needed to see debug statements from the kernel.

Next, open DbgView. From the "capture" menu, check the following:

  • Capture Global Win32
  • Capture Kernel
  • Enable Verbose Kernel Output (should be optional)

Now if you close DbgView and then re-open it, these settings should still be there, ready and waiting.

mkbuildmachine

The rest of the build machine can be installed using a power shell script that is located in the OpenXT git repo.

git clone https://github.com/OpenXT/openxt.git

Use the [following page](Windows Build Machine) for instructions for how to setup Windows, and eventually run this script to get everything else up and running.

Getting Started

Note that everything is done using Windows Power Shell (using admin rights). It can be found here: Start Menu->All Programs->Accessories->Windows Power Shell->Windows Power Shell

Having set up a build machine, everything is ready for you to perform a build. Within the git repository "openxt.git" is everything you need to compile all of the Windows components and package them. To get this process started check out openxt.git to any location on the build machine and navigate into the "windows" folder:

mkdir C:\Somewhere
c:
cd \Somewhere
git clone https://github.com/OpenXT/openxt.git

NOTE: DO NOT CLONE INTO A PATH CONTAINING SPACES BECAUSE THE BUILD WILL FAIL DUE TO XC-WINDOWS' RELIANCE ON THE WINDDK.

Contents of openxt/windows

Within this directory is everything that is required to drive the windows build:

  • winbuild-all.ps1 - Actually does and manages the build
  • winbuild-prepare.ps1 - prepares the system for a build
  • configs directory - stores config files to dictate how the build operates
  • BuildSupport directory - Additional scripts to be used as sub-steps of/support for the build
    And additional bits:
  • mkbuildmachine directory - The scripts you used to [create your build machine](Windows Build Machine)

Installing your development certificates

When using developement signing certificates and keys as outlined on the [Windows Build Machine](Windows Build Machine) page, the certificates need to be imported to the certificate store on the target system. For 32b systems this is optional but it is required on 64b ones. On the target machine do the following:

Open a command prompt with right click and "Run as Administrator". Run the following and reboot:

bcdedit /set testsigning on

Get a copy of your test signing certificate file. This will be found in the location where you ran makecert.bat (developer.cer in our examples). Open a command prompt with right click and "Run as Administrator". Run the following and reboot:

certutil -addstore -f "Root" developer.cer
certutil -addstore -f "TrustedPublisher" developer.cer

Not you can install the test signed tools package.

Running a build

To run a complete build, the script winbuild-prepare.ps1 must be used first to generate the config.xml file, followed by the winbuild-all.ps1 script. For example:

c:
cd \Somewhere\openxt\windows
powershell .\winbuild-prepare.ps1 config=sample-config.xml build=123456 branch=master certname=developer developer=true
powershell .\winbuild-all.ps1

Where developer is the name of the signing certificate.

Verification of your build

In Windows Explorer right click and select properties on C:\Somewhere\openxt\windows\msi-installer\iso\windows\setup.exe. There should be a tab called Digital Signatures and you should see the name of your certificate ("developer" in our example).

Installing your tools on an OpenXT VM

The output from the build should end up in a file like this:

C:\Somewhere\openxt\windows\output\xctools-iso.zip

The easiest way to test your Windows build is to copy the zip file on to an OpenXT Windows VM, expand it and run the windows\setup.exe file which should install files.

NOTE: that unattendedInstall.bat has references to certificates in windows\SupportFiles which would need to be updated to install the certificate you used to build.

Windows ISO

An enhancement to the Windows build is being added to cause the Windows build scripts to also generate an ISO. The ISO file ends up in $Outdir\xc-wintools.iso with the rest of the Windows build output. It of course only contains the Windows specific guest tools.

The change requires the mkisofs Cygwin package to be installed. If you use the scripts to setup a build machine after the feature is in, you will get this automatically. On older build machines the ISO step will be skipped so as not to break existing kit.

If you want to manually add mkisofs to your existing build machine, you need to rerun the Cygwin installer which you can find here:

https://www.cygwin.com/setup-x86.exe

Run it, take the default options until you get to the package selector. The installer will detect what you already have so you can just check new packages and install them. The mkisofs is found in several places including under the "Utils" list.