Skip to content

Commit eaa7302

Browse files
committed
Update Build Harden System Security for Store.yml
1 parent 8eabc10 commit eaa7302

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

.github/workflows/Build Harden System Security for Store.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,44 @@ jobs:
3333

3434
steps:
3535

36-
- name: Updating Winget
37-
shell: pwsh
38-
run: |
39-
try {
40-
Write-Host -Object 'The version of the pre-installed Winget on the Runner:'
41-
Write-Host -Object (winget --version)
42-
}
43-
catch {
44-
Write-Host -Object 'Winget is not installed.'
45-
}
46-
47-
# Retrieve the latest Winget release information
48-
$WingetReleases = Invoke-RestMethod -Uri 'https://api.github.com/repos/microsoft/winget-cli/releases'
49-
$LatestRelease = $WingetReleases | Select-Object -First 1
50-
# Direct links to the latest Winget release assets
51-
[string]$WingetURL = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('.msixbundle') } | Select-Object -First 1
52-
[string]$WingetLicense = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('License1.xml') } | Select-Object -First 1
53-
[string]$LatestWingetReleaseDependenciesZipURL = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('DesktopAppInstaller_Dependencies.zip') } | Select-Object -First 1
54-
[hashtable]$Downloads = @{
55-
# 'Winget.msixbundle' = 'https://aka.ms/getwinget' This is updated slower than the GitHub release
56-
'DesktopAppInstaller_Dependencies.zip' = $LatestWingetReleaseDependenciesZipURL
57-
'Winget.msixbundle' = $WingetURL
58-
'License1.xml' = $WingetLicense
59-
}
60-
$Downloads.GetEnumerator() | ForEach-Object -Parallel {
61-
Invoke-RestMethod -Uri $_.Value -OutFile $_.Key
62-
}
63-
64-
Expand-Archive -Path 'DesktopAppInstaller_Dependencies.zip' -DestinationPath .\ -Force
65-
# Get the paths to all of the dependencies
66-
[string[]]$DependencyPaths = (Get-ChildItem -Path .\x64 -Filter '*.appx' -File -Force).FullName
67-
68-
# Required to update the Winget
69-
Stop-Process -Name 'WindowsTerminal' -Force -ErrorAction Ignore
70-
71-
Add-AppxProvisionedPackage -Online -PackagePath 'Winget.msixbundle' -DependencyPackagePath $DependencyPaths -LicensePath 'License1.xml'
72-
73-
Add-AppPackage -Path 'Winget.msixbundle' -DependencyPath "$($DependencyPaths[0])", "$($DependencyPaths[1])" -ForceTargetApplicationShutdown -ForceUpdateFromAnyVersion
36+
# - name: Updating Winget
37+
# shell: pwsh
38+
# run: |
39+
# try {
40+
# Write-Host -Object 'The version of the pre-installed Winget on the Runner:'
41+
# Write-Host -Object (winget --version)
42+
# }
43+
# catch {
44+
# Write-Host -Object 'Winget is not installed.'
45+
# }
46+
#
47+
# # Retrieve the latest Winget release information
48+
# $WingetReleases = Invoke-RestMethod -Uri 'https://api.github.com/repos/microsoft/winget-cli/releases'
49+
# $LatestRelease = $WingetReleases | Select-Object -First 1
50+
# # Direct links to the latest Winget release assets
51+
# [string]$WingetURL = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('.msixbundle') } | Select-Object -First 1
52+
# [string]$WingetLicense = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('License1.xml') } | Select-Object -First 1
53+
# [string]$LatestWingetReleaseDependenciesZipURL = $LatestRelease.assets.browser_download_url | Where-Object -FilterScript { $_.EndsWith('DesktopAppInstaller_Dependencies.zip') } | Select-Object -First 1
54+
# [hashtable]$Downloads = @{
55+
# # 'Winget.msixbundle' = 'https://aka.ms/getwinget' This is updated slower than the GitHub release
56+
# 'DesktopAppInstaller_Dependencies.zip' = $LatestWingetReleaseDependenciesZipURL
57+
# 'Winget.msixbundle' = $WingetURL
58+
# 'License1.xml' = $WingetLicense
59+
# }
60+
# $Downloads.GetEnumerator() | ForEach-Object -Parallel {
61+
# Invoke-RestMethod -Uri $_.Value -OutFile $_.Key
62+
# }
63+
#
64+
# Expand-Archive -Path 'DesktopAppInstaller_Dependencies.zip' -DestinationPath .\ -Force
65+
# # Get the paths to all of the dependencies
66+
# [string[]]$DependencyPaths = (Get-ChildItem -Path .\x64 -Filter '*.appx' -File -Force).FullName
67+
#
68+
# # Required to update the Winget
69+
# Stop-Process -Name 'WindowsTerminal' -Force -ErrorAction Ignore
70+
#
71+
# Add-AppxProvisionedPackage -Online -PackagePath 'Winget.msixbundle' -DependencyPackagePath $DependencyPaths -LicensePath 'License1.xml'
72+
#
73+
# Add-AppPackage -Path 'Winget.msixbundle' -DependencyPath "$($DependencyPaths[0])", "$($DependencyPaths[1])" -ForceTargetApplicationShutdown -ForceUpdateFromAnyVersion
7474

7575
- name: Installing the necessary programs # Builds the Harden System Security application securely with 0 usage of 3rd party tools, workflows and such.
7676
shell: pwsh

0 commit comments

Comments
 (0)