Update windows.yml

This commit is contained in:
TheTank20 2023-07-08 21:11:34 -05:00 committed by GitHub
parent 5919f112e7
commit f633c2aff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 13 deletions

View File

@ -17,14 +17,15 @@ jobs:
- name: Restore cached v141_xp - name: Restore cached v141_xp
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
with: with:
path: "D:\\a\\VSLayout" path: "C:\\Users\\runneradmin\\VSLayout"
key: v141_xp key: v141_xp
# https://github.com/actions/runner-images/issues/6067#issuecomment-1213069040 # https://github.com/actions/runner-images/issues/6067#issuecomment-1213069040
- name: Download v141_xp - name: Download v141_xp
run: | run: |
if (Test-Path -Path "D:\a\VSLayout\Microsoft.Windows.XPSupport.Msi,version=11.0.51106.1,chip=x64\Win_XPSupport64.msi") { if (Test-Path -Path "C:\Users\runneradmin\VSLayout\Microsoft.Windows.XPSupport.Msi,version=11.0.51106.1,chip=x64\Win_XPSupport64.msi") {
Write-Host "components already downloaded" Write-Host "components already downloaded"
Get-ChildItem C:\Users\runneradmin\VSLayout\Microsoft.Windows.XPSupport.*
exit 0 exit 0
} }
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
@ -34,12 +35,12 @@ jobs:
) )
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_} [string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
Invoke-WebRequest -URI "https://aka.ms/vs/17/release/vs_enterprise.exe" -OutFile "D:\a\_temp\vs_enterprise.exe" Invoke-WebRequest -URI "https://aka.ms/vs/17/release/vs_enterprise.exe" -OutFile "D:\a\_temp\vs_enterprise.exe"
$Arguments = ('/c', 'D:\a\_temp\vs_enterprise.exe', '--layout', 'D:\a\VSLayout', $workloadArgs, '--quiet') $Arguments = ('/c', 'D:\a\_temp\vs_enterprise.exe', '--layout', 'C:\Users\runneradmin\VSLayout', $workloadArgs, '--quiet')
$process = Start-Process -FilePath "cmd" -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden $process = Start-Process -FilePath "cmd" -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) if ($process.ExitCode -eq 0)
{ {
Write-Host "components have been successfully downloaded" Write-Host "components have been successfully downloaded"
Get-ChildItem D:\a\VSLayout\Microsoft.Windows.XPSupport.* exit 0
} }
else else
{ {
@ -55,7 +56,7 @@ jobs:
"Microsoft.VisualStudio.Component.WinXP" "Microsoft.VisualStudio.Component.WinXP"
) )
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_} [string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', 'D:\a\VSLayout\vs_enterprise.exe', 'modify', '--installPath', "`"$InstallPath`"", $workloadArgs, '--quiet', '--norestart', '--nocache', '--noweb', '--wait') $Arguments = ('/c', 'C:\Users\runneradmin\VSLayout\vs_enterprise.exe', 'modify', '--installPath', "`"$InstallPath`"", $workloadArgs, '--quiet', '--norestart', '--nocache', '--noweb', '--wait')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) if ($process.ExitCode -eq 0)
{ {
@ -67,14 +68,7 @@ jobs:
Write-Host "components were not installed" Write-Host "components were not installed"
exit 1 exit 1
} }
$logProcess = Start-Process -FilePath "D:\a\xpmgr\xpmgr\BuildTools\Collect.exe" -Wait -PassThru -WindowStyle Hidden
- name: Upload Installer Log
uses: actions/upload-artifact@v3.1.2
with:
name: installer_log
path: "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\vslogs.zip"
- name: Setup MSBuild - name: Setup MSBuild
uses: microsoft/setup-msbuild@v1 uses: microsoft/setup-msbuild@v1
@ -99,5 +93,5 @@ jobs:
- name: Cache v141_xp - name: Cache v141_xp
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: D:\a\VSLayout path: C:\Users\runneradmin\VSLayout
key: v141_xp key: v141_xp