1

I have a Visual Studio setup project. Normally I use the Microsoft Visual Studio Installer Projects extension, and run an MSBuild Exec task with command line using devenv. This works on my dev box and my existing build machine. However I'm looking to migrate to a hosted pipeline agent using the VS2017 image.

I was hoping the installer extension might already be installed, so I tried my build and got an error:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com" "D:\a\2\s\Source\Build..\WindowsFormsApp1\WindowsFormsApp1.sln" /Build "Debug" /Project "Setup1" /ProjectConfig "Debug" /Log

The operation could not be completed. The parameter is incorrect.

I tried adding the VSIX to my repo, and then issuing a command line install of the VSIX as such:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" /a /quiet /log:MyTestApp.log D:\a\2\s\Source\Build\InstallerProjects.vsix

However that seems to block for about 10 minutes, and then fails with an error (I suspect the UI is blocking even though I used the /quiet arg to suppress the UI):

... exited with code -2146233088.

Is there any way to build a Visual Studio installer project using a MS-hosted pipeline agent?

Community
  • 1
  • 1
randbrown
  • 560
  • 2
  • 7
  • 17
  • There is an open feature request in Developer Community for this: https://developercommunity.visualstudio.com/idea/382210/add-support-to-build-installer-project-vdproj-in-a.html – alxnull Jan 07 '20 at 22:28
  • When I look at the marketplace page for the VSIX.. they do say: For modern deployment targeting Windows 10 you can also use the [Windows Packaging Project](https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net) to create APPX and/or MSIX packages. Since my MSI is straightforward, maybe it's time I learn it – bkwdesign Dec 03 '20 at 15:53

1 Answers1

1

How to build Visual Studio Installer Project in Azure Devops Pipeline Hosted Agent

AFAIK, I am afraid we could not build Visual Studio Installer Project in Azure Devops Pipeline Hosted Agent at this moment.

I encountered a similar issue two weeks ago, after a period of investigation, I started to try the same idea as you, using command line to install the Microsoft Visual Studio Installer Projects extension.

However, I got the timeout issue. I could not install that extension on the hosted agent. To test the reason for this, I use the same command lien to installed that extension on another local machine. Indeed, there is a UI window to confirm if you want to install this extension, even after I give the /admin parameter:

Check the options here.

Then I try to open the command line with Administrator and execute the same command line, it can successfully install that extension. So, I want to execute the command line in the Azure DevOps pipeline. But no success. Because we could not execute command line script as admin using Command Line Script task.

It seems we have to set our private agent.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    I recommend Microsoft add this extension (Microsoft Visual Studio Installer Projects) to the hosted pipeline agent images, or make available a build tool installer task to install it properly. (Or is there a way for me to do it with a custom build task?) – randbrown Mar 05 '19 at 14:21
  • 1
    @randbrown This project type is/was deprecated and it's use is discouraged by microsoft, therefore this capability won't be added to the hosted pipeline agents because you are not supposed to use this. BUT you might be able to install this with a custom build task, i think there are some parameters when installing *.vsix to install them silently without any UI popup but i am not sure tbh – D.J. Mar 13 '19 at 08:52