Skip to content

Commit

Permalink
getappx
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Apr 26, 2024
1 parent 7780598 commit 4833f4f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
30 changes: 30 additions & 0 deletions getappx.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Download-Appx($Name) {
$obj = Invoke-WebRequest -Uri "https://store.xr6.xyz/api/GetFiles" `
-Method "POST" `
-ContentType "application/x-www-form-urlencoded" `
-Body @{
type = 'PackageFamilyName'
url = $Name + '_8wekyb3d8bbwe'
ring = 'RP'
lang = 'zh-CN'
}

foreach ($link in $obj.Links) {
if ($link.outerHTML -match '(?<=<a\b[^>]*>).*?(?=</a>)') {
$linkText = $Matches[0]
if ($linkText -match '(x64|neutral).*\.(appx|appxbundle|msixbundle)\b') {
Write-Debug "$linkText : $($link.href)"
if (Test-Path -Path $linkText) {
Write-Warning "Already exists, skiping $linkText"
} else {
Invoke-WebRequest -Uri $link.href -OutFile "$PSScriptRoot\msstore\$linkText"
}
}
}
}
}
Remove-Item -Path "$PSScriptRoot\msstore" -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path "$PSScriptRoot\msstore" -ErrorAction SilentlyContinue

Download-Appx 'Microsoft.DesktopAppInstaller'
Download-Appx 'Microsoft.WindowsStore'
20 changes: 11 additions & 9 deletions msupdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ expand -f:* ".\fod\Miracast\update.cab" ".\fod\Miracast\"
.\bin\aria2c.exe --check-certificate=false -x16 -s16 -d ".\fod\MiracastLP\" -o "update.cab" "https://file.uhsea.com/2404/907cdd078f41d9b8ca0615b5c1557790S1.cab"
expand -f:* ".\fod\Miracast\update.cab" ".\fod\MiracastLP\"

# get msstore
.\getappx.ps1

# abbodi1406/W10UI, auto inject hook after resetbase
(Invoke-WebRequest -Uri "https://raw.githubusercontent.com/abbodi1406/BatUtil/master/W10UI/W10UI.cmd").Content.Replace("if %AddDrivers%==1 call :doDrv","call %~dp0hook.cmd") | Out-File -FilePath ".\W10UI.cmd"

Expand All @@ -73,10 +76,9 @@ if ($?) {Write-Host "System Image Download Successfully!"} else {Write-Error "Sy
."C:\Program Files\7-Zip\7z.exe" x ".\temp\$osfile" -o".\ISO" -r

# select professional edition only
$WIMEditionID = "Professional"
.\bin\wimlib-imagex.exe info ".\ISO\sources\install.wim" --extract-xml ".\temp\WIMInfo.xml"
$WIMInfo = [xml](Get-Content ".\temp\WIMInfo.xml")
$WIMIndex = $WIMInfo.WIM.IMAGE | Where-Object {$_.WINDOWS.EDITIONID -eq $WIMEditionID} | Select-Object -ExpandProperty INDEX
$WIMIndex = $WIMInfo.WIM.IMAGE | Where-Object {$_.WINDOWS.EDITIONID -eq "Professional"} | Select-Object -ExpandProperty INDEX
$WIMIndexs = $WIMInfo.WIM.IMAGE.Index | Measure-Object | Select-Object -ExpandProperty Count
for ($i = 1; $i -le $WIMIndexs; $i++) {
if ($i -ne $WIMIndex) {
Expand Down Expand Up @@ -142,13 +144,13 @@ echo ============================================================
echo Updating Microsoft Store...
echo ============================================================
@rem for %%a in (%~dp0msstore\Microsoft.UI.Xaml.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.VCLibs.140.00.UWPDesktop_14.0.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.VCLibs.140.00_14.0.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.NET.Native.Runtime.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.NET.Native.Framework.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.WindowsStore_*_8wekyb3d8bbwe.Msixbundle) do call :Add-ProvisionedAppxPackage `"%%a`"
@rem ffor %%a in (%~dp0msstore\Microsoft.DesktopAppInstaller_*_8wekyb3d8bbwe.Msixbundle) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.UI.Xaml.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.VCLibs.140.00.UWPDesktop_14.0.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.VCLibs.140.00_14.0.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.NET.Native.Runtime.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.NET.Native.Framework.2.*_8wekyb3d8bbwe.Appx) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.WindowsStore_*_8wekyb3d8bbwe.Msixbundle) do call :Add-ProvisionedAppxPackage `"%%a`"
for %%a in (%~dp0msstore\Microsoft.DesktopAppInstaller_*_8wekyb3d8bbwe.Msixbundle) do call :Add-ProvisionedAppxPackage `"%%a`"
exit /b
Expand Down

0 comments on commit 4833f4f

Please sign in to comment.