Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Building The CLI

Japheth Obala edited this page Jul 13, 2020 · 12 revisions

Building the Windows MSI

This document provides instructions on creating the MSI.

Prerequisites

See setting up your build environment for more prerequisites.

  1. Python

  2. virtualenv

  3. autorest -- Install the beta version with npm i -g @autorest/autorest

  4. Turn on '.NET Framework 3.5' Windows feature

  5. Install 'WIX Toolset build tools' if not already installed. (e.g. WiX v3.10.3) http://wixtoolset.org/releases/. This is optional as the build scripts download the toolset.

  6. Git

  7. Install 'Microsoft Build Tools 2015'. https://www.microsoft.com/download/details.aspx?id=48159

  8. chocolatey install curl & chocolatey install unzip

  9. Clone the repository.

Note: The above can be done on a Windows 10 VM.

Building

  1. Create your virtual environment with virtualenv venv and cd to ./venv/scripts and run ./activate.bat.

  2. cd into src/msgraph-cli-core, src/msgraph-cli and src/msgraph-core and run python setup.py sdist bdist_wheel

  3. Generate and build the CLI extensions for Microsoft Graph. First run python generate_extensions.py from the repo root. This will generate the CLI extension using autorest-beta. Now we need to build the extensions. Run python build_extensions.py. This will results in a distributable wheel file.

  4. Set the CLI_VERSION environment variable. For example, $env:CLI_VERSION = '0.1.0' if using PowerShell and set CLI_VERSION=0.1.0 if using CMD.

  5. Run build_scripts\windows\scripts\build.cmd.

  6. The unsigned MSI will be in the .\out folder.

Clone this wiki locally