Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrevi committed Mar 12, 2024
1 parent 218e948 commit 2d6acd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions scripts/config_test_vm.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ function Install-eBPFComponentsOnVM
[Parameter(Mandatory=$true)] [bool] $KmTracing,
[Parameter(Mandatory=$true)] [string] $KmTraceType)
$WorkingDirectory = "$env:SystemDrive\$WorkingDirectory"
Write-Host "Working Directory: $WorkingDirectory"
Import-Module $WorkingDirectory\common.psm1 -ArgumentList ($LogFileName) -Force -WarningAction SilentlyContinue
Import-Module $WorkingDirectory\install_ebpf.psm1 -ArgumentList ($WorkingDirectory, $LogFileName) -Force -WarningAction SilentlyContinue

Expand Down
17 changes: 7 additions & 10 deletions scripts/install_ebpf.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,15 @@ function Install-eBPFComponents
# Install the Visual C++ Redistributable.
try {
Write-Host "Installing Visual C++ Redistributable from '$VcRedistPath'..."
if (-not (Test-Path $VcRedistPath)) {
Write-Host "Visual C++ Redistributable not found at '$VcRedistPath'."
exit 1;
}
$process = Start-Process -FilePath $VcRedistPath -ArgumentList "/quiet", "/norestart" -Wait
if ($process.ExitCode -ne 0) {
Write-Host "Visual C++ Redistributable installation failed. Exit code: $($process.ExitCode)"
exit 1;
& "Path\To\VcRedist.exe" /quiet /norestart
$exitCode = $LASTEXITCODE
if ($exitCode -eq 0) {
Write-Host "Visual C++ Redistributable installation completed successfully."
} else {
Write-Host "Visual C++ Redistributable installation failed. Exit code: $exitCode"
}
} catch {
Write-Host "An error occurred while installing Visual C++ Redistributable: $_"
exit 1;
Write-Host "An exception occurred while installing Visual C++ Redistributable: $_"
}
Write-Host "Cleaning up..."
Remove-Item $VcRedistPath -Force
Expand Down

0 comments on commit 2d6acd8

Please sign in to comment.