DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Release Pipeline Using Azure DevOps
  • Using Azure DevOps Pipeline With Gopaddle for No-Code Kubernetes Deployments
  • Mule 4 Continuous Integration Using Azure DevOps
  • Mulesoft Cloudhub Deployment using Azure DevOps

Trending

  • Navigating Change Management: A Guide for Engineers
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices
  • Building an AI/ML Data Lake With Apache Iceberg
  • Advancing Robot Vision and Control
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Enabling CI-CD and Generating MSI Installations

Enabling CI-CD and Generating MSI Installations

In this series, we will demonstrate about the capabilities of Azure DevOps for CI-CD in software management.

By 
Aritra Nag user avatar
Aritra Nag
·
May. 11, 20 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
13.1K Views

Join the DZone community and get the full member experience.

Join For Free

In this blog series, We will demonstrate the capabilities of Azure DevOps for CI-CD in software management.

Following points will be addressed in the document:

  • Basic CI-CD flow with C# software in Azure DevOps service
  • Generation of MSI installation with “WIX” package installation
  • “Out of the box” tasks in the azure pipeline to schedule timely releases, email the artifacts, generate code coverage and create GitHub release

Technical Specs

We will require some basic hands-on knowledge on the following items:

  • XAML and Wix Installer
  • Azure DevOps
  • Basic CD-CI knowledge for C# software and git

Prerequisite

We will require access to the following items:

  • Microsoft Azure Cloud
  • GitHub repository with C# Code

High-Level Design

There are so many discussions around automation and DevOps going on over the past few years. From my point of view, one of the most charming features of DevOps is you can deploy and automate the whole process.

Here is the basic flow of CD using Git and Azure DevOps services,

A screenshot of a cell phone

Description automatically generated

For Azure DevOps to be incorporated in the software, similar to any cloud CD solution we need to drive the pipeline through a single file(azure-pipeline.yml in our case).

There are the following items which are useful in the whole pipeline:

  • Stage: showcases the information on which type of pipeline is being executed. E.g: Dev build or Release build
  • Trigger: enables if the pipeline depends on any git branch or any package of a git branch
  • Variables: once defined in the top, can be used across the pipeline in the single run. Useful for generating incremental number in the release.
  • Pool: adding the information on the location or image on software to be executed.
  • Steps: provides the clarity on the pipeline on which cycles does the code needs to go through before final MSI generation
  • Task: various activity which needs to be performed on the software is assigned under task. E.g: running a batch script, MSI installation, etc.
  • Schedules: In case of time-based or scheduled releases, this can be used to generate a cron expression or  user-defined scenario                 
code block
code block

The following activities are done in the above sample application.

  1. Triggers when any developers check in the code in the master branch
  2. Generating automated incremental release number and stores it in variable
  3. Downloads the latest code from Git Branch
  4. C# Nuget Restore command to download the packages
  5. Building the solution with MSBuild Command via the sln file
  6. Download the Test Case installation package and Code Coverage generation package
  7. Execute the Test Cases via VSTest Suite task and generate the results
  8. Publish the Code Coverage and Test Case result.
  9. Run the MSI Installation Command line to generate exe via the “Wix” package.
  10. Upload the MSI package in an artifact
  11. (Optional) Create a Git Release for the code and share the Release Notes.
  12. (Optional) Email the link of the artifact via the “send email” task.

We can define cron expression if we need to release the build in a specific timeline.

Here is sample example to be executed daily at 4 PM and 12 PM EST and will build from the master branch

code block

GitHub Release

We can release the code build from the pipeline after successful execution and share the release notes to others via email. Following is the task which can be added after the publishing of the artifact.

code block

WIX Installation

There are many ways of generating MSI packages for Windows applications. E.g: Vdproj, Wix
Definition of MSI: It is an installer package file format used by Windows. Its name comes from the program’s original title, Microsoft Installer, which has since changed to Windows Installer. MSI files are used for installation, storage, and removal of programs. The files are contained in a package, which is used with the program’s client-side installer service, an an.EXE file, to open and install the program.

We will showcase the power of “WIX” services in the blog to generate the MSI.

Here is a basic example of the sample WIX file which needs to be present in the source code:

sample WIX files

All the tags present in the xml file and explanations for the same can be found in the below link.

https://wixtoolset.org/documentation/

Once we run the below mentioned commands for Wix from the pipeline, it will generate the MSI and publish the same.

  • “%WIX%bin\candle” *.wxs -o obj\
  • “%WIX%bin\light” obj\*.wixobj -o bin\CommandLineInstaller.msi

Explanation and Binaries of the above are given in the below link.

https://github.com/wixtoolset/wix3

Conclusion

In the above blog, we have showcased the capabilities of Azure DevOps for enabling CD and CI.

Many other things can be incorporated with the pipeline and we can use the environment and test artifact generation services to handle the releases more efficiently.

azure Release (computing) Continuous Integration/Deployment Pipeline (software) Code coverage DevOps

Published at DZone with permission of Aritra Nag. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Release Pipeline Using Azure DevOps
  • Using Azure DevOps Pipeline With Gopaddle for No-Code Kubernetes Deployments
  • Mule 4 Continuous Integration Using Azure DevOps
  • Mulesoft Cloudhub Deployment using Azure DevOps

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!