1
votes

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?

1
There is an open feature request in Developer Community for this: developercommunity.visualstudio.com/idea/382210/…alxnull
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 to create APPX and/or MSIX packages. Since my MSI is straightforward, maybe it's time I learn itbkwdesign

1 Answers

1
votes

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.