How to configure an Advanced Installer build step in a TeamCity pipeline

Written by Ciprian Burca · November 26th, 2021 · 5min read

#DEVELOPERS #DEVOPS

When developing software, the codebase is always growing, making it difficult to navigate. Software engineers use continuous integration (CI) technologies like TeamCity to address this.

TeamCity is a popular Java-based Continuous Integration solution for easily creating automated pipelines.

It enables you to combine the source code from two distinct Version Control Systems (VCS) into a single build, as well as automate portions of the testing process to reduce the need for manual testing.

We already showed you “How to configure an Advanced Installer build step in a Jenkins pipeline” and now we will go through how to do it in a TeamCity pipeline.

Now let’s see how you can figure Advanced Installer build steps in a TeamCity pipeline.

1. Install the plugin for TeamCity

We are proud to announce the official Advanced Installer plugin for TeamCity. Before we start configuring Advanced Installer in the TeamCity pipeline, download the latest version of the plugin from our GitHub releases archive. Make sure to choose the advinst-teamcity-plugin-<ver>.zip asset.

Advanced Installer Teamcity Plugin

To install the previously downloaded ZIP file, navigate to the TeamCity Administration -> Plugins List section and use the Upload plugin zip button.

Upload Plugin Teamcity

2. Install the Advanced Installer tool

Switch to the Administration -> Tools section, use the Install Tool button, and select Advanced Installer from the dropdown list.

Install Advanced Installer Tool

Next, you will be prompted to choose which Advanced Installer version you want to install. Select one and click Add.

Choose Advanced Installer Version

NoteThe Set as Default option means that this particular version of the tool will be used by default in a new Advanced Installer build step.

In cases where you need to use different versions of the tool in your pipelines, you can add them by using the Install Version button.

Install Different Version

After you complete these steps, you will notice that the Advanced Installer tool is available in the pipelines.

3. Build an Advanced Installer project as a pipeline step

Now that the Advanced Installer tool is configured, we will use it to build an Advanced Installer project file (AIP) as part of a pipeline. To add a new build step, go to the Build Steps section of your project configuration and use the Add build step button.

Add Build Step

Select the Advanced Installer option from the drop-down list.

Add Advanced Installer build step

Aside from the default TeamCity options which are common to all the steps, an Advanced Installer build step has three main sections:

  1. Advanced Installer Tool
  2. Plugin Run Type
  3. Advanced Installer Project Settings

Let's take a look at each of them.

3.1 Configure plugin run type

The plugin has two operating modes that offer flexibility and accommodate all usage scenarios.

Plugin Operating Modes

3.1.1 Deploy Advanced Installer tool

In this scenario, the plugin will:

  1. Deploy Advanced Installer
  2. Register it using the provided License ID
  3. Enable PowerShell support, if specified.

This option is helpful when using Advanced Installer from PowerShell scripts or directly from the command line.

ImportantAfter the Advanced Installer tool deployment, the advancedinstaller.tool variable will hold the full path.

3.1.2 Deploy the Advanced Installer tool and build the project

In this scenario, the plugin will:

  1. Deploy Advanced Installer
  2. Register it using the provided License ID
  3. Enable PowerShell support, if specified.
  4. Build the AIP configured in the Advanced Installer Project section

Now, let’s configure the Advanced Installer tool.

3.2 Configure the Advanced Installer tool

In this section, we will choose a version from the list we configured in the previous step and provide your License ID to register on the build agent.

Configure Advanced Installer Tool

3.2.1 Choose version

Choose a version of the tool from the drop-down list. If none is selected, the default version will be chosen.

Choose tool’s version

The last item on the list is <Custom>. By using this option, you can specify your own path to an Advanced Installer root directory on the build agent. This is useful when you're using the same agent and you want to skip the tool setup when executing the pipeline.

3.2.2 License ID

In this field, you should enter the License ID you received when you purchased your Advanced Installer license.

Providing a license is not necessary for our freewareSimple project type.

We offer Free Advanced Installer License for bloggers and Open-Source projects. Also, feel free to share this with your community members.

3.2.3 Enable PowerShell support

By enabling this option you will be able to use Advanced Installer from a PowerShell script. This support relies on a COM interface registered on the agent during the pipeline.

ImportantIf you are referencing an Advanced Installer version prior to 17.7, the agent needs to run with elevated privileges to register the COM interface. Versions 17.7 and later do not have this restriction.

3.3 Configure Your Advanced Installer Project

Now let’s see how to configure the Advanced Installer project file to be built during the pipeline.

  1. AIP Path holds the path project file. This field is mandatory.
  2. AIP Build holds the project build to be executed. If the field is empty, the Default Build project will be performed.
  3. The Output file and Output folder fields are where you can configure the project output.
  4. In the Commands field, you can enter a list of commands supported by the Advanced Installer command-line interface.
  5. The Do not digitally sign package option will force skip the digital sign step, even if it is configured in the project. This option is useful when debugging build scenarios.
Configure Advanced Installer Project

Conclusion

Now you know how to set up an Advanced Installer build step into your TeamCity pipeline.

If you are a Jenkins user, check out our tutorial to see how to configure the Advanced Installer build step in a Jenkins pipeline.

Don’t forget about the Free Advanced Installer License for bloggers and Open-Source projects. More info here.

Subscribe to Our Newsletter

Sign up for free and be the first to receive the latest news, videos, exclusive How-Tos, and guides from Advanced Installer.

Comments: