From 3a485ce33afa576bdb63bcdb76cd937118e13db5 Mon Sep 17 00:00:00 2001 From: mkuba50 Date: Tue, 19 Dec 2017 21:03:19 +0100 Subject: [PATCH] 17063 specific fix With build 17063 Microsoft has removed all UUP editions except CORE and PROFESSIONAL. This fix maps removed editions to their substitutes that were not removed, modifies the base pack to use some Enterprise edition files for Professional due to new dependencies and removes no longer existing editions from packs array. --- get.php | 15 +++++++++++ shared/main.php | 2 +- shared/packs.php | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/get.php b/get.php index db436e1..d85fbc9 100644 --- a/get.php +++ b/get.php @@ -78,6 +78,21 @@ function uupGetFiles($updateId = 'c2a1d787-647b-486d-b264-f90f3782cdc6', $usePac $info = json_decode($info, true); } + if(isset($info['build'])) { + $build = explode('.', $info['build']); + $build = $build[0]; + } else { + $build = 9841; + } + + if($build >= 17063) { + $packs = $packs17063; + + if(isset($editionMap[$desiredEdition])) { + $desiredEdition = $editionMap[$desiredEdition]; + } + } + if($desiredEdition == 'UPDATEONLY') { if(!isset($info['containsCU']) || !$info['containsCU']) { return array('error' => 'NOT_CUMULATIVE_UPDATE'); diff --git a/shared/main.php b/shared/main.php index 1007640..3b5d05d 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.6.3'; + return '1.6.4'; } function uupApiPrintBrand() { diff --git a/shared/packs.php b/shared/packs.php index 53acf75..b99d54f 100644 --- a/shared/packs.php +++ b/shared/packs.php @@ -307,4 +307,72 @@ $fancyLangNames = array( 'zh-cn' => 'Chinese (Simplified)', 'zh-tw' => 'Chinese (Traditional)', ); + +// 17063 and newer builds specific fix +// Base pack +$packs17063 = array(); +$packs17063[0]['editionNeutral'] = $packs[0]['editionNeutral']; +$packs17063[0]['CORE'] = array( + 'Microsoft-Windows-EditionPack-Core-Package', + 'Microsoft-Windows-EditionPack-Core-WOW64-Package', + 'Microsoft-Windows-EditionPack-Core-arm64arm-Package', + 'Microsoft-Windows-EditionSpecific-Core-Package', + 'Microsoft-Windows-EditionSpecific-Core-WOW64-Package', + 'Microsoft-Windows-EditionSpecific-Core-arm64arm-Package', + 'Microsoft\.ModernApps\.Client\.All', + 'Microsoft\.ModernApps\.Client\.core\.', +); +$packs17063[0]['PROFESSIONAL'] = array( + 'Microsoft-Windows-EditionPack-Enterprise-Package', + 'Microsoft-Windows-EditionPack-Enterprise-WOW64-Package', + 'Microsoft-Windows-EditionPack-Enterprise-arm64arm-Package', + 'Microsoft-Windows-EditionSpecific-Enterprise-Package', + 'Microsoft-Windows-EditionSpecific-Enterprise-WOW64-Package', + 'Microsoft-Windows-EditionSpecific-Enterprise-arm64arm-Package', + 'Microsoft\.ModernApps\.Client\.All', + 'Microsoft\.ModernApps\.Client\.professional', +); + +// European "N" Editions +$packs17063[1]['COREN'] = array( + 'Microsoft-Windows-EditionPack-Core-Package', + 'Microsoft-Windows-EditionPack-Core-WOW64-Package', + 'Microsoft-Windows-EditionPack-Core-arm64arm-Package', + 'Microsoft-Windows-EditionSpecific-CoreN-Package', + 'Microsoft-Windows-EditionSpecific-CoreN-WOW64-Package', + 'Microsoft-Windows-EditionSpecific-CoreN-arm64arm-Package', + 'Microsoft\.ModernApps\.ClientN\.All', +); +$packs17063[1]['PROFESSIONALN'] = array( + 'Microsoft-Windows-EditionPack-Enterprise-Package', + 'Microsoft-Windows-EditionPack-Enterprise-WOW64-Package', + 'Microsoft-Windows-EditionPack-Enterprise-arm64arm-Package', + 'Microsoft-Windows-EditionSpecific-EnterpriseN-Package', + 'Microsoft-Windows-EditionSpecific-EnterpriseN-WOW64-Package', + 'Microsoft-Windows-EditionSpecific-EnterpriseN-arm64arm-Package', + 'Microsoft\.ModernApps\.ClientN\.All', +); + +// Other packs mirrored from pre-17063 packs +$packs17063[2] = array(); +$packs17063[3] = $packs[3]; +$packs17063[4] = $packs[4]; +$packs17063[5] = $packs[5]; +$packs17063[6] = $packs[6]; +$packs17063[7] = $packs[7]; + +// Edition map to avoid larger changes in API +$editionMap = array( + 'CLOUD' => 'PROFESSIONAL', + 'CLOUDN' => 'PROFESSIONALN', + 'CORE' => 'CORE', + 'COREN' => 'COREN', + 'CORESINGLELANGUAGE' => 'CORE', + 'EDUCATION' => 'PROFESSIONAL', + 'EDUCATIONN' => 'PROFESSIONALN', + 'ENTERPRISE' => 'PROFESSIONAL', + 'ENTERPRISEN' => 'PROFESSIONALN', + 'PROFESSIONAL' => 'PROFESSIONAL', + 'PROFESSIONALN' => 'PROFESSIONALN', +); ?>