diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index b1ffe1f75..773442105 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -429,6 +429,10 @@ function Build-PackageManagementEnvironmentTable { @{ "Name" = "VCPKG_INSTALLATION_ROOT" "Value" = $env:VCPKG_INSTALLATION_ROOT + }, + @{ + "Name" = "VCPKG_ROOT" + "Value" = $env:VCPKG_ROOT } ) | ForEach-Object { [PSCustomObject] @{ diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index 731de8b1b..39823e42f 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -4,16 +4,17 @@ ## Desc: Installs vcpkg ################################################################################ -# Set env variable for vcpkg -VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg -echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment +# Set env variables for vcpkg +VCPKG_ROOT=/usr/local/share/vcpkg +echo "VCPKG_INSTALLATION_ROOT=${VCPKG_ROOT}" | tee -a /etc/environment +echo "VCPKG_ROOT=${VCPKG_ROOT}" | tee -a /etc/environment # Install vcpkg -git clone https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT +git clone https://github.com/Microsoft/vcpkg $VCPKG_ROOT -$VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh -$VCPKG_INSTALLATION_ROOT/vcpkg integrate install -chmod 0777 -R $VCPKG_INSTALLATION_ROOT -ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin +$VCPKG_ROOT/bootstrap-vcpkg.sh +$VCPKG_ROOT/vcpkg integrate install +chmod 0777 -R $VCPKG_ROOT +ln -sf $VCPKG_ROOT/vcpkg /usr/local/bin invoke_tests "Tools" "Vcpkg" \ No newline at end of file diff --git a/images/macos/provision/core/vcpkg.sh b/images/macos/provision/core/vcpkg.sh index a1ac7c254..70e3371fa 100644 --- a/images/macos/provision/core/vcpkg.sh +++ b/images/macos/provision/core/vcpkg.sh @@ -1,15 +1,16 @@ #!/bin/bash -e -o pipefail source ~/utils/utils.sh -# Set env variable for vcpkg -VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg -echo "export VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a ~/.bashrc +# Set env variables for vcpkg +VCPKG_ROOT=/usr/local/share/vcpkg +echo "export VCPKG_INSTALLATION_ROOT=${VCPKG_ROOT}" | tee -a ~/.bashrc +echo "export VCPKG_ROOT=${VCPKG_ROOT}" | tee -a ~/.bashrc # Install vcpkg -git clone https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT -$VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh -$VCPKG_INSTALLATION_ROOT/vcpkg integrate install -chmod -R 0777 $VCPKG_INSTALLATION_ROOT -ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin +git clone https://github.com/Microsoft/vcpkg $VCPKG_ROOT +$VCPKG_ROOT/bootstrap-vcpkg.sh +$VCPKG_ROOT/vcpkg integrate install +chmod -R 0777 $VCPKG_ROOT +ln -sf $VCPKG_ROOT/vcpkg /usr/local/bin invoke_tests "Common" "vcpkg" diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index b18206f6d..01955e019 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -562,6 +562,10 @@ function Build-PackageManagementEnvironmentTable { @{ "Name" = "VCPKG_INSTALLATION_ROOT" "Value" = $env:VCPKG_INSTALLATION_ROOT + }, + @{ + "Name" = "VCPKG_ROOT" + "Value" = $env:VCPKG_ROOT } ) | ForEach-Object { [PSCustomObject] @{ diff --git a/images/win/scripts/Installers/Install-Vcpkg.ps1 b/images/win/scripts/Installers/Install-Vcpkg.ps1 index 76e7d24f5..a2e440dd1 100644 --- a/images/win/scripts/Installers/Install-Vcpkg.ps1 +++ b/images/win/scripts/Installers/Install-Vcpkg.ps1 @@ -17,5 +17,6 @@ Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install" Add-MachinePathItem $InstallDir $env:Path = Get-MachinePath setx VCPKG_INSTALLATION_ROOT $InstallDir /M +setx VCPKG_ROOT $InstallDir /M Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg" diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 1c36a9844..25aa98471 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -347,6 +347,10 @@ function Build-PackageManagementEnvironmentTable { @{ "Name" = "VCPKG_INSTALLATION_ROOT" "Value" = $env:VCPKG_INSTALLATION_ROOT + }, + @{ + "Name" = "VCPKG_ROOT" + "Value" = $env:VCPKG_ROOT } ) if (Test-IsWin19) { diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index 0f4a36846..a05f79249 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -153,9 +153,13 @@ Describe "Vcpkg" { It "env variable VCPKG_INSTALLATION_ROOT is set" { $env:VCPKG_INSTALLATION_ROOT | Should -Not -BeNullOrEmpty } + + It "env variable VCPKG_ROOT is set" { + $env:VCPKG_ROOT | Should -Not -BeNullOrEmpty + } - It "VCPKG_INSTALLATION_ROOT directory" { - $env:VCPKG_INSTALLATION_ROOT | Should -Exist + It "VCPKG_ROOT directory" { + $env:VCPKG_ROOT | Should -Exist } }