Ignac96
Ignac96

Reputation: 53

Installing .vsix extension for Visual Studio on GitHub Action Server

I have to deal with .Net 4 legacy project that was poorly maintained and designed. Production deployment consist on installing RazorGenerator .vsix extension to Visual Studio -> compiling project -> manual copying .dll file from bin folder to IIS folder on server.

I want to automatize deployment. I found Powershell Script for installing vsix that I run using command:

powershell.exe -noexit "& 'D:\a\testtest\testtest\Scripts\install.ps1'"

Unfortunately it freezes at the moment of installing extension on Github Action server. Moment that GitHub Action Freezes

I checked script on my desktop and durning "Installing DavidEbbo.RazorGenerator..." User Account Control window appears asking for permission to install this extension so that might be a problem.

Is there any possibility of accepting UAC, turn it off or installing extension on GitHub Action Server?

Upvotes: 1

Views: 342

Answers (1)

gcode
gcode

Reputation: 2989

I want to try answering this after spending quite a lot of time troubleshooting installing a different VSIX extension on a GitHub Runner.

The first item I want to address is how to best install extensions on a GitHub Runner. You can use Scott's script that you linked to in your question, although what might be more preferable is using a GitHub Action where microcompiler adapted Scott's script.

The second item I want to address is the UAC prompt you noticed. The InstallVsix executable that we all use to install extensions typically assumes that it's being run on a desktop computer, with a user interface and a user to interact with it. It has a /Admin command line argument, which according to documentation will install an extension to the "admin extensions location". Visual Studio does indeed seem to have a level of separation between computer/admin data and user data. In practice on GitHub Runners though, this has little relevance as far as I can tell. On Windows, the GitHub Runner has UAC disabled and your script is run under the Administrators group so the /Admin switch is effectively redundant and you can just run InstallVsix as-is. To verify, try running a CLI instance as Administrator on your computer, then run the InstallVsix executable without the /Admin switch and it should install without prompting for anything.

The final point, the apparent freezing - chances are it's still working, just taking a long time. I'm currently troubleshooting why, although at this point, I can say that you just have to give it anywhere from 10-20 minutes to complete. As a hint, VsixInstaller will create very verbose logs about what's doing, stored in your user's %TEMP% directory and with the format of dd_*.log. You can use actions/upload-artifact to capture and upload these logs for further review.

Upvotes: 0

Related Questions