From 5e2936879210d5386c5ae2da1b050dfde8d71a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E8=8F=B2?= Date: Fri, 15 Mar 2024 16:25:35 +0800 Subject: [PATCH] test --- .github/workflows/container.yml | 71 ++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index a83fd189..a710fece 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -36,9 +36,76 @@ jobs: Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 git config --system core.longpaths true $PSVersionTable.PSVersion - Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_community.exe' -OutFile 'vs_community.exe' - .\vs_community.exe --installPath 'C:\Program Files\Microsoft Visual Studio\' --passive --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended + # Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_community.exe' -OutFile 'vs_community.exe' + # .\vs_community.exe --installPath 'C:\Program Files\Microsoft Visual Studio\' --passive --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended + # Get-ChildItem -Path 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\' + + + + + echo "--------------------Install Microsoft.UI.Xaml-------------------" + $SourceUrl = "https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3" + $DestinationFile = ".\microsoft.ui.xaml.2.7.3.zip" # 保存到当前目录并保持.nupkg扩展名 + $ExtractDirectory = ".\uixaml" + + # 创建目标解压目录(如果不存在) + if (!(Test-Path -Path $ExtractDirectory)) { + New-Item -ItemType Directory -Path $ExtractDirectory | Out-Null + } + + # 下载.nupkg文件 + Invoke-WebRequest -Uri $SourceUrl -OutFile $DestinationFile + + # 解压.nupkg文件到指定目录(PowerShell 5.0及以上版本支持) + Expand-Archive -Path $DestinationFile -DestinationPath $ExtractDirectory + Copy-Item -Path .\uixaml\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx -Destination . + Add-AppxPackage -Path .\Microsoft.UI.Xaml.2.7.appx + echo "------------------------Install vclibs--------------------------" + Invoke-WebRequest -Uri 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx' -OutFile '.\Microsoft.VCLibs.x64.14.00.Desktop.appx' + Add-AppxPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx + echo "---------------------Install winget------------------------" + Invoke-WebRequest -Uri 'https://github.com/microsoft/winget-cli/releases/download/v1.6.3421/65f132d72c1d44518a19d1a9c3de8e1f_License1.xml' -OutFile '.\65f132d72c1d44518a19d1a9c3de8e1f_License1.xml' + Invoke-WebRequest -Uri 'https://github.com/microsoft/winget-cli/releases/download/v1.6.3421/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' -OutFile '.\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' + Add-AppxPackage .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle + Add-AppxProvisionedPackage -Online -Package .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -LicensePath .\65f132d72c1d44518a19d1a9c3de8e1f_License1.xml + echo "---------------Install VisualStudio.2022---------------------- " + + #winget install --source winget --id Microsoft.VisualStudio.2022.Community --override "--quiet --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended" + winget install --source winget --id Microsoft.VisualStudio.2022.Community --override "--installPath 'C:\Program Files\Microsoft Visual Studio\' --passive --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended" + winget install --source winget --id Microsoft.VisualStudio.2022.Community --override "--installPath 'C:\Program Files\Microsoft Visual Studio\' --passive --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended" + winget install --source winget --id Microsoft.VisualStudio.2022.Community --override "--installPath 'C:\Program Files\Microsoft Visual Studio\' --passive --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --includeRecommended" + + echo "----------------------Install sdk 8-------------------------------" Get-ChildItem -Path 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # - name: Modifying the registry # shell: powershell # run: |-