Browse Source

Added script to download UWP HEVC package

pull/703/head
Dmitry Nefedov 2 months ago
parent
commit
8291224ffa
  1. 29
      .github/workflows/HEVC.yml
  2. 50
      Scripts/HEVC.ps1
  3. 2
      src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1

29
.github/workflows/HEVC.yml

@ -0,0 +1,29 @@
name: Download HEVC
on:
workflow_dispatch:
permissions:
contents: write
jobs:
download-and-save:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Download HEVC package
run: |
. "Scripts\HEVC.ps1"
- name: Commit and push changes
run: |
# Save Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx to HEVC folder
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add HEVC/Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx
git commit -m "Update Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
git push

50
Scripts/HEVC.ps1

@ -0,0 +1,50 @@
# https://store.rg-adguard.net
# https://apps.microsoft.com/detail/9N4WGH0Z6VHQ
if (-not (Test-Path -Path HEVC))
{
New-Item -Path HEVC -ItemType Directory -Force
}
try
{
$Body = @{
type = "url"
url = "https://apps.microsoft.com/detail/9N4WGH0Z6VHQ"
ring = "Retail"
lang = "en-US"
}
$Parameters = @{
Uri = "https://ru.store.rg-adguard.net/api/GetFiles"
Method = "Post"
ContentType = "application/x-www-form-urlencoded"
Body = $Body
UseBasicParsing = $true
Verbose = $true
}
$Raw = Invoke-WebRequest @Parameters
}
catch [System.Net.WebException]
{
Write-Verbose -Message "Connection could not be established with https://store.rg-adguard.net" -Verbose
exit 1 # Exit with a non-zero status to fail the job
}
# Get a temp URL
$TempURL = $Raw.Links.href | Sort-Object -Property Length -Descending | Select-Object -First 1
if (-not $TempURL)
{
Write-Verbose -Message "https://store.rg-adguard.net does not output correct URL" -Verbose
exit 1 # Exit with a non-zero status to fail the job
}
# Download archive
$Parameters = @{
Uri = $TempURL
OutFile = "HEVC\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
Verbose = $true
UseBasicParsing = $true
}
Invoke-WebRequest @Parameters

2
src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1

@ -580,7 +580,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check SecurityHealthService service
try
{
Get-Service -Name SecurityHealthService -ErrorAction Stop | Start-Service -ErrorAction Stop -ErrorAction Stop
Get-Service -Name SecurityHealthService -ErrorAction Stop | Start-Service -ErrorAction Stop
}
catch
{

Loading…
Cancel
Save