Fix incorrect --ref
Detect Windows 11 edition name
Add fix for Server Core editions
Add support for virtual editions CloudEdition, CloudEditionN
This commit is contained in:
abbodi1406
2021-10-10 03:53:49 +03:00
parent 0fe85aa08a
commit e49ca44015
2 changed files with 315 additions and 52 deletions

View File

@ -1111,6 +1111,208 @@ VE_IOTENTERPRISE_CONTENTID='4b1412af-12ad-0bbd-177e-6f7579c8600f'
VE_IOTENTERPRISE_PRINT='1'
VE_IOTENTERPRISE_INSECURE='0'
#CloudEdition
VE_CLOUDEDITION_DP=':00000 A4 00 00 00 03 00 00 00 30 30 34 37 35 2D 38 30
:00010 30 30 30 2D 30 30 30 30 30 2D 41 41 38 39 39 00
:00020 96 12 00 00 5B 43 6F 5D 58 32 32 2D 35 33 38 34
:00030 37 00 00 00 96 12 00 00 00 00 E0 2F 4E 1C FB 11
:00040 24 1C 09 00 00 00 00 00 60 D8 86 60 7B 38 2C A6
:00050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000A0 75 77 B4 71 '
VE_CLOUDEDITION_DP4=':00000 F8 04 00 00 04 00 00 00 35 00 35 00 30 00 34 00
:00010 31 00 2D 00 30 00 34 00 37 00 35 00 38 00 2D 00
:00020 30 00 30 00 30 00 2D 00 30 00 30 00 30 00 30 00
:00030 30 00 30 00 2D 00 30 00 30 00 2D 00 31 00 30 00
:00040 33 00 33 00 2D 00 31 00 39 00 30 00 34 00 32 00
:00050 2E 00 30 00 30 00 30 00 30 00 2D 00 31 00 31 00
:00060 36 00 32 00 30 00 32 00 31 00 00 00 00 00 00 00
:00070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00080 00 00 00 00 00 00 00 00 39 00 32 00 66 00 62 00
:00090 38 00 37 00 32 00 36 00 2D 00 39 00 32 00 61 00
:000A0 38 00 2D 00 34 00 66 00 66 00 63 00 2D 00 39 00
:000B0 34 00 63 00 65 00 2D 00 66 00 38 00 32 00 65 00
:000C0 30 00 37 00 34 00 34 00 34 00 36 00 35 00 33 00
:000D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00110 00 00 00 00 00 00 00 00 43 00 6C 00 6F 00 75 00
:00120 64 00 45 00 64 00 69 00 74 00 69 00 6F 00 6E 00
:00130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00320 00 00 00 00 00 00 00 00 96 12 00 00 00 00 E0 2F
:00330 4E 1C FB 11 24 1C 09 00 63 69 72 E5 F0 D6 3C 60
:00340 8B A9 3E 47 20 66 4C 38 58 B9 91 E1 CC 7A 27 77
:00350 80 E0 18 E8 25 B3 AE 1F 30 14 8C 66 F7 E5 B0 BE
:00360 F9 DC A0 12 F8 2B 09 3D 63 50 ED 21 B5 0A EB CA
:00370 55 A8 1C EC D4 7A D9 4F 5B 00 43 00 6F 00 5D 00
:00380 58 00 32 00 32 00 2D 00 35 00 33 00 38 00 34 00
:00390 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003F0 00 00 00 00 00 00 00 00 52 00 65 00 74 00 61 00
:00400 69 00 6C 00 00 00 00 00 00 00 00 00 00 00 00 00
:00410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00470 00 00 00 00 00 00 00 00 52 00 65 00 74 00 61 00
:00480 69 00 6C 00 00 00 00 00 00 00 00 00 00 00 00 00
:00490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004F0 00 00 00 00 00 00 00 00 '
VE_CLOUDEDITION_PID='00475-80000-00000-AA899'
VE_CLOUDEDITION_EDITIONID='CloudEdition'
VE_CLOUDEDITION_PFN='Microsoft.Windows.203.X22-53847_8wekyb3d8bbwe'
VE_CLOUDEDITION_CONTENTID='cc260727-8d42-5c4c-3c2f-f093008dcd9a'
VE_CLOUDEDITION_PRINT='0'
VE_CLOUDEDITION_INSECURE='1'
#CloudEditionN
VE_CLOUDEDITIONN_DP=':00000 A4 00 00 00 03 00 00 00 30 30 34 37 36 2D 32 30
:00010 30 30 30 2D 30 30 30 30 30 2D 41 41 39 34 36 00
:00020 9A 12 00 00 5B 43 6F 5D 58 32 32 2D 35 33 38 38
:00030 34 00 00 00 9A 12 00 00 00 00 08 3F 35 E1 4B D1
:00040 E6 1C 09 00 00 00 00 00 DF D8 86 60 0A 6F 75 8A
:00050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000A0 07 5C B3 74'
VE_CLOUDEDITIONN_DP4=':00000 F8 04 00 00 04 00 00 00 35 00 35 00 30 00 34 00
:00010 31 00 2D 00 30 00 34 00 37 00 36 00 32 00 2D 00
:00020 30 00 30 00 30 00 2D 00 30 00 30 00 30 00 30 00
:00030 30 00 30 00 2D 00 30 00 30 00 2D 00 31 00 30 00
:00040 33 00 33 00 2D 00 31 00 39 00 30 00 34 00 32 00
:00050 2E 00 30 00 30 00 30 00 30 00 2D 00 31 00 31 00
:00060 36 00 32 00 30 00 32 00 31 00 00 00 00 00 00 00
:00070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00080 00 00 00 00 00 00 00 00 64 00 34 00 62 00 64 00
:00090 63 00 36 00 37 00 38 00 2D 00 30 00 61 00 34 00
:000A0 62 00 2D 00 34 00 61 00 33 00 32 00 2D 00 61 00
:000B0 35 00 62 00 33 00 2D 00 61 00 61 00 61 00 32 00
:000C0 34 00 63 00 33 00 62 00 30 00 66 00 32 00 34 00
:000D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:000F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00110 00 00 00 00 00 00 00 00 43 00 6C 00 6F 00 75 00
:00120 64 00 45 00 64 00 69 00 74 00 69 00 6F 00 6E 00
:00130 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:001F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:002F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00320 00 00 00 00 00 00 00 00 9A 12 00 00 00 00 08 3F
:00330 35 E1 4B D1 E6 1C 09 00 FF C3 8A 76 E8 92 BD 57
:00340 EA DF AD E6 E9 36 A5 5C E1 50 99 31 73 EE 18 B0
:00350 32 CE 8E 37 56 92 B1 6E 46 BE 16 AE CC 3D AE ED
:00360 B0 18 82 E3 74 A0 EF F0 DA 53 37 24 3C ED 35 3B
:00370 56 2C 33 7E 86 4D CC EA 5B 00 43 00 6F 00 5D 00
:00380 58 00 32 00 32 00 2D 00 35 00 33 00 38 00 38 00
:00390 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:003F0 00 00 00 00 00 00 00 00 52 00 65 00 74 00 61 00
:00400 69 00 6C 00 00 00 00 00 00 00 00 00 00 00 00 00
:00410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:00470 00 00 00 00 00 00 00 00 52 00 65 00 74 00 61 00
:00480 69 00 6C 00 00 00 00 00 00 00 00 00 00 00 00 00
:00490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
:004F0 00 00 00 00 00 00 00 00'
VE_CLOUDEDITIONN_PID='00476-20000-00000-AA946'
VE_CLOUDEDITIONN_EDITIONID='CloudEditionN'
VE_CLOUDEDITIONN_PFN='Microsoft.Windows.202.X22-53884_8wekyb3d8bbwe'
VE_CLOUDEDITIONN_CONTENTID='c7cfb460-bc9b-b32a-69b3-acf52bd6fa48'
VE_CLOUDEDITIONN_PRINT='0'
VE_CLOUDEDITIONN_INSECURE='1'
function generateChntpwScript() {
echo "cd \Microsoft\Windows NT\CurrentVersion
nv 3 DigitalProductId
@ -1248,6 +1450,23 @@ function getChntpwScript() {
"$VE_PROFESSIONALWORKSTATIONN_PRINT" \
"$VE_PROFESSIONALWORKSTATIONN_INSECURE"
return 0
elif [ "$1" == "CloudEdition" ]; then
generateChntpwScript "$VE_CLOUDEDITION_DP" \
"$VE_CLOUDEDITION_DP4" \ "$VE_CLOUDEDITION_PID" \
"$VE_CLOUDEDITION_EDITIONID" "$VE_CLOUDEDITION_PFN" \
"$VE_CLOUDEDITION_CONTENTID" "$VE_CLOUDEDITION_PRINT" \
"$VE_CLOUDEDITION_INSECURE"
return 0
elif [ "$1" == "CloudEditionN" ]; then
generateChntpwScript "$VE_CLOUDEDITIONN_DP" \
"$VE_CLOUDEDITIONN_DP4" "$VE_CLOUDEDITIONN_PID" \
"$VE_CLOUDEDITIONN_EDITIONID" "$VE_CLOUDEDITIONN_PFN" \
"$VE_CLOUDEDITIONN_CONTENTID" \
"$VE_CLOUDEDITIONN_PRINT" \
"$VE_CLOUDEDITIONN_INSECURE"
return 0
elif [ "$1" == "CoreSingleLanguage" ]; then
generateChntpwScript "$VE_CORESINGLELANGUAGE_DP" \
@ -1312,51 +1531,27 @@ function createVirtualEdition() {
edition="$1"
minBuild=17063
if [ "$edition" == "Enterprise" ]; then
if [ "$edition" == "Enterprise" -o "$edition" == "Education" -o "$edition" == "ProfessionalEducation" -o "$edition" == "ProfessionalWorkstation" -o "$edition" == "ServerRdsh" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 Enterprise"
elif [ "$edition" == "EnterpriseN" ]; then
elif [ "$edition" == "EnterpriseN" -o "$edition" == "EducationN" -o "$edition" == "ProfessionalEducationN" -o "$edition" == "ProfessionalWorkstationN" ]; then
supported=1
requiredEdition="ProfessionalN"
description="Windows 10 Enterprise N"
elif [ "$edition" == "Education" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 Education"
elif [ "$edition" == "EducationN" ]; then
supported=1
requiredEdition="ProfessionalN"
description="Windows 10 Education N"
elif [ "$edition" == "ProfessionalEducation" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 Pro Education"
elif [ "$edition" == "ProfessionalEducationN" ]; then
supported=1
requiredEdition="ProfessionalN"
description="Windows 10 Pro Education N"
elif [ "$edition" == "ProfessionalWorkstation" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 Pro for Workstations"
elif [ "$edition" == "ProfessionalWorkstationN" ]; then
supported=1
requiredEdition="ProfessionalN"
description="Windows 10 Pro for Workstations N"
elif [ "$edition" == "CoreSingleLanguage" ]; then
supported=1
requiredEdition="Core"
description="Windows 10 Home Single Language"
elif [ "$edition" == "ServerRdsh" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 Enterprise for Virtual Desktops"
elif [ "$edition" == "IoTEnterprise" ]; then
supported=1
requiredEdition="Professional"
description="Windows 10 IoT Enterprise"
minBuild=18277
elif [ "$edition" == "CloudEdition" ]; then
supported=1
requiredEdition="Professional"
minBuild=21364
elif [ "$edition" == "CloudEditionN" ]; then
supported=1
requiredEdition="ProfessionalN"
minBuild=21364
elif [ "$edition" == "CoreSingleLanguage" ]; then
supported=1
requiredEdition="Core"
fi
if [ $supported != 1 ]; then
@ -1384,7 +1579,40 @@ function createVirtualEdition() {
return 2
fi
newName="Windows 10 $edition"
winName="Windows 10"
if [ $build -ge 21990 ]; then
winName="Windows 11"
fi
if [ "$edition" == "Enterprise" ]; then
description="$winName Enterprise"
elif [ "$edition" == "EnterpriseN" ]; then
description="$winName Enterprise N"
elif [ "$edition" == "Education" ]; then
description="$winName Education"
elif [ "$edition" == "EducationN" ]; then
description="$winName Education N"
elif [ "$edition" == "ProfessionalEducation" ]; then
description="$winName Pro Education"
elif [ "$edition" == "ProfessionalEducationN" ]; then
description="$winName Pro Education N"
elif [ "$edition" == "ProfessionalWorkstation" ]; then
description="$winName Pro for Workstations"
elif [ "$edition" == "ProfessionalWorkstationN" ]; then
description="$winName Pro for Workstations N"
elif [ "$edition" == "CloudEdition" ]; then
description="$winName SE"
elif [ "$edition" == "CloudEditionN" ]; then
description="$winName SE N"
elif [ "$edition" == "CoreSingleLanguage" ]; then
description="$winName Home Single Language"
elif [ "$edition" == "ServerRdsh" ]; then
description="$winName Enterprise multi-session"
elif [ "$edition" == "IoTEnterprise" ]; then
description="$winName IoT Enterprise"
fi
newName="$winName $edition"
tmpDir=`mktemp -d`
wimlib-imagex export ISODIR/sources/install.$type $sourceIndex \