Is it possible to automate building the installer using GitHub Actions? This is a VSTO add-in solution containing several .NET projects and one "Visual Studio Installer Project" (a.k.a. vdproj
). I need to build the installer project upon commit to a particular branch.
Build installer using GitHub Actions
989 Views Asked by dotNET At
2
There are 2 best solutions below
0

If you are running this on a VS2019 build
jobs:
build:
runs-on: windows-2019
you may need to apply the registry hack that addresses the error
------ Starting pre-build validation for project 'YourInstaller' ------
ERROR: An error occurred while validating. HRESULT = '8000000A'
Thanks to the information provided in this link Building VDProj I have copied the suggested Powershell script into a github action to fix the registry for the version of Visual Studio being used.
The script just adds a Registry entry in the correct location for the version of Visual Studio in use and sets a registry entry EnableOutOfProcBuild to 0.
- name: DisableOutOfProc Fix
run: |
function Invoke-DisableOutOfProcBuild {
param ();
$visualStudioWherePath = ('{0}/Microsoft Visual Studio/Installer/vswhere.exe' -f ${Env:ProgramFiles(x86)});
$visualStudioInstallationPath = & $visualStudioWherePath -latest -products 'Microsoft.VisualStudio.Product.Enterprise' -property 'installationPath';
$currentWorkingDirectory = ('{0}/Common7/IDE/CommonExtensions/Microsoft/VSI/DisableOutOfProcBuild' -f $visualStudioInstallationPath);
Set-Location -Path $currentWorkingDirectory;
$disableOutOfProcBuildPath = ('{0}/DisableOutOfProcBuild.exe' -f $currentWorkingDirectory);
& $disableOutOfProcBuildPath;
return;
}
Invoke-DisableOutOfProcBuild
Yes, it is possible.
First of all, make sure the environment is Windows:
To build VSTO solution, you will have to import the pfx certificate first:
Then build the VSTO using msbuild:
And build the Visual studio installer project: