Skip to content

Commit

Permalink
wa: add universal approach to retrieve VS version
Browse files Browse the repository at this point in the history
Change-Id: Ibbad555120d42d60b6b32e687312bc04a8c22ac6
  • Loading branch information
DavDiva committed Feb 12, 2025
1 parent 2dc8808 commit 0b4973d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 7 additions & 4 deletions agents/wnx/parallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# TODO: make output visible after job starting
# TODO: make diagnostic better
# 2023 (c) Checkmk GmbH
#
#

$make_exe = $Env:make_exe
if ( "$make_exe" -eq "" ) {
Expand All @@ -13,14 +13,17 @@ if ( "$make_exe" -eq "" ) {

$msbuild_exe = $Env:msbuild_exe
if ( "$msbuild_exe" -eq "" ) {
msbuild_exe = "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\msbuild.exe"
$msbuild_exe = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest `
-requires Microsoft.Component.MSBuild `
-find MSBuild\**\Bin\MSBuild.exe
}

$sln = (Get-Item -Path ".\").FullName + "\wamain_build.sln" # 'repo\check_mk\agents\wnx\wamain.sln'
$makefile = (Get-Item -Path ".\").FullName + "\Makefile"
$makefile = (Get-Item -Path ".\").FullName + "\Makefile"
$host_dir = (Get-Item -Path ".\").FullName
$cmk_agent_ctl_dir = (Get-Item -Path ".\").FullName + "\..\..\packages\host\cmk-agent-ctl"
# string below is used to quckly switch to the Powershell ISE, do not delete it
# string below is used to quickly switch to the Powershell ISE, do not delete it
# $sln = 'c:\z\m\check_mk\agents\wnx\wamain.sln'

$platforms = "Configuration=Release,Platform=x86", "Configuration=Release,Platform=x64"
Expand Down
8 changes: 6 additions & 2 deletions agents/wnx/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ $argExt = $false
$argSql = $false
$argDetach = $false

$msbuild_exe = "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\msbuild.exe"
$repo_root = (get-item $pwd).parent.parent.FullName
$msbuild_exe = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest `
-requires Microsoft.Component.MSBuild `
-find MSBuild\**\Bin\MSBuild.exe

$repo_root = (get-item $pwd).parent.parent.FullName
$arte = "$repo_root/artefacts"
$build_dir = "$pwd/build"
$ohm_dir = "$build_dir/ohm/"
Expand Down

0 comments on commit 0b4973d

Please sign in to comment.