dimitrisudell
Posts: 2
Joined: Fri May 15, 2020 2:08 pm

Azure "Tool Installer" post-job task does not respect condition

Fri May 15, 2020 2:29 pm

Hello,

I am trying to use Advanced Installer in an Azure Pipeline. I have installed the task extension "Advanced Installer Tool Installer" and added the following code to my "azure-pipelines.yml" configuration

Code: Select all

- task: AdvancedInstallerTool@1
  displayName: 'Windows: Install Advanced Installer'
  condition: eq(variables['agent.os'], 'Windows_NT')
When run on a Windows agent the task condition evaluates as "true" and Advanced Installer is installed as expected.

When run on a non-Windows agent the task condition evaluates as "false" and the task is skipped. However "AdvancedInstallerTool" also has in implicit "post-job" task which does not respect the condition and will always run. Failing with the following error on non-Windows agents

Code: Select all

##[error]Only Windows systems are supported.
As I understand, this must be fixed in the task extension. I cannot explicitly control the "post-job" task from the config file.

Please let me know if you need any further explanation.

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: Azure "Tool Installer" post-job task does not respect condition

Mon May 18, 2020 12:41 pm

Hello Dimitri and welcome to Advanced Installer forums,

This seems to be a bug in the Microsoft's library which we are currently using:

Postjobexecution hook executed despite task being excluded by a condition

I have already forwarded this to our development team and we will try to replace this library with a newer on in which the bug has been fixed. Thank you for bringing this to our attention.

I will update this thread as soon as the issue will be fixed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

dimitrisudell
Posts: 2
Joined: Fri May 15, 2020 2:08 pm

Re: Azure "Tool Installer" post-job task does not respect condition

Mon May 18, 2020 5:16 pm

Thanks a lot for the quick reply!

After posting my message I realised I can use the Chocolatey package manager instead. For my case this seems to be adequate. I'm now successfully using AdvancedInstaller on Azure Pipelines.

Here's the code incase it's helpful for anyone else

Code: Select all

- bash: choco install advanced-installer
  displayName: 'Windows: Install Advanced Installer'
  condition: eq(variables['agent.os'], 'Windows_NT')

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: Azure "Tool Installer" post-job task does not respect condition

Tue May 19, 2020 3:40 pm

Hello Dimitri,

Thank you very much for your followup on this and for sharing your solution with us.

I am sure this will come in handy for further users facing a similar scenario.

Additionally, I wanted to let you know that we have already fixed this.

If I'm not mistaken, at the first run of the pipeline, the extension should be automatically updated and this should be fixed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: Azure "Tool Installer" post-job task does not respect condition

Tue Jun 09, 2020 10:50 am

Hello Dimitri,

This has been fixed in version 17.1 of Advanced Installer, released on May 27th, 2020.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”