-1

I'm new in Azure Devops. I want to install Desktop App Converter (DAC) to Azure Devops to make possible auto convert msi file to window store appx. Note, DAC is also window store application. First I've create powershell script (see below) that must do two steps:

  1. Installs DAC converter using add-appxpackage command

  2. Generate appx package based on msi file using DesktopAppConverter.exe call

It worked fine for me: DesktopAppConverter was installed and package was generated.

On Aure Devops I've created build pipeline with powershell task. This task execute the same actions as I've on my local machine. For job executing I've used Microsoft-hosted agent.

My YAML is:

    # .NET Desktop

    trigger:
    - master

    pool:
      vmImage: 'windows-latest'

    variables:
      solution: '**/*.sln'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Release'


    steps:

    - task: PowerShell@2
      inputs:
        filePath: 'convert.ps1'

Powershell script convert.ps1

    add-appxpackage -path         Microsoft.DesktopAppConverter_2.1.4.0_x64__8wekyb3d8bbwe.Appx
    DesktopAppConverter.exe -Installer MyApplication.msi -Destination Appx05 -PackageName "MyCompany.MyApplication"  -Publisher "CN=12345678-1234-1234-1234-123456789012" -PackagePublisherDisplayName "MyCompany" -PackageDisplayName  "MyApplication" -Version 1.0.14.0 -MakeAppx -Verbose

Execution of add-appxpackage has no error. On executing DesktopAppConverter.exe having such error:

    DesktopAppConverter.exe : The term 'DesktopAppConverter.exe' is not 
    recognized as the name of a cmdlet, function, script file, or operable 
    program. Check the spelling of the name, or if a path was included, 
    verify that the path is 
    correct and try again.

Base on this message it's possible to say that DAC was not installed in fact. Also, there is no Desktop App Converter package in powershell command Get-Appxpackage output.

I've also created the sampe pipeline and executed it using self-hosted agent, executing agent on my PC. DAC was installed and executed.

So, on the current step I've got the main question: is it possible to install DAC using Microsoft-hosted agent ? I haven't see any reason why it's couldn't be possible. Azure Pipeline provides me a virtual machine during job executing period (and than vm instance discarded). So In theory I could do everything with it and install appx as well. I've successfully installed program on Microsoft-hosted agent's VM. Why I couldn't do it with appx from store ?

Also I've got some other questions. I'm sure DAC was not installed. That means it was problem during installation. When I've installed on my PC and having a problem, I've seen an error message in console window. I haven't seen eny errors on failed DAC install on Azure (but it was one error on system couldn't find DAC executing file). I've not find any errors about failed installation in eventlogs and logs files as well. So, why I couldn't see any error although DAC was not installed ? The other thing is: the steps above I've done on Microsoft Azure devops that Microsoft provides for free trial. When I've try to do the same steps on our production Azure devpos, there where no error on both install DAC step and execute DAC step (appx was not generated).

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
constant
  • 57
  • 1
  • 6
  • Where did you install `DesktopAppConverter` on the agent? If not, did you try to find a way to install it yourself? If so, did you have a problem? What problem? Stack Overflow is a place where people will *help* you solve problems that you're having trouble solving yourself, not outright solve your problems for you. – Daniel Mann May 08 '19 at 19:50
  • Note: I'm newbie in Azure Devops. I've tried to install DesktopAppConverter in powershell script convert.ps1 which is called by task of build pipeline (see YAML and powershell listing above). I've this is a wrong way please tell me. What is correct way to install it in Azure Devops. – constant May 08 '19 at 20:04
  • @Daniel Mann also I've try to solve the problem during last 36 hours (minus 4 ours sleep). And as I understand, If I run tak in pipeline it runs by agent isnt't it ? – constant May 08 '19 at 20:35

1 Answers1

0

How to install windows store package Desktop App Coverter (DAC) in Azure Devops

According to the document Package a desktop application using the Desktop App Converter:

We have to:

  1. Download and install the Desktop App Converter.
  2. Run the Desktop App Converter as an administrator.

And need set a few things up (apps with installers only).

Since you are using agent vmImage: 'windows-latest', if this agent is a hosted agent, it does not install this app, then you will get the error that you have got:

The term 'DesktopAppConverter.exe' is not recognized as the name of a cmdlet, function, script file, or operable program

If agent vmImage: 'windows-latest' is a private agent, make sure you have install the Desktop App Converter and set it run with administrator.

Note: If you install the Desktop App Converter, you will find the DesktopAppConverter.exe at location: C:\Users\<UserName>\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppConverter_8wekyb3d8bbwe

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Leo @Liu-MSFT, thanks for Your answer. So as I understand I'm using hosted agent. I see Pool: Hosted Windows 2019 with VS2019. Agent: Hosted Agent. So does it mean that it is not posslible to install Desktop App Converter at all ? So, do I need to use a priavate agent in my case ? I couldn't find the term "private agent". Is a private agent the same as "Self-hosted" agent ? – constant May 09 '19 at 12:09
  • 1
    Update. I've tried to use self-hosted agent, starting agent on my pc configuring agent pool and starting job on Azure Devops. And DAC was successfully installed on my pc. So may be it will be the solution in case if I'll not find something more complex. But. Let's ask another question: is it possible to install dac using Microsoft hosing agent ? I've tried to install sample program using msi installer on Microsoft hosting agent and it was installed successfully. And I wonder why I couldn't install appx packet. – constant May 09 '19 at 13:40
  • @constant, Sorry for the late reply, I just came back from my weekend. Yes, the private agent the same as "Self-hosted" agent. – Leo Liu May 13 '19 at 01:42