From 592bd1784314ef67c36b877f5a3b35cd5f9ac9cb Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Fri, 6 Sep 2024 18:29:28 +0200 Subject: [PATCH 01/26] Upgrade Project to dotnet 8 --- src/Applications/Playground/Playground.csproj | 2 +- src/Applications/UUPDownload/UUPDownload.csproj | 2 +- .../UUPMediaConverter/UUPMediaConverter.csproj | 2 +- src/Cabinet/Cabinet.cs | 4 ++-- src/Cabinet/Cabinet.csproj | 2 +- src/CompDB/Applications/AppxInstallWorkload.cs | 2 +- ...fiedUpdatePlatform.Services.Composition.Database.csproj | 2 +- .../Microsoft.StoreServices.DisplayCatalog.csproj | 7 ++----- src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj | 7 ++----- .../UnifiedUpdatePlatform.Common.Messaging.csproj | 4 ++-- .../UnifiedUpdatePlatform.Services.Imaging.csproj | 6 +++--- .../ConversionPlanBuilder.cs | 2 +- .../UnifiedUpdatePlatform.Media.Creator.Planning.csproj | 2 +- .../UnifiedUpdatePlatform.Media.Creator.csproj | 2 +- ...dUpdatePlatform.Services.WindowsUpdate.Downloads.csproj | 2 +- .../FE3Handler.cs | 6 +++--- .../UnifiedUpdatePlatform.Services.WindowsUpdate.csproj | 2 +- src/VirtualHardDiskLib/VirtualHardDiskLib.csproj | 2 +- .../Windows.Internal.Flighting.csproj | 2 +- thirdparty/Microsoft.Dism/Microsoft.Dism.csproj | 6 ++---- thirdparty/Microsoft.Wim/Microsoft.Wim.csproj | 5 ++--- thirdparty/Privileges/Privileges.csproj | 4 ++-- 22 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/Applications/Playground/Playground.csproj b/src/Applications/Playground/Playground.csproj index ee6e9705..4e095025 100644 --- a/src/Applications/Playground/Playground.csproj +++ b/src/Applications/Playground/Playground.csproj @@ -2,7 +2,7 @@ Exe - net7.0-windows10.0.22621 + net8.0-windows10.0.22621 enable enable diff --git a/src/Applications/UUPDownload/UUPDownload.csproj b/src/Applications/UUPDownload/UUPDownload.csproj index 825ad0d0..4af18b76 100644 --- a/src/Applications/UUPDownload/UUPDownload.csproj +++ b/src/Applications/UUPDownload/UUPDownload.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Exe false win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 diff --git a/src/Applications/UUPMediaConverter/UUPMediaConverter.csproj b/src/Applications/UUPMediaConverter/UUPMediaConverter.csproj index 128b6890..78b8811d 100644 --- a/src/Applications/UUPMediaConverter/UUPMediaConverter.csproj +++ b/src/Applications/UUPMediaConverter/UUPMediaConverter.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Exe false Properties\app.manifest diff --git a/src/Cabinet/Cabinet.cs b/src/Cabinet/Cabinet.cs index e82ee1b5..112d0b9b 100644 --- a/src/Cabinet/Cabinet.cs +++ b/src/Cabinet/Cabinet.cs @@ -224,7 +224,7 @@ private CabinetHeader ReadHeader(Stream cabinetStream) { byte cbCFFolder = 0; byte cbCFData = 0; - byte[] AdditionalData = Array.Empty(); + byte[] AdditionalData = []; BinaryReader cabinetBinaryReader = new(cabinetStream); @@ -278,7 +278,7 @@ private IReadOnlyCollection ReadVolumes(Stream cabinetStream) CabinetVolume volume = new() { CabinetFileVolume = cabinetStream.ReadStruct(), - AdditionalApplicationData = cabinetHeader.VolumeAdditionalApplicationDataSize > 0 ? cabinetBinaryReader.ReadBytes(cabinetHeader.VolumeAdditionalApplicationDataSize) : Array.Empty() + AdditionalApplicationData = cabinetHeader.VolumeAdditionalApplicationDataSize > 0 ? cabinetBinaryReader.ReadBytes(cabinetHeader.VolumeAdditionalApplicationDataSize) : [] }; if (volume.CabinetFileVolume.typeCompress is not CFFOLDER.CFTYPECOMPRESS.TYPE_LZX and diff --git a/src/Cabinet/Cabinet.csproj b/src/Cabinet/Cabinet.csproj index 1c8131ef..425342d7 100644 --- a/src/Cabinet/Cabinet.csproj +++ b/src/Cabinet/Cabinet.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 diff --git a/src/CompDB/Applications/AppxInstallWorkload.cs b/src/CompDB/Applications/AppxInstallWorkload.cs index 87267f10..2c9545f1 100644 --- a/src/CompDB/Applications/AppxInstallWorkload.cs +++ b/src/CompDB/Applications/AppxInstallWorkload.cs @@ -6,7 +6,7 @@ public class AppxInstallWorkload { public string AppXPath { get; set; } = ""; public string LicensePath { get; set; } = ""; - public string[] DependenciesPath { get; set; } = Array.Empty(); + public string[] DependenciesPath { get; set; } = []; public string StubPackageOption { get; set; } = ""; public override string ToString() diff --git a/src/CompDB/UnifiedUpdatePlatform.Services.Composition.Database.csproj b/src/CompDB/UnifiedUpdatePlatform.Services.Composition.Database.csproj index 4dad71ed..8523e6d7 100644 --- a/src/CompDB/UnifiedUpdatePlatform.Services.Composition.Database.csproj +++ b/src/CompDB/UnifiedUpdatePlatform.Services.Composition.Database.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 AnyCPU;x64;x86;arm64 $(SolutionDir)build\$(Platform)\$(Configuration)\CompDB\ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\CompDB\ diff --git a/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj b/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj index 930451e3..2fac5c3f 100644 --- a/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj +++ b/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj @@ -1,14 +1,11 @@ - - net7.0 + net8.0 AnyCPU;x64;x86;arm64 $(SolutionDir)build\$(Platform)\$(Configuration)\Microsoft.StoreServices.DisplayCatalog\ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\Microsoft.StoreServices.DisplayCatalog\ - - - + \ No newline at end of file diff --git a/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj b/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj index ea11ec1b..5f3dc4ae 100644 --- a/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj +++ b/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj @@ -1,11 +1,8 @@ - - net7.0 + net8.0 enable enable AnyCPU;x64;x86;arm64 - - - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj b/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj index a0a1d14e..4865b2f2 100644 --- a/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj +++ b/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 @@ -8,4 +8,4 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Common.Messaging\ MinimumRecommendedRules.ruleset - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj b/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj index d5a41963..ae02f82a 100644 --- a/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj +++ b/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library 8.0 false @@ -9,7 +9,7 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Imaging\ 9.0 MinimumRecommendedRules.ruleset - false + false @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs index 0a671661..b4135b82 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs @@ -47,7 +47,7 @@ public AvailabilityType AvailabilityType { get; set; } - public AppxInstallWorkload[] AppXInstallWorkloads { get; set; } = Array.Empty(); + public AppxInstallWorkload[] AppXInstallWorkloads { get; set; } = []; } public enum AvailabilityType diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/UnifiedUpdatePlatform.Media.Creator.Planning.csproj b/src/UnifiedUpdatePlatform.Media.Creator.Planning/UnifiedUpdatePlatform.Media.Creator.Planning.csproj index d9d2d186..99110c23 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/UnifiedUpdatePlatform.Media.Creator.Planning.csproj +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/UnifiedUpdatePlatform.Media.Creator.Planning.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 diff --git a/src/UnifiedUpdatePlatform.Media.Creator/UnifiedUpdatePlatform.Media.Creator.csproj b/src/UnifiedUpdatePlatform.Media.Creator/UnifiedUpdatePlatform.Media.Creator.csproj index 0121c687..36d3b20a 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/UnifiedUpdatePlatform.Media.Creator.csproj +++ b/src/UnifiedUpdatePlatform.Media.Creator/UnifiedUpdatePlatform.Media.Creator.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.csproj index 07760b67..1fd716ef 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.csproj +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 AnyCPU;x64;x86;arm64 $(SolutionDir)build\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads\ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads\ diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs index af5053ba..7fcd68b3 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs @@ -342,7 +342,7 @@ CTAC ctac }, OtherCachedUpdateIDs = new CSyncUpdatesRequest.OtherCachedUpdateIDs() { - Int = OtherCachedUpdateIDs != null ? OtherCachedUpdateIDs.ToArray() : Array.Empty() + Int = OtherCachedUpdateIDs != null ? OtherCachedUpdateIDs.ToArray() : [] }, SkipSoftwareSync = "false", NeedTwoGroupOutOfScopeUpdates = "true", @@ -350,7 +350,7 @@ CTAC ctac { CategoryIdentifier = new CSyncUpdatesRequest.CategoryIdentifier() { - Id = CategoryIdentifiers ?? Array.Empty() + Id = CategoryIdentifiers ?? [] } } : null, AlsoPerformRegularSync = "false", @@ -413,7 +413,7 @@ public static async Task> GetUpdates(string[] categoryId // while (true) { - (CSyncUpdatesResponse.SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? Array.Empty(), ctac); + (CSyncUpdatesResponse.SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? [], ctac); // Refresh the cookie cookie.GetCookieResult.EncryptedData = result.Item1.SyncUpdatesResult.NewCookie.EncryptedData; diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj index 456118ed..4c067d9c 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 diff --git a/src/VirtualHardDiskLib/VirtualHardDiskLib.csproj b/src/VirtualHardDiskLib/VirtualHardDiskLib.csproj index 00728faf..6e4eb9c8 100644 --- a/src/VirtualHardDiskLib/VirtualHardDiskLib.csproj +++ b/src/VirtualHardDiskLib/VirtualHardDiskLib.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library 8.0 false diff --git a/src/Windows.Internal.Flighting/Windows.Internal.Flighting.csproj b/src/Windows.Internal.Flighting/Windows.Internal.Flighting.csproj index cadf708d..473653a8 100644 --- a/src/Windows.Internal.Flighting/Windows.Internal.Flighting.csproj +++ b/src/Windows.Internal.Flighting/Windows.Internal.Flighting.csproj @@ -1,7 +1,7 @@  - net7.0-windows10.0.22621.0 + net8.0-windows10.0.22621.0 enable enable diff --git a/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj b/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj index 0ff30016..58748822 100644 --- a/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj +++ b/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 @@ -10,7 +10,5 @@ - - - + \ No newline at end of file diff --git a/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj b/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj index 5b203591..dafb1ccc 100644 --- a/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj +++ b/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 @@ -10,6 +10,5 @@ - - + \ No newline at end of file diff --git a/thirdparty/Privileges/Privileges.csproj b/thirdparty/Privileges/Privileges.csproj index 4943e341..dc3d9881 100644 --- a/thirdparty/Privileges/Privileges.csproj +++ b/thirdparty/Privileges/Privileges.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 Library false AnyCPU;x64;x86;arm64 @@ -8,4 +8,4 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\Privileges\ true - + \ No newline at end of file From ae6f97b804834fd40073d3284903c2242bed8008 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Fri, 6 Sep 2024 22:01:20 +0200 Subject: [PATCH 02/26] Refactor a few bits --- UUPMediaCreator.sln | 69 + src/Applications/Playground/Program.cs | 2 +- src/Applications/UUPDownload/CLIOptions.cs | 2 +- .../UUPDownload/DownloadRequest/Process.cs | 1 + .../UUPDownload/DownloadRequest/UpdateScan.cs | 1 + .../UUPDownload/Downloading/ReportProgress.cs | 2 +- .../UUPDownload/FeatureManifestService.cs | 2 +- src/Applications/UUPDownload/RingCheck.cs | 3 +- src/Applications/UUPDownload/UpdateUtils.cs | 6 +- .../UUPMediaConverter/CLIOptions.cs | 5 +- src/Cabinet/Cabinet.cs | 8 +- .../Applications/AppxInstallWorkload.cs | 4 +- .../Applications/AppxSelectionEngine.cs | 16 +- .../Applications/DeploymentProperties.cs | 2 +- src/CompDB/CompDBExtensions.cs | 6 +- src/TempManager/TempManager.cs | 2 +- .../ConversionPlanBuilder.cs | 22 +- .../FileLocator.cs | 4 +- .../BaseEditions/BaseEditionBuilder.cs | 4 +- .../DismOperations.cs | 8 +- .../FileLocator.cs | 6 +- .../Installer/WindowsInstallerBuilder.cs | 14 +- .../DownloadHelpers.cs | 25 +- .../HttpDownloader.cs | 6 +- .../ESRPCryptography.cs} | 17 +- ...latform.Services.WindowsUpdate.ESRP.csproj | 13 + .../Constants.cs | 29 + .../FE3/JSON/AppxMetadata/AppxMetadataJson.cs | 76 + .../AppxMetadata/ContentTargetPlatform.cs | 46 + .../FE3/JSON/AppxMetadata/Policy.cs | 58 + .../FE3/JSON/AppxMetadata/Policy2.cs | 46 + .../JSON/AppxMetadata/ThirdPartyAppRating.cs | 40 + .../JSON/ESRP/EsrpDecryptionInformation.cs | 61 + .../FE3/SOAP/Common/Action.cs | 42 + .../FE3/SOAP/Common/Body.cs | 98 + .../FE3/SOAP/Common/Cookie.cs | 41 + .../FE3/SOAP/Common/Envelope.cs | 60 + .../FE3/SOAP/Common/Header.cs | 60 + .../FE3/SOAP/Common/InfoTypes.cs | 36 + .../FE3/SOAP/Common/Locales.cs | 36 + .../FE3/SOAP/Common/OutOfScopeRevisionIDs.cs | 36 + .../FE3/SOAP/Common/Security.cs | 62 + .../FE3/SOAP/Common/TicketType.cs | 54 + .../FE3/SOAP/Common/Timestamp.cs | 54 + .../FE3/SOAP/Common/To.cs | 42 + .../FE3/SOAP/Common/Update.cs | 42 + .../FE3/SOAP/Common/Updates.cs | 36 + .../SOAP/Common/WindowsUpdateTicketsToken.cs | 69 + .../FE3/SOAP/GetCookie/Request/GetCookie.cs | 60 + .../FE3/SOAP/GetCookie/Request/OldCookie.cs | 36 + .../GetCookie/Response/GetCookieResponse.cs | 43 + .../Request/GetExtendedUpdateInfo.cs | 67 + .../Request/RevisionIDs.cs | 36 + .../Response/GetExtendedUpdateInfoResponse.cs | 42 + .../Response/GetExtendedUpdateInfoResult.cs | 43 + .../Response/Verification.cs | 54 + .../Request/GetExtendedUpdateInfo2.cs | 55 + .../Request/UpdateIDs.cs | 36 + .../Request/UpdateIdentity.cs | 42 + .../Response/FileDecryption.cs | 48 + .../Response/FileDecryptionData.cs | 36 + .../Response/FileLocation.cs | 60 + .../Response/FileLocations.cs | 36 + .../GetExtendedUpdateInfo2Response.cs | 42 + .../Response/GetExtendedUpdateInfo2Result.cs | 42 + .../Response/SecurityData.cs | 36 + .../SyncUpdates/Request/CategoryIdentifier.cs | 36 + .../Request/ExtendedUpdateInfoParameters.cs | 43 + .../Request/FilterAppCategoryIds.cs | 36 + .../Request/InstalledNonLeafUpdateIDs.cs | 36 + .../Request/OtherCachedUpdateIDs.cs | 36 + .../SOAP/SyncUpdates/Request/Parameters.cs | 96 + .../SyncUpdates/Request/ProductsParameters.cs | 54 + .../SOAP/SyncUpdates/Request/SyncUpdates.cs | 49 + .../Request/XmlUpdateFragmentTypes.cs | 36 + .../SOAP/SyncUpdates/Response/Deployment.cs | 96 + .../Response/ExtendedUpdateInfo.cs | 37 + .../SOAP/SyncUpdates/Response/NewUpdates.cs | 36 + .../Response/SyncUpdatesResponse.cs | 42 + .../SyncUpdates/Response/SyncUpdatesResult.cs | 67 + .../SOAP/SyncUpdates/Response/UpdateInfo.cs | 60 + .../ExtendedUpdateInfo/AdditionalDigest.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/And.cs | 66 + .../ExtendedUpdateInfo/ApplicabilityRules.cs | 54 + .../ExtendedUpdateInfo/AppxFamilyMetadata.cs | 48 + .../XML/ExtendedUpdateInfo/AppxMetadata.cs | 54 + .../AppxPackageInstallData.cs | 47 + .../ExtendedUpdateInfo/AppxPackageMetadata.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/BCamera.cs | 36 + .../FE3/XML/ExtendedUpdateInfo/BDirect3D.cs | 48 + .../FE3/XML/ExtendedUpdateInfo/BMemory.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/BNFC.cs | 36 + .../FE3/XML/ExtendedUpdateInfo/BRegDword.cs | 60 + .../FE3/XML/ExtendedUpdateInfo/BRegSz.cs | 66 + .../XML/ExtendedUpdateInfo/BRegValueExists.cs | 60 + .../FE3/XML/ExtendedUpdateInfo/BSensorById.cs | 36 + .../XML/ExtendedUpdateInfo/BSystemMetric.cs | 48 + .../XML/ExtendedUpdateInfo/BVideoMemory.cs | 36 + .../XML/ExtendedUpdateInfo/BWindowsVersion.cs | 54 + .../FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs | 42 + .../XML/ExtendedUpdateInfo/BlockMapDigest.cs | 42 + .../XML/ExtendedUpdateInfo/BundledUpdates.cs | 36 + .../ExtendedUpdateInfo/CategoryInformation.cs | 60 + .../ExtendedUpdateInfo/ExtendedProperties.cs | 132 + .../FE3/XML/ExtendedUpdateInfo/File.cs | 95 + .../FE3/XML/ExtendedUpdateInfo/Files.cs | 36 + .../ExtendedUpdateInfo/HandlerSpecificData.cs | 48 + .../XML/ExtendedUpdateInfo/IsInstallable.cs | 36 + .../FE3/XML/ExtendedUpdateInfo/IsInstalled.cs | 114 + .../ExtendedUpdateInfo/LocalizedProperties.cs | 48 + .../FE3/XML/ExtendedUpdateInfo/Metadata.cs | 36 + .../FE3/XML/ExtendedUpdateInfo/Not.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/Or.cs | 63 + .../ExtendedUpdateInfo/PiecesHashDigest.cs | 42 + .../XML/ExtendedUpdateInfo/Prerequisites.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/Properties.cs | 66 + .../XML/ExtendedUpdateInfo/Relationships.cs | 42 + .../XML/ExtendedUpdateInfo/UpdateIdentity.cs | 42 + .../FE3/XML/ExtendedUpdateInfo/Xml.cs | 78 + ...tform.Services.WindowsUpdate.Models.csproj | 9 + .../CTAC.cs | 243 +- .../ComputerHardwareID.cs | 15 + .../ComputerHardwareIDProvider.cs | 25 +- .../MachineType.cs | 50 + .../OSSkuId.cs | 229 ++ ...rm.Services.WindowsUpdate.Targeting.csproj | 9 + .../BuildFetcher.AvailableBuild.cs | 50 + .../BuildFetcher.AvailableBuildLanguages.cs | 44 + .../BuildFetcher.AvailableEdition.cs | 34 + .../BuildFetcher.cs | 118 +- .../Constants.cs | 10 +- .../CorrelationVector.Settings.cs | 57 + .../CorrelationVector.cs | 28 +- .../FE3Handler.cs | 320 +-- .../FE3Objects.cs | 2375 ----------------- .../FileExchangeV3FileDownloadInformation.cs | 103 + .../FileExchangeV3UpdateFilter.cs | 30 + .../StringExtensions.cs | 64 + ...datePlatform.Services.WindowsUpdate.csproj | 5 +- .../UpdateData.cs | 83 + .../UpdateDataExtensions.cs | 18 +- .../NativeMethods.cs | 1 - .../PlatformCTAC.cs | 11 +- .../DismApi.AddProvisionedAppxPackage.cs | 4 +- .../Microsoft.Wim/WimRegisteredCallbacks.cs | 6 +- .../WimgApi.GetMountedImageInfo.cs | 4 +- thirdparty/Privileges/Privilege.cs | 4 +- .../Privileges/PrivilegeNotHeldException.cs | 1 + 149 files changed, 5865 insertions(+), 3092 deletions(-) rename src/{UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs => UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs} (91%) create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj rename src/{UnifiedUpdatePlatform.Services.WindowsUpdate => UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting}/CTAC.cs (63%) create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs rename src/{UnifiedUpdatePlatform.Services.WindowsUpdate => UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting}/ComputerHardwareIDProvider.cs (68%) create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs delete mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs diff --git a/UUPMediaCreator.sln b/UUPMediaCreator.sln index d7c01b20..72fdb4c2 100644 --- a/UUPMediaCreator.sln +++ b/UUPMediaCreator.sln @@ -43,6 +43,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Internal.Flighting" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playground", "src\Applications\Playground\Playground.csproj", "{CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj", "{7AFF6421-B605-43F1-B849-D331E979B3B1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj", "{E5A8D8A2-6219-4632-84EC-8F8BF625A596}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Models", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Models\UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj", "{D78B2286-F75B-4FE6-990B-84117E722CD4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -417,6 +423,66 @@ Global {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x64.Build.0 = Release|Any CPU {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x86.ActiveCfg = Release|Any CPU {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x86.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|ARM.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|arm64.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x64.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x86.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|Any CPU.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|ARM.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|ARM.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|arm64.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|arm64.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x64.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x64.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x86.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x86.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|ARM.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|arm64.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|arm64.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x64.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x64.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x86.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|Any CPU.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|ARM.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|ARM.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|arm64.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|arm64.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x64.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x64.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x86.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x86.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|ARM.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|arm64.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|arm64.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x64.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x64.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x86.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x86.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|Any CPU.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|ARM.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|ARM.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|arm64.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|arm64.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x64.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x64.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -440,6 +506,9 @@ Global {1AAC4923-A4E5-41D9-87FA-CFB028F802E5} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {B86CE874-B470-4294-BF98-21BB603E1F46} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8} = {C4A7DBD6-6FB5-410A-9252-922C7909C82C} + {7AFF6421-B605-43F1-B849-D331E979B3B1} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {E5A8D8A2-6219-4632-84EC-8F8BF625A596} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {D78B2286-F75B-4FE6-990B-84117E722CD4} = {162FE1A9-890A-4101-AFF8-54F6B1483882} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FEE89471-4FE8-4620-991F-4EBAD0F4CFEA} diff --git a/src/Applications/Playground/Program.cs b/src/Applications/Playground/Program.cs index 3884f9e9..b07c4f88 100644 --- a/src/Applications/Playground/Program.cs +++ b/src/Applications/Playground/Program.cs @@ -2,7 +2,7 @@ { internal class Program { - static void Main(string[] args) + private static void Main(string[] args) { Console.WriteLine(new Windows.Internal.Flighting.PlatformCTAC("WU_OS", "10.0.26058.1000").UriQuery); } diff --git a/src/Applications/UUPDownload/CLIOptions.cs b/src/Applications/UUPDownload/CLIOptions.cs index 9c198b35..7be57b38 100644 --- a/src/Applications/UUPDownload/CLIOptions.cs +++ b/src/Applications/UUPDownload/CLIOptions.cs @@ -20,7 +20,7 @@ * SOFTWARE. */ using CommandLine; -using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UUPDownload { diff --git a/src/Applications/UUPDownload/DownloadRequest/Process.cs b/src/Applications/UUPDownload/DownloadRequest/Process.cs index fdd9bd8d..b97863e8 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Process.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Process.cs @@ -30,6 +30,7 @@ using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; using UUPDownload.Downloading; namespace UUPDownload.DownloadRequest diff --git a/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs b/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs index 78d73919..51bb715b 100644 --- a/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs +++ b/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs @@ -23,6 +23,7 @@ using System.Xml; using System.Xml.Serialization; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UUPDownload.DownloadRequest { diff --git a/src/Applications/UUPDownload/Downloading/ReportProgress.cs b/src/Applications/UUPDownload/Downloading/ReportProgress.cs index 9fab222b..76dedb4c 100644 --- a/src/Applications/UUPDownload/Downloading/ReportProgress.cs +++ b/src/Applications/UUPDownload/Downloading/ReportProgress.cs @@ -28,7 +28,7 @@ namespace UUPDownload.Downloading { public class ReportProgress : IProgress, IDisposable { - private readonly Dictionary files = new(); + private readonly Dictionary files = []; private readonly Mutex mutex = new(); diff --git a/src/Applications/UUPDownload/FeatureManifestService.cs b/src/Applications/UUPDownload/FeatureManifestService.cs index 8f6dbf23..b640ca5b 100644 --- a/src/Applications/UUPDownload/FeatureManifestService.cs +++ b/src/Applications/UUPDownload/FeatureManifestService.cs @@ -33,7 +33,7 @@ public static class FeatureManifestService public static IDictionary GetAppxPackageLicenseFileMapFromCabs(IList cabPaths) { - Dictionary licenseMap = new(); + Dictionary licenseMap = []; foreach (string cabPath in cabPaths) { if (new FileInfo(cabPath).Length > MAXIMUM_CANDIDATE_CAB_SIZE) diff --git a/src/Applications/UUPDownload/RingCheck.cs b/src/Applications/UUPDownload/RingCheck.cs index 53b5e756..c9f1e611 100644 --- a/src/Applications/UUPDownload/RingCheck.cs +++ b/src/Applications/UUPDownload/RingCheck.cs @@ -24,6 +24,7 @@ using System.Linq; using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UUPDownload { @@ -59,7 +60,7 @@ internal static void ParseGetBuildsOptions(GetBuildsOptions opts) private static async Task GetRingBuilds(GetBuildsOptions opts) { - Dictionary CTACs = new(); + Dictionary CTACs = []; CTACs = string.IsNullOrWhiteSpace(opts.TargetingAttribute) ? GetRingCTACs(opts.MachineType, opts.ReportingSku) diff --git a/src/Applications/UUPDownload/UpdateUtils.cs b/src/Applications/UUPDownload/UpdateUtils.cs index f00a503d..2a35ddb4 100644 --- a/src/Applications/UUPDownload/UpdateUtils.cs +++ b/src/Applications/UUPDownload/UpdateUtils.cs @@ -30,7 +30,7 @@ namespace UUPDownload { public static class UpdateUtils { - public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static string GetFilenameForCEUIFile(UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) @@ -38,7 +38,7 @@ public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, I PayloadItem payload = payloadItems.First(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); return payload.Path.Replace('\\', Path.DirectorySeparatorChar); } - else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith("_") && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) + else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith('_') && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) { filename = filename[..filename.IndexOf('_')] + Path.DirectorySeparatorChar + filename[(filename.IndexOf('_') + 1)..]; return filename.TrimStart(Path.DirectorySeparatorChar); @@ -46,7 +46,7 @@ public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, I return filename; } - public static bool ShouldFileGetDownloaded(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static bool ShouldFileGetDownloaded(UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) diff --git a/src/Applications/UUPMediaConverter/CLIOptions.cs b/src/Applications/UUPMediaConverter/CLIOptions.cs index bada263a..a83cc0fc 100644 --- a/src/Applications/UUPMediaConverter/CLIOptions.cs +++ b/src/Applications/UUPMediaConverter/CLIOptions.cs @@ -63,6 +63,9 @@ public UnifiedUpdatePlatform.Common.Messaging.Common.CompressionType Compression } [Option("no-key-prompt", HelpText = "Use the alternate efisys and cdboot implementations to suppress the 'press any key' prompt", Required = false)] - public bool SuppressAnyKeyPrompt { get; set; } + public bool SuppressAnyKeyPrompt + { + get; set; + } } } diff --git a/src/Cabinet/Cabinet.cs b/src/Cabinet/Cabinet.cs index 112d0b9b..ccb42de1 100644 --- a/src/Cabinet/Cabinet.cs +++ b/src/Cabinet/Cabinet.cs @@ -272,7 +272,7 @@ private IReadOnlyCollection ReadVolumes(Stream cabinetStream) { BinaryReader cabinetBinaryReader = new(cabinetStream); - List volumes = new(); + List volumes = []; for (int i = 0; i < cabinetHeader.CabinetFileHeader.cFolders; i++) { CabinetVolume volume = new() @@ -311,7 +311,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr throw new Exception("Bad Cabinet: First File Block does not match header"); } - List files = new(); + List files = []; for (int i = 0; i < cabinetHeader.CabinetFileHeader.cFiles; i++) { CFFILE file = cabinetBinaryReader.BaseStream.ReadStruct(); @@ -330,7 +330,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr private List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> BuildDataMap(CabinetVolume volume) { - List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas = new(); + List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas = []; // Build Data Map using BinaryReader cabinetBinaryReader = new(InputStream, System.Text.Encoding.UTF8, true); @@ -351,7 +351,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr private List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> BuildBlockMap(int volumeIndex, List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas) { - List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> fileBlockMap = new(); + List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> fileBlockMap = []; // Build Block Map foreach (CabinetVolumeFile file in files) diff --git a/src/CompDB/Applications/AppxInstallWorkload.cs b/src/CompDB/Applications/AppxInstallWorkload.cs index 2c9545f1..a5850280 100644 --- a/src/CompDB/Applications/AppxInstallWorkload.cs +++ b/src/CompDB/Applications/AppxInstallWorkload.cs @@ -1,6 +1,4 @@ -using System; - -namespace UnifiedUpdatePlatform.Services.Composition.Database.Applications +namespace UnifiedUpdatePlatform.Services.Composition.Database.Applications { public class AppxInstallWorkload { diff --git a/src/CompDB/Applications/AppxSelectionEngine.cs b/src/CompDB/Applications/AppxSelectionEngine.cs index 2eff4bd8..58365e13 100644 --- a/src/CompDB/Applications/AppxSelectionEngine.cs +++ b/src/CompDB/Applications/AppxSelectionEngine.cs @@ -48,7 +48,7 @@ private static (Dictionary preinstalledApps, Featu .Distinct() .ToDictionary(x => x, _ => new DeploymentProperties()); - List appsFeatures = new(); + List appsFeatures = []; foreach (CompDB appsCdb in appsCdbs) { @@ -80,7 +80,7 @@ private static (Dictionary preinstalledApps, Featu continue; } - HashSet depsForApp = new(); + HashSet depsForApp = []; foreach (Feature dep in dependencies) { string depAppId = dep.FeatureID; @@ -144,13 +144,13 @@ public static void GenerateLicenseXmlFiles(CompDB editionCdb, IEnumerable public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionCdb, IEnumerable appsCdbs, string editionLanguage) { - List workloads = new(); + List workloads = []; IEnumerable applicableLanguageTags = GetAllPossibleLanguageCombinations(editionLanguage); (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); - HashSet allPackageIDs = new(); + HashSet allPackageIDs = []; // Pick packages and dump licenses foreach (Feature ftr in appsFeatures) { @@ -184,7 +184,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC } } - Dictionary packageHashDict = new(); + Dictionary packageHashDict = []; foreach (CompDB appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) @@ -217,7 +217,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC if (deployProps.Dependencies != null) { - List dependencies = new(); + List dependencies = []; foreach (string dependency in deployProps.Dependencies) { DeploymentProperties dependProps = preinstalledApps[dependency]; @@ -502,7 +502,7 @@ public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumera (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); - HashSet allPackageIDs = new(); + HashSet allPackageIDs = []; // Pick packages and dump licenses foreach (Feature ftr in appsFeatures) { @@ -536,7 +536,7 @@ public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumera } } - Dictionary packageHashDict = new(); + Dictionary packageHashDict = []; foreach (CompDB appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) diff --git a/src/CompDB/Applications/DeploymentProperties.cs b/src/CompDB/Applications/DeploymentProperties.cs index d11667af..11407a80 100644 --- a/src/CompDB/Applications/DeploymentProperties.cs +++ b/src/CompDB/Applications/DeploymentProperties.cs @@ -57,7 +57,7 @@ public bool HasLicense public void AddApplicablePackages(IEnumerable packageElements, IEnumerable applicableLanguageTags) { - PackageIDs = new HashSet(); + PackageIDs = []; Dictionary scaleDictionary = null; foreach (Package package in packageElements) { diff --git a/src/CompDB/CompDBExtensions.cs b/src/CompDB/CompDBExtensions.cs index 159e22d0..273c9fdd 100644 --- a/src/CompDB/CompDBExtensions.cs +++ b/src/CompDB/CompDBExtensions.cs @@ -77,7 +77,7 @@ public static HashSet GetEditionCompDBsForLanguage( this IEnumerable compDBs, string LanguageCode) { - HashSet filteredCompDBs = new(); + HashSet filteredCompDBs = []; foreach (CompDB compDB in compDBs) { @@ -116,7 +116,7 @@ public static HashSet GetEditionCompDBsForLanguage( public static HashSet GetEditionCompDBs(this IEnumerable compDBs) { - HashSet filteredCompDBs = new(); + HashSet filteredCompDBs = []; foreach (CompDB compDB in compDBs) { @@ -173,7 +173,7 @@ public static IEnumerable GetAvailableLanguages(this IEnumerable public static Package GetEditionPackFromCompDBs(this IEnumerable compDBs) { - HashSet pkgs = new(); + HashSet pkgs = []; // // Get base editions that are available with all their files diff --git a/src/TempManager/TempManager.cs b/src/TempManager/TempManager.cs index d77752a4..12c7ea4f 100644 --- a/src/TempManager/TempManager.cs +++ b/src/TempManager/TempManager.cs @@ -24,7 +24,7 @@ namespace UnifiedUpdatePlatform.Services.Temp public class TempManager : IDisposable { private ulong i = 0; - private readonly List tempPaths = new(); + private readonly List tempPaths = []; private bool disposed = false; private readonly string Temp = Environment.GetEnvironmentVariable("TEMP") ?? ""; diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs index b4135b82..c77c000a 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs @@ -36,8 +36,8 @@ namespace UnifiedUpdatePlatform.Media.Creator.Planning public class EditionTarget { public PlannedEdition PlannedEdition { get; set; } = new PlannedEdition(); - public List NonDestructiveTargets = new(); - public List DestructiveTargets = new(); + public List NonDestructiveTargets = []; + public List DestructiveTargets = []; } public class PlannedEdition @@ -281,8 +281,8 @@ private static (List, List) GetEditionsThatCanBe List possibleEditionUpgrades, ProgressCallback? progressCallback = null) { - List availableEditionsByDowngradingInPriority = new(); - List availableEditionsByDowngrading = new(); + List availableEditionsByDowngradingInPriority = []; + List availableEditionsByDowngrading = []; // // Attempt to get the neutral Composition Database listing all available files @@ -400,10 +400,10 @@ public static bool GetTargetedPlan( public static List PrintEditionTarget(EditionTarget editionTarget, int padding = 0) { - List lines = new() - { + List lines = + [ $"-> Name: {editionTarget.PlannedEdition.EditionName}, Availability: {editionTarget.PlannedEdition.AvailabilityType}" - }; + ]; if (editionTarget.PlannedEdition.AppXInstallWorkloads?.Length > 0) { @@ -454,7 +454,7 @@ public static bool GetTargetedPlan( { bool VerifyFiles = !string.IsNullOrEmpty(UUPPath); - EditionTargets = new List(); + EditionTargets = []; bool result = true; @@ -523,13 +523,13 @@ public static bool GetTargetedPlan( // This dictionary holds the possible virtual edition upgrades // Example: Professional -> ProfessionalEducation // - List virtualWindowsEditions = new(); + List virtualWindowsEditions = []; // // This dictionary holds the possible edition upgrades // Example: Core -> Professional // - List possibleEditionUpgrades = new(); + List possibleEditionUpgrades = []; if (!string.IsNullOrEmpty(EditionPack) && File.Exists(EditionPack)) { @@ -648,7 +648,7 @@ public static bool GetTargetedPlan( progressCallback?.Invoke("Building Targets"); - List editionsAdded = new(); + List editionsAdded = []; foreach (PlannedEdition? ed in availableCanonicalEditions) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs index 6bf1cfea..f91d29ec 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs @@ -36,7 +36,7 @@ public static class FileLocator { public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager tempManager) { - List compDBs = new(); + List compDBs = []; try { @@ -89,7 +89,7 @@ public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager te public static (bool, HashSet) VerifyFilesAreAvailableForCompDB(CompDB compDB, string UUPPath) { - HashSet missingPackages = new(); + HashSet missingPackages = []; foreach (Package feature in compDB.Features.Feature[0].Packages.Package) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs index 9c2e3788..79fa52f7 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs @@ -398,7 +398,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) goto exit; } - Dictionary> iniSections = new(); + Dictionary> iniSections = []; foreach (string referencePackageToConvert in referencePackagesToConvert) { @@ -413,7 +413,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) { if (!iniSections.ContainsKey(section.SectionName)) { - iniSections.Add(section.SectionName, new List()); + iniSections.Add(section.SectionName, []); } foreach (KeyData element in section.Keys) diff --git a/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs b/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs index ac76ee4c..6061580a 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs @@ -41,7 +41,7 @@ private List GetRemovableREPackages(string mountDir) XDocument sessDoc = XDocument.Load(Path.Combine(mountDir, @"Windows\servicing\Sessions\Sessions.xml")); IEnumerable sessions = sessDoc.Element("Sessions").Elements("Session"); bool dupeFound = false; - List pkgsToRemove = new(); + List pkgsToRemove = []; foreach (XElement test in sessions) { bool phasesEmpty = !test.Element("Actions").Elements("Phase").First().Elements().Any(); @@ -79,7 +79,7 @@ public bool PerformAppxWorkloadInstallation(string ospath, string repositoryPath DismApi.AddProvisionedAppxPackage( session, Path.Combine(repositoryPath, workload.AppXPath), - workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? new List(), + workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? [], string.IsNullOrEmpty(workload.LicensePath) ? null : Path.Combine(licenseFolder, workload.LicensePath), null, string.IsNullOrEmpty(workload.StubPackageOption) ? DismStubPackageOption.None : DismStubPackageOption.InstallStub); // TODO: proper handling @@ -142,7 +142,7 @@ public bool PerformAppxWorkloadsInstallation(string ospath, string repositoryPat DismApi.AddProvisionedAppxPackage( session, Path.Combine(repositoryPath, workload.AppXPath), - workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? new List(), + workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? [], string.IsNullOrEmpty(workload.LicensePath) ? null : Path.Combine(licenseFolder, workload.LicensePath), null, string.IsNullOrEmpty(workload.StubPackageOption) ? DismStubPackageOption.None : DismStubPackageOption.InstallStub); // TODO: proper handling @@ -203,7 +203,7 @@ public bool UninstallPEComponents(string ospath, ProgressCallback progressCallba DismSession session = DismApi.OpenOfflineSession(ospath); DismPackageCollection packages = DismApi.GetPackages(session); - List componentsToRemove = new(); + List componentsToRemove = []; // // Queue components we don't need according to our hardcoded list for removal diff --git a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs index 2c5540d3..9d3b6704 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs @@ -34,7 +34,7 @@ internal static class FileLocator { internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDatabases(HashSet CompositionDatabases, string UUPPath) { - HashSet missingPackages = new(); + HashSet missingPackages = []; foreach (CompDB compDB in CompositionDatabases) { @@ -175,8 +175,8 @@ internal static (bool Succeeded, string BaseESD, HashSet ReferencePackag { bool success = true; - HashSet ReferencePackages = new(); - HashSet referencePackagesToConvert = new(); + HashSet ReferencePackages = []; + HashSet referencePackagesToConvert = []; string? BaseESD = null; progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Enumerating files"); diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs index 3527e7da..bc2146f7 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs @@ -282,11 +282,11 @@ private static bool IntegrateSetupFilesIntoImage( string winpejpgtmp = tempManager.GetTempPath(); File.WriteAllBytes(winpejpgtmp, Constants.winpejpg); - List<(string fileToAdd, string destination)> updateDirectives = new() - { + List<(string fileToAdd, string destination)> updateDirectives = + [ (bgfile, Path.Combine("Windows", "System32", "setup.bmp")), (winpejpgtmp, Path.Combine("Windows", "System32", "winpe.jpg")) - }; + ]; progressCallback?.Log("Backporting missing files"); @@ -383,10 +383,10 @@ private static bool PreparePEImage( string peshellini = Path.Combine(sys32, "winpeshl.ini"); progressCallback?.Log("Preparing PE for cleanup"); - List<(string fileToAdd, string destination)> updateDirectives = new() - { + List<(string fileToAdd, string destination)> updateDirectives = + [ (null, peshellini) - }; + ]; // // Cleanup log file from RE conversion phase mentions @@ -403,7 +403,7 @@ private static bool PreparePEImage( string[] lines = File.ReadAllLines(logfile); int bootsessioncount = 0; - List finallines = new(); + List finallines = []; foreach (string line in lines) { if (line.StartsWith("[Boot Session: ", StringComparison.InvariantCultureIgnoreCase)) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index f4941af0..20c2d8a1 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -29,12 +29,13 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.Composition.Database.Applications; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { public static partial class UpdateUtils { - public static string[] GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static string[] GetFilenameForCEUIFile(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) @@ -50,7 +51,7 @@ public static string[] GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, return new string[] { filename }; } - public static bool ShouldFileGetDownloaded(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static bool ShouldFileGetDownloaded(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) @@ -77,7 +78,7 @@ public static UpdateData TrimDeltasFromUpdateData(UpdateData update) return update; } - private static bool IsFileBanned(CExtendedUpdateInfoXml.File file2, IEnumerable bannedItems) + private static bool IsFileBanned(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable bannedItems) { return bannedItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); } @@ -90,9 +91,9 @@ HashSet specificCompDBs ) FilterCompDBs(HashSet compDBs, string Edition, string Language) { - HashSet selectedCompDBs = new(); - HashSet discardedCompDBs = new(); - HashSet specificCompDBs = new(); + HashSet selectedCompDBs = []; + HashSet discardedCompDBs = []; + HashSet specificCompDBs = []; foreach (CompDB cdb in compDBs) { @@ -151,7 +152,7 @@ HashSet specificCompDBs // Get edition + language case (true, true): { - if ((!hasEdition && !hasLang || !hasEdition && hasLang && langMatching || !hasLang && hasEdition && editionMatching || hasEdition && hasLang && langMatching && editionMatching) && !IsNeutral) + if (((!hasEdition && !hasLang) || (!hasEdition && hasLang && langMatching) || (!hasLang && hasEdition && editionMatching) || (hasEdition && hasLang && langMatching && editionMatching)) && !IsNeutral) { _ = specificCompDBs.Add(cdb); _ = selectedCompDBs.Add(cdb); @@ -176,8 +177,8 @@ HashSet bannedPayloadItems ) BuildListOfPayloads(HashSet compDBs, string Edition, string Language) { - HashSet payloadItems = new(); - HashSet bannedPayloadItems = new(); + HashSet payloadItems = []; + HashSet bannedPayloadItems = []; if (compDBs == null) { @@ -273,7 +274,7 @@ HashSet bannedPayloadItems if (AppCompDBs != null) { - List payloadHashesToKeep = new(); + List payloadHashesToKeep = []; switch (!string.IsNullOrEmpty(Language), !string.IsNullOrEmpty(Edition)) { @@ -478,7 +479,7 @@ public static async Task ProcessUpdateAsync(UpdateData update, string pO IEnumerable languages = null; int returnCode = 0; - IEnumerable filesToDownload = null; + IEnumerable filesToDownload = null; HashSet compDBs = await update.GetCompDBsAsync(); @@ -533,7 +534,7 @@ await Task.WhenAll( returnCode = 0; - IEnumerable<(CExtendedUpdateInfoXml.File, FileExchangeV3FileDownloadInformation)> boundList = filesToDownload + IEnumerable<(Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation)> boundList = filesToDownload .AsParallel() .Select(x => (x, fileUrls.First(y => y.Digest == x.Digest))) //.Where(x => UpdateUtils.ShouldFileGetDownloaded(x.x, payloadItems)) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs index 27001f3d..7ae340f8 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs @@ -30,6 +30,8 @@ using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { @@ -244,7 +246,7 @@ private static async ValueTask HttpDownload(string basePath, UUPFile downl int blockBufferSize = bufferSize; //These variables are used to decrypt files if esrp is available. - EsrpDecryptor esrpDecrypter = null; //Implements IDisposable + ESRPCryptography esrpDecrypter = null; //Implements IDisposable byte[] backBuffer = null; int backBufferLength = 0; long blockCount = 0; @@ -255,7 +257,7 @@ private static async ValueTask HttpDownload(string basePath, UUPFile downl { esrp = downloadFile.WUFile.EsrpDecryptionInformation; backBuffer = new byte[blockBufferSize]; - esrpDecrypter = new EsrpDecryptor(esrp); + esrpDecrypter = new ESRPCryptography(esrp); blockBufferSize = (int)esrp.EncryptionBufferSize; } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs similarity index 91% rename from src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs rename to src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs index 978dd210..9c2b3f02 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs @@ -19,11 +19,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -using System; -using System.IO; using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; // // Source: https://raw.githubusercontent.com/ADeltaX/ProtoBuildBot/5cce37197c44792f3401b63d876795b5bc2072a4/src/BuildChecker/Classes/Helpers/EsrpDecryptor.cs @@ -31,17 +28,17 @@ // And Updated with original author input on 2021-04-15 // -namespace UnifiedUpdatePlatform.Services.WindowsUpdate +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP { - public class EsrpDecryptor : IDisposable + public class ESRPCryptography : IDisposable { - private readonly EsrpDecryptionInformation esrp; + private readonly EsrpDecryptionInformation ESRP; private readonly Aes aes; private readonly byte[] key; - public EsrpDecryptor(EsrpDecryptionInformation esrp) + public ESRPCryptography(EsrpDecryptionInformation esrp) { - this.esrp = esrp; + ESRP = esrp; key = new byte[32]; Array.Copy(Convert.FromBase64String(esrp.KeyData), 0, key, 0, 32); @@ -76,7 +73,7 @@ public async Task DecryptStreamFullAsync(Stream encryptedFile, Stream decryptedF CancellationToken cancellationToken = default) { int readBytes; - byte[] buffer = new byte[esrp.EncryptionBufferSize]; + byte[] buffer = new byte[ESRP.EncryptionBufferSize]; while ((readBytes = await encryptedFile.ReadAsync(buffer.AsMemory(0, buffer.Length), cancellationToken)) > 0) { bool needsPaddingMode = encryptedSize == (ulong)encryptedFile.Position; diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj new file mode 100644 index 00000000..225b4c10 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs new file mode 100644 index 00000000..6a7eb52b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs @@ -0,0 +1,29 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models +{ + public static class Constants + { + public const string ClientWebServiceServerNamespace = "http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService"; + public const string WindowsUpdateAuthorizationSchema = "http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization"; + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs new file mode 100644 index 00000000..4a91a334 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs @@ -0,0 +1,76 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class AppxMetadataJson + { + [JsonPropertyName("blob.version")] + public long BlobVersion + { + get; set; + } + + [JsonPropertyName("content.isMain")] + public bool ContentIsMain + { + get; set; + } + + [JsonPropertyName("content.packageId")] + public string ContentPackageId + { + get; set; + } + + [JsonPropertyName("content.productId")] + public Guid ContentProductId + { + get; set; + } + + [JsonPropertyName("content.targetPlatforms")] + public ContentTargetPlatform[] ContentTargetPlatforms + { + get; set; + } + + [JsonPropertyName("content.type")] + public long ContentType + { + get; set; + } + + [JsonPropertyName("policy")] + public Policy Policy + { + get; set; + } + + [JsonPropertyName("policy2")] + public Policy2 Policy2 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs new file mode 100644 index 00000000..40620581 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class ContentTargetPlatform + { + [JsonPropertyName("platform.maxVersionTested")] + public long PlatformMaxVersionTested + { + get; set; + } + + [JsonPropertyName("platform.minVersion")] + public long PlatformMinVersion + { + get; set; + } + + [JsonPropertyName("platform.target")] + public long PlatformTarget + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs new file mode 100644 index 00000000..0fdbebf2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs @@ -0,0 +1,58 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class Policy + { + [JsonPropertyName("category.first")] + public string CategoryFirst + { + get; set; + } + + [JsonPropertyName("category.second")] + public string CategorySecond + { + get; set; + } + + [JsonPropertyName("category.third")] + public string CategoryThird + { + get; set; + } + + [JsonPropertyName("optOut.backupRestore")] + public bool OptOutBackupRestore + { + get; set; + } + + [JsonPropertyName("optOut.removeableMedia")] + public bool OptOutRemoveableMedia + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs new file mode 100644 index 00000000..5bb3635d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class Policy2 + { + [JsonPropertyName("ageRating")] + public long AgeRating + { + get; set; + } + + [JsonPropertyName("optOut.DVR")] + public bool OptOutDvr + { + get; set; + } + + [JsonPropertyName("thirdPartyAppRatings")] + public ThirdPartyAppRating[] ThirdPartyAppRatings + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs new file mode 100644 index 00000000..6c50532c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs @@ -0,0 +1,40 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class ThirdPartyAppRating + { + [JsonPropertyName("level")] + public long Level + { + get; set; + } + + [JsonPropertyName("systemId")] + public long SystemId + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs new file mode 100644 index 00000000..24ed6e82 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP +{ + public class EsrpDecryptionInformation + { + [DataMember(Name = "KeyData")] + public string KeyData + { + get; set; + } + + [DataMember(Name = "EncryptionBufferSize")] + public long EncryptionBufferSize + { + get; set; + } + + [DataMember(Name = "AlgorithmName")] + public string AlgorithmName + { + get; set; + } + + [DataMember(Name = "ChainingMode")] + public string ChainingMode + { + get; set; + } + + public static EsrpDecryptionInformation? DeserializeFromJson(string json) + { + using MemoryStream memoryStream = new(Encoding.UTF8.GetBytes(json)); + DataContractJsonSerializer serializer = new(typeof(EsrpDecryptionInformation)); + return serializer.ReadObject(memoryStream) as EsrpDecryptionInformation; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs new file mode 100644 index 00000000..7ec132e7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] + public class Action + { + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs new file mode 100644 index 00000000..cddba5eb --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs @@ -0,0 +1,98 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Body + { + [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsi + { + get; set; + } + + [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsd + { + get; set; + } + + // + // Requests + // + + [XmlElement(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetCookie.Request.GetCookie GetCookie + { + get; set; + } + + [XmlElement(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdates.Request.SyncUpdates SyncUpdates + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo.Request.GetExtendedUpdateInfo GetExtendedUpdateInfo + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2.Request.GetExtendedUpdateInfo2 GetExtendedUpdateInfo2 + { + get; set; + } + + // + // Responses + // + + [XmlElement(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetCookie.Response.GetCookieResponse GetCookieResponse + { + get; set; + } + + [XmlElement(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdates.Response.SyncUpdatesResponse SyncUpdatesResponse + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo.Response.GetExtendedUpdateInfoResponse GetExtendedUpdateInfoResponse + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2.Response.GetExtendedUpdateInfo2Response GetExtendedUpdateInfo2Response + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs new file mode 100644 index 00000000..5afe4df9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs @@ -0,0 +1,41 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + public class Cookie + { + [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Expiration + { + get; set; + } + + [XmlElement(ElementName = "EncryptedData", Namespace = Constants.ClientWebServiceServerNamespace)] + public string EncryptedData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs new file mode 100644 index 00000000..67db59d6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Envelope", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Envelope + { + [XmlElement(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public Header Header + { + get; set; + } + + [XmlElement(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public Body Body + { + get; set; + } + + [XmlAttribute(AttributeName = "a", Namespace = "http://www.w3.org/2000/xmlns/")] + public string A + { + get; set; + } + + [XmlAttribute(AttributeName = "s", Namespace = "http://www.w3.org/2000/xmlns/")] + public string S + { + get; set; + } + + [XmlAttribute(AttributeName = "u", Namespace = "http://www.w3.org/2000/xmlns/")] + public string U + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs new file mode 100644 index 00000000..de8a7e1f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Header + { + [XmlElement(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] + public Action Action + { + get; set; + } + + [XmlElement(ElementName = "MessageID", Namespace = "http://www.w3.org/2005/08/addressing")] + public string MessageID + { + get; set; + } + + [XmlElement(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] + public To To + { + get; set; + } + + [XmlElement(ElementName = "RelatesTo", Namespace = "http://www.w3.org/2005/08/addressing")] + public string RelatesTo + { + get; set; + } + + [XmlElement(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] + public Security Security + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs new file mode 100644 index 00000000..d3f274a3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public class InfoTypes + { + [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] XmlUpdateFragmentType + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs new file mode 100644 index 00000000..6623bc70 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Locales + { + [XmlElement(ElementName = "string", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] String + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs new file mode 100644 index 00000000..fa512f56 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OutOfScopeRevisionIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs new file mode 100644 index 00000000..f39813b5 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs @@ -0,0 +1,62 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] + public class Security + { + [XmlNamespaceDeclarations] + public XmlSerializerNamespaces ns = new( + new XmlQualifiedName[] + { + new("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") + } + ); + + [XmlElement(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public Timestamp Timestamp + { + get; set; + } + + [XmlElement(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] + public WindowsUpdateTicketsToken WindowsUpdateTicketsToken + { + get; set; + } + + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlAttribute(AttributeName = "o", Namespace = "http://www.w3.org/2000/xmlns/")] + public string O + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs new file mode 100644 index 00000000..0783f5d0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "TicketType")] + public class TicketType + { + [XmlElement(ElementName = "User")] + public string User + { + get; set; + } + + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + + [XmlAttribute(AttributeName = "Version")] + public string Version + { + get; set; + } + + [XmlAttribute(AttributeName = "Policy")] + public string Policy + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs new file mode 100644 index 00000000..9947cf26 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public class Timestamp + { + [XmlElement(ElementName = "Created", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Created + { + get; set; + } + + [XmlElement(ElementName = "Expires", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Expires + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + + [XmlAttribute(AttributeName = "Id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs new file mode 100644 index 00000000..298d7789 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] + public class To + { + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs new file mode 100644 index 00000000..36aa40af --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Update + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Xml + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs new file mode 100644 index 00000000..25b299fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Updates + { + [XmlElement(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] + public Update[] Update + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs new file mode 100644 index 00000000..81c2c801 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs @@ -0,0 +1,69 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] + public class WindowsUpdateTicketsToken + { + [XmlNamespaceDeclarations] + public XmlSerializerNamespaces ns = new( + new XmlQualifiedName[] + { + new("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"), + new("wuws", Constants.WindowsUpdateAuthorizationSchema) + } + ); + + [XmlElement(ElementName = "TicketType", Namespace = "")] + public TicketType[] TicketType + { + get; set; + } + + [XmlAttribute(AttributeName = "id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Id + { + get; set; + } + + [XmlAttribute(AttributeName = "wsu", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Wsu + { + get; set; + } + + [XmlAttribute(AttributeName = "wuws", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Wuws + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs new file mode 100644 index 00000000..fa0316f8 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request +{ + [XmlRoot(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetCookie + { + [XmlElement(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public OldCookie OldCookie + { + get; set; + } + + [XmlElement(ElementName = "lastChange", Namespace = Constants.ClientWebServiceServerNamespace)] + public string LastChange + { + get; set; + } + + [XmlElement(ElementName = "currentTime", Namespace = Constants.ClientWebServiceServerNamespace)] + public string CurrentTime + { + get; set; + } + + [XmlElement(ElementName = "protocolVersion", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ProtocolVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs new file mode 100644 index 00000000..20dd02d7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request +{ + [XmlRoot(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OldCookie + { + [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Expiration + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs new file mode 100644 index 00000000..ba000166 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Response +{ + [XmlRoot(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetCookieResponse + { + [XmlElement(ElementName = "GetCookieResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie GetCookieResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs new file mode 100644 index 00000000..fe6c626f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo + { + [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie Cookie + { + get; set; + } + + [XmlElement(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public RevisionIDs RevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public InfoTypes InfoTypes + { + get; set; + } + + [XmlElement(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public Locales Locales + { + get; set; + } + + [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs new file mode 100644 index 00000000..367e382b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request +{ + [XmlRoot(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class RevisionIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs new file mode 100644 index 00000000..89ae2180 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfoResponse + { + [XmlElement(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfoResult GetExtendedUpdateInfoResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs new file mode 100644 index 00000000..b3c38701 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfoResult + { + [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OutOfScopeRevisionIDs OutOfScopeRevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public Updates Updates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs new file mode 100644 index 00000000..f2ff3f40 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "Verification", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Verification + { + [XmlAttribute(AttributeName = "Timestamp")] + public string Timestamp + { + get; set; + } + + [XmlAttribute(AttributeName = "LeafCertificateId")] + public string LeafCertificateId + { + get; set; + } + + [XmlAttribute(AttributeName = "Signature")] + public string Signature + { + get; set; + } + + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs new file mode 100644 index 00000000..32b80fce --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2 + { + [XmlElement(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateIDs UpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public InfoTypes InfoTypes + { + get; set; + } + + [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs new file mode 100644 index 00000000..c66026c9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateIDs + { + [XmlElement(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateIdentity UpdateIdentity + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs new file mode 100644 index 00000000..db6de0c6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateIdentity + { + [XmlElement(ElementName = "UpdateID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string UpdateID + { + get; set; + } + + [XmlElement(ElementName = "RevisionNumber", Namespace = Constants.ClientWebServiceServerNamespace)] + public string RevisionNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs new file mode 100644 index 00000000..6ceb5a4e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileDecryption + { + [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FileDigest + { + get; set; + } + + [XmlElement(ElementName = "DecryptionKey", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DecryptionKey + { + get; set; + } + + [XmlElement(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] + public SecurityData SecurityData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs new file mode 100644 index 00000000..d4e751b9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileDecryptionData + { + [XmlElement(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileDecryption FileDecryption + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs new file mode 100644 index 00000000..160eef99 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileLocation + { + [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FileDigest + { + get; set; + } + + [XmlElement(ElementName = "Url", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Url + { + get; set; + } + + [XmlElement(ElementName = "PiecesHashUrl", Namespace = Constants.ClientWebServiceServerNamespace)] + public string PiecesHashUrl + { + get; set; + } + + [XmlElement(ElementName = "BlockMapUrl", Namespace = Constants.ClientWebServiceServerNamespace)] + public string BlockMapUrl + { + get; set; + } + + [XmlElement(ElementName = "EsrpDecryptionInformation", Namespace = Constants.ClientWebServiceServerNamespace)] + public string EsrpDecryptionInformation + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs new file mode 100644 index 00000000..2250ae32 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileLocations + { + [XmlElement(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileLocation[] FileLocation + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs new file mode 100644 index 00000000..b96fe300 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2Response + { + [XmlElement(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2Result GetExtendedUpdateInfo2Result + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs new file mode 100644 index 00000000..6702bd15 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2Result + { + [XmlElement(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileLocations FileLocations + { + get; set; + } + + [XmlElement(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileDecryptionData FileDecryptionData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs new file mode 100644 index 00000000..21d1f122 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SecurityData + { + [XmlElement(ElementName = "base64Binary", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Base64Binary + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs new file mode 100644 index 00000000..1d5fa709 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] + public class CategoryIdentifier + { + [XmlElement(ElementName = "Id", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs new file mode 100644 index 00000000..1765d9ec --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ExtendedUpdateInfoParameters + { + [XmlElement(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public XmlUpdateFragmentTypes XmlUpdateFragmentTypes + { + get; set; + } + + [XmlElement(ElementName = "Locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public Locales Locales + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs new file mode 100644 index 00000000..4d31f7d0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FilterAppCategoryIds + { + [XmlElement(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] + public CategoryIdentifier CategoryIdentifier + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs new file mode 100644 index 00000000..971e532f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class InstalledNonLeafUpdateIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs new file mode 100644 index 00000000..21095e51 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OtherCachedUpdateIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs new file mode 100644 index 00000000..08ffa4e6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs @@ -0,0 +1,96 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Parameters + { + [XmlElement(ElementName = "ExpressQuery", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ExpressQuery + { + get; set; + } + + [XmlElement(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public InstalledNonLeafUpdateIDs InstalledNonLeafUpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OtherCachedUpdateIDs OtherCachedUpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "SkipSoftwareSync", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SkipSoftwareSync + { + get; set; + } + + [XmlElement(ElementName = "NeedTwoGroupOutOfScopeUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public string NeedTwoGroupOutOfScopeUpdates + { + get; set; + } + + [XmlElement(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] + public FilterAppCategoryIds FilterAppCategoryIds + { + get; set; + } + + [XmlElement(ElementName = "AlsoPerformRegularSync", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AlsoPerformRegularSync + { + get; set; + } + + [XmlElement(ElementName = "ComputerSpec", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ComputerSpec + { + get; set; + } + + [XmlElement(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public ExtendedUpdateInfoParameters ExtendedUpdateInfoParameters + { + get; set; + } + + [XmlElement(ElementName = "ClientPreferredLanguages", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ClientPreferredLanguages + { + get; set; + } + + [XmlElement(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public ProductsParameters ProductsParameters + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs new file mode 100644 index 00000000..a0442782 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ProductsParameters + { + [XmlElement(ElementName = "SyncCurrentVersionOnly", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SyncCurrentVersionOnly + { + get; set; + } + + [XmlElement(ElementName = "DeviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlElement(ElementName = "CallerAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string CallerAttributes + { + get; set; + } + + [XmlElement(ElementName = "Products", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Products + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs new file mode 100644 index 00000000..a484c4b6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs @@ -0,0 +1,49 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdates + { + [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie Cookie + { + get; set; + } + + [XmlElement(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public Parameters Parameters + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs new file mode 100644 index 00000000..936acf60 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public class XmlUpdateFragmentTypes + { + [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] XmlUpdateFragmentType + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs new file mode 100644 index 00000000..40199e93 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs @@ -0,0 +1,96 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Deployment + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Action", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Action2 + { + get; set; + } + + [XmlElement(ElementName = "IsAssigned", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsAssigned + { + get; set; + } + + [XmlElement(ElementName = "LastChangeTime", Namespace = Constants.ClientWebServiceServerNamespace)] + public string LastChangeTime + { + get; set; + } + + [XmlElement(ElementName = "AutoSelect", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AutoSelect + { + get; set; + } + + [XmlElement(ElementName = "AutoDownload", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AutoDownload + { + get; set; + } + + [XmlElement(ElementName = "SupersedenceBehavior", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SupersedenceBehavior + { + get; set; + } + + [XmlElement(ElementName = "Priority", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Priority + { + get; set; + } + + [XmlElement(ElementName = "HandlerSpecificAction", Namespace = Constants.ClientWebServiceServerNamespace)] + public string HandlerSpecificAction + { + get; set; + } + + [XmlElement(ElementName = "FlightId", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FlightId + { + get; set; + } + + [XmlElement(ElementName = "FlightMetadata", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FlightMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs new file mode 100644 index 00000000..5109ce7a --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs @@ -0,0 +1,37 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ExtendedUpdateInfo + { + [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public Updates Updates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs new file mode 100644 index 00000000..33101ded --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class NewUpdates + { + [XmlElement(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateInfo[] UpdateInfo + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs new file mode 100644 index 00000000..ed89c16c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdatesResponse + { + [XmlElement(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdatesResult SyncUpdatesResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs new file mode 100644 index 00000000..eedbbaaf --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdatesResult + { + [XmlElement(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public NewUpdates NewUpdates + { + get; set; + } + + [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OutOfScopeRevisionIDs OutOfScopeRevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "Truncated", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Truncated + { + get; set; + } + + [XmlElement(ElementName = "NewCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie NewCookie + { + get; set; + } + + [XmlElement(ElementName = "DriverSyncNotNeeded", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DriverSyncNotNeeded + { + get; set; + } + + [XmlElement(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public ExtendedUpdateInfo ExtendedUpdateInfo + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs new file mode 100644 index 00000000..86094e90 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateInfo + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] + public Deployment Deployment + { + get; set; + } + + [XmlElement(ElementName = "IsLeaf", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsLeaf + { + get; set; + } + + [XmlElement(ElementName = "IsShared", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsShared + { + get; set; + } + + [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Xml + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs new file mode 100644 index 00000000..cd0f3778 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AdditionalDigest")] + public class AdditionalDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs new file mode 100644 index 00000000..421e8d20 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "And")] + public class And + { + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion[] BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "Not")] + public Not[] Not + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword[] BRegDword + { + get; set; + } + + [XmlElement(ElementName = "Or")] + public Or[] Or + { + get; set; + } + + [XmlElement(ElementName = "b.SystemMetric")] + public BSystemMetric[] BSystemMetric + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs new file mode 100644 index 00000000..155cab77 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "ApplicabilityRules")] + public class ApplicabilityRules + { + [XmlElement(ElementName = "IsInstalled")] + public IsInstalled IsInstalled + { + get; set; + } + + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "Metadata")] + public Metadata Metadata + { + get; set; + } + + [XmlElement(ElementName = "IsInstallable")] + public IsInstallable IsInstallable + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs new file mode 100644 index 00000000..14febf62 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxFamilyMetadata")] + public class AppxFamilyMetadata + { + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + + [XmlAttribute(AttributeName = "Publisher")] + public string Publisher + { + get; set; + } + + [XmlAttribute(AttributeName = "LegacyMobileProductId")] + public string LegacyMobileProductId + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs new file mode 100644 index 00000000..077d8019 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxMetadata")] + public class AppxMetadata + { + [XmlElement(ElementName = "ApplicabilityBlob")] + public string ApplicabilityBlob + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageType")] + public string PackageType + { + get; set; + } + + [XmlAttribute(AttributeName = "IsAppxBundle")] + public string IsAppxBundle + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageMoniker")] + public string PackageMoniker + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs new file mode 100644 index 00000000..1a64ae4a --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs @@ -0,0 +1,47 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxPackageInstallData")] + public class AppxPackageInstallData + { + [XmlAttribute(AttributeName = "PackageFileName")] + public string PackageFileName + { + get; set; + } + + [XmlAttribute(AttributeName = "MainPackage")] + public string MainPackage + { + get; set; + } + + public override string ToString() + { + return PackageFileName ?? base.ToString(); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs new file mode 100644 index 00000000..dad3277e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxPackageMetadata")] + public class AppxPackageMetadata + { + [XmlElement(ElementName = "AppxFamilyMetadata")] + public AppxFamilyMetadata AppxFamilyMetadata + { + get; set; + } + + [XmlElement(ElementName = "AppxMetadata")] + public AppxMetadata AppxMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs new file mode 100644 index 00000000..d482d956 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AtLeastOne")] + public class AtLeastOne + { + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity[] UpdateIdentity + { + get; set; + } + + [XmlAttribute(AttributeName = "IsCategory")] + public string IsCategory + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs new file mode 100644 index 00000000..e5919d23 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Camera")] + public class BCamera + { + [XmlAttribute(AttributeName = "Location")] + public string Location + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs new file mode 100644 index 00000000..593790cf --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Direct3D")] + public class BDirect3D + { + [XmlAttribute(AttributeName = "HardwareVersion")] + public string HardwareVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "FeatureLevelMajor")] + public string FeatureLevelMajor + { + get; set; + } + + [XmlAttribute(AttributeName = "FeatureLevelMinor")] + public string FeatureLevelMinor + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs new file mode 100644 index 00000000..81a40ad3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Memory")] + public class BMemory + { + [XmlAttribute(AttributeName = "MinSizeInMB")] + public string MinSizeInMB + { + get; set; + } + + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs new file mode 100644 index 00000000..9ea6e174 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.NFC")] + public class BNFC + { + [XmlAttribute(AttributeName = "Capability")] + public string Capability + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs new file mode 100644 index 00000000..c17b831d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegDword")] + public class BRegDword + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Data")] + public string Data + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs new file mode 100644 index 00000000..b2b67964 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegSz")] + public class BRegSz + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Data")] + public string Data + { + get; set; + } + + [XmlAttribute(AttributeName = "RegType32")] + public string RegType32 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs new file mode 100644 index 00000000..7e88f4fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegValueExists")] + public class BRegValueExists + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + + [XmlAttribute(AttributeName = "RegType32")] + public string RegType32 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs new file mode 100644 index 00000000..aa0d78da --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.SensorById")] + public class BSensorById + { + [XmlAttribute(AttributeName = "Id")] + public string Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs new file mode 100644 index 00000000..019efe1d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.SystemMetric")] + public class BSystemMetric + { + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Index")] + public string Index + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs new file mode 100644 index 00000000..a79b1e1f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.VideoMemory")] + public class BVideoMemory + { + [XmlAttribute(AttributeName = "MinSizeInMB")] + public string MinSizeInMB + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs new file mode 100644 index 00000000..e769e912 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.WindowsVersion")] + public class BWindowsVersion + { + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "MajorVersion")] + public string MajorVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "MinorVersion")] + public string MinorVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "BuildNumber")] + public string BuildNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs new file mode 100644 index 00000000..77147928 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.WmiQuery")] + public class BWmiQuery + { + [XmlAttribute(AttributeName = "Namespace")] + public string Namespace + { + get; set; + } + + [XmlAttribute(AttributeName = "WqlQuery")] + public string WqlQuery + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs new file mode 100644 index 00000000..66a59af2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "BlockMapDigest")] + public class BlockMapDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs new file mode 100644 index 00000000..bd62d5de --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "BundledUpdates")] + public class BundledUpdates + { + [XmlElement(ElementName = "AtLeastOne")] + public AtLeastOne AtLeastOne + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs new file mode 100644 index 00000000..89d27559 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "CategoryInformation")] + public class CategoryInformation + { + [XmlAttribute(AttributeName = "CategoryType")] + public string CategoryType + { + get; set; + } + + [XmlAttribute(AttributeName = "ProhibitsSubcategories")] + public string ProhibitsSubcategories + { + get; set; + } + + [XmlAttribute(AttributeName = "ProhibitsUpdates")] + public string ProhibitsUpdates + { + get; set; + } + + [XmlAttribute(AttributeName = "DisplayOrder")] + public string DisplayOrder + { + get; set; + } + + [XmlAttribute(AttributeName = "ExcludedByDefault")] + public string ExcludedByDefault + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs new file mode 100644 index 00000000..056933f3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs @@ -0,0 +1,132 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "ExtendedProperties")] + public class ExtendedProperties + { + [XmlAttribute(AttributeName = "DefaultPropertiesLanguage")] + public string DefaultPropertiesLanguage + { + get; set; + } + + [XmlAttribute(AttributeName = "Handler")] + public string Handler + { + get; set; + } + + [XmlAttribute(AttributeName = "CreationDate")] + public string CreationDate + { + get; set; + } + + [XmlAttribute(AttributeName = "IsAppxFramework")] + public string IsAppxFramework + { + get; set; + } + + [XmlAttribute(AttributeName = "CompatibleProtocolVersion")] + public string CompatibleProtocolVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "FromStoreService")] + public string FromStoreService + { + get; set; + } + + [XmlAttribute(AttributeName = "ContentType")] + public string ContentType + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageIdentityName")] + public string PackageIdentityName + { + get; set; + } + + [XmlAttribute(AttributeName = "LegacyMobileProductId")] + public string LegacyMobileProductId + { + get; set; + } + + [XmlElement(ElementName = "InstallationBehavior")] + public string InstallationBehavior + { + get; set; + } + + [XmlAttribute(AttributeName = "MaxDownloadSize")] + public string MaxDownloadSize + { + get; set; + } + + [XmlAttribute(AttributeName = "MinDownloadSize")] + public string MinDownloadSize + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageContentId")] + public string PackageContentId + { + get; set; + } + + [XmlAttribute(AttributeName = "ProductName")] + public string ProductName + { + get; set; + } + + [XmlAttribute(AttributeName = "ReleaseVersion")] + public string ReleaseVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "AutoSelectOnWebsites")] + public string AutoSelectOnWebsites + { + get; set; + } + + [XmlAttribute(AttributeName = "BrowseOnly")] + public string BrowseOnly + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs new file mode 100644 index 00000000..8b7bff80 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "File")] + public class File + { + [XmlElement(ElementName = "AdditionalDigest")] + public AdditionalDigest AdditionalDigest + { + get; set; + } + + [XmlElement(ElementName = "PiecesHashDigest")] + public PiecesHashDigest PiecesHashDigest + { + get; set; + } + + [XmlElement(ElementName = "BlockMapDigest")] + public BlockMapDigest BlockMapDigest + { + get; set; + } + + [XmlAttribute(AttributeName = "FileName")] + public string FileName + { + get; set; + } + + [XmlAttribute(AttributeName = "Digest")] + public string Digest + { + get; set; + } + + [XmlAttribute(AttributeName = "DigestAlgorithm")] + public string DigestAlgorithm + { + get; set; + } + + [XmlAttribute(AttributeName = "Size")] + public string Size + { + get; set; + } + + [XmlAttribute(AttributeName = "Modified")] + public string Modified + { + get; set; + } + + [XmlAttribute(AttributeName = "InstallerSpecificIdentifier")] + public string InstallerSpecificIdentifier + { + get; set; + } + + [XmlAttribute(AttributeName = "PatchingType")] + public string PatchingType + { + get; set; + } + + public override string? ToString() + { + return !string.IsNullOrEmpty(FileName) ? PatchingType + ":" + FileName : base.ToString(); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs new file mode 100644 index 00000000..b825c0fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Files")] + public class Files + { + [XmlElement(ElementName = "File")] + public File[] File + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs new file mode 100644 index 00000000..80448494 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "HandlerSpecificData")] + public class HandlerSpecificData + { + [XmlElement(ElementName = "CategoryInformation")] + public CategoryInformation CategoryInformation + { + get; set; + } + + [XmlAttribute(AttributeName = "type")] + public string Type + { + get; set; + } + + [XmlElement(ElementName = "AppxPackageInstallData")] + public AppxPackageInstallData AppxPackageInstallData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs new file mode 100644 index 00000000..7020f1a6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "IsInstallable")] + public class IsInstallable + { + [XmlElement(ElementName = "AppxPackageInstallable")] + public string AppxPackageInstallable + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs new file mode 100644 index 00000000..545bcff0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs @@ -0,0 +1,114 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "IsInstalled")] + public class IsInstalled + { + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "True")] + public string True + { + get; set; + } + + [XmlElement(ElementName = "Or")] + public Or Or + { + get; set; + } + + [XmlElement(ElementName = "And")] + public And And + { + get; set; + } + + [XmlElement(ElementName = "b.WmiQuery")] + public BWmiQuery BWmiQuery + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + + [XmlElement(ElementName = "b.SystemMetric")] + public BSystemMetric BSystemMetric + { + get; set; + } + + [XmlElement(ElementName = "b.Memory")] + public BMemory BMemory + { + get; set; + } + + [XmlElement(ElementName = "b.Direct3D")] + public BDirect3D BDirect3D + { + get; set; + } + + [XmlElement(ElementName = "b.SensorById")] + public BSensorById BSensorById + { + get; set; + } + + [XmlElement(ElementName = "b.Camera")] + public BCamera BCamera + { + get; set; + } + + [XmlElement(ElementName = "b.NFC")] + public BNFC BNFC + { + get; set; + } + + [XmlElement(ElementName = "b.VideoMemory")] + public BVideoMemory BVideoMemory + { + get; set; + } + + [XmlElement(ElementName = "AppxPackageInstalled")] + public string AppxPackageInstalled + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs new file mode 100644 index 00000000..d2e55388 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "LocalizedProperties")] + public class LocalizedProperties + { + [XmlElement(ElementName = "Language")] + public string Language + { + get; set; + } + + [XmlElement(ElementName = "Title")] + public string Title + { + get; set; + } + + [XmlElement(ElementName = "Description")] + public string Description + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs new file mode 100644 index 00000000..c3a2df7f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Metadata")] + public class Metadata + { + [XmlElement(ElementName = "AppxPackageMetadata")] + public AppxPackageMetadata AppxPackageMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs new file mode 100644 index 00000000..a8e45d01 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Not")] + public class Not + { + [XmlElement(ElementName = "b.RegValueExists")] + public BRegValueExists BRegValueExists + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword BRegDword + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs new file mode 100644 index 00000000..3059cb41 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs @@ -0,0 +1,63 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Or")] + public class Or + { + [XmlElement(ElementName = "Not")] + public Not Not + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword BRegDword + { + get; set; + } + + [XmlElement(ElementName = "And")] + public And[] And + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + /*[XmlElement(ElementName = "Or")] + public Or Or { get; set; }*/ // TODO: fix + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs new file mode 100644 index 00000000..49205010 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "PiecesHashDigest")] + public class PiecesHashDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs new file mode 100644 index 00000000..1298b822 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Prerequisites")] + public class Prerequisites + { + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity[] UpdateIdentity + { + get; set; + } + + [XmlElement(ElementName = "AtLeastOne")] + public AtLeastOne[] AtLeastOne + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs new file mode 100644 index 00000000..a3528334 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Properties")] + public class Properties + { + [XmlAttribute(AttributeName = "UpdateType")] + public string UpdateType + { + get; set; + } + + [XmlAttribute(AttributeName = "PerUser")] + public string PerUser + { + get; set; + } + + [XmlElement(ElementName = "SecuredFragment")] + public string SecuredFragment + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageRank")] + public string PackageRank + { + get; set; + } + + [XmlAttribute(AttributeName = "ExplicitlyDeployable")] + public string ExplicitlyDeployable + { + get; set; + } + + [XmlAttribute(AttributeName = "ApplyPackageRank")] + public string ApplyPackageRank + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs new file mode 100644 index 00000000..68761fe2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Relationships")] + public class Relationships + { + [XmlElement(ElementName = "Prerequisites")] + public Prerequisites Prerequisites + { + get; set; + } + + [XmlElement(ElementName = "BundledUpdates")] + public BundledUpdates BundledUpdates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs new file mode 100644 index 00000000..18d765c8 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "UpdateIdentity")] + public class UpdateIdentity + { + [XmlAttribute(AttributeName = "UpdateID")] + public string UpdateID + { + get; set; + } + + [XmlAttribute(AttributeName = "RevisionNumber")] + public string RevisionNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs new file mode 100644 index 00000000..1d752ad6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Xml")] + public class Xml + { + [XmlElement(ElementName = "LocalizedProperties")] + public LocalizedProperties LocalizedProperties + { + get; set; + } + + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity UpdateIdentity + { + get; set; + } + + [XmlElement(ElementName = "Properties")] + public Properties Properties + { + get; set; + } + + [XmlElement(ElementName = "ApplicabilityRules")] + public ApplicabilityRules ApplicabilityRules + { + get; set; + } + + [XmlElement(ElementName = "ExtendedProperties")] + public ExtendedProperties ExtendedProperties + { + get; set; + } + + [XmlElement(ElementName = "HandlerSpecificData")] + public HandlerSpecificData HandlerSpecificData + { + get; set; + } + + [XmlElement(ElementName = "Relationships")] + public Relationships Relationships + { + get; set; + } + + [XmlElement(ElementName = "Files")] + public Files Files + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs similarity index 63% rename from src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs rename to src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs index 3de89bd2..04ea41bf 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs @@ -21,241 +21,8 @@ */ using System; -namespace UnifiedUpdatePlatform.Services.WindowsUpdate +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { - public enum MachineType : ushort - { - unknown = 0x0, - x86 = 0x14c, - r4000 = 0x166, - wcemipsv2 = 0x169, - axp = 0x184, - sh3 = 0x1a2, - sh3dsp = 0x1a3, - sh4 = 0x1a6, - sh5 = 0x1a8, - arm = 0x1c0, - thumb = 0x1c2, - woa = 0x1c4, - am33 = 0x1d3, - powerpc = 0x1f0, - powerpcfp = 0x1f1, - ia64 = 0x200, - mips16 = 0x266, - mipsfpu = 0x366, - mipsfpu16 = 0x466, - ebc = 0xebc, - amd64 = 0x8664, - m32r = 0x9041, - arm64 = 0xaa64, - } - - public enum OSSkuId - { - Undefined = 0x00000000, - Ultimate = 0x00000001, - HomeBasic = 0x00000002, - HomePremium = 0x00000003, - Enterprise = 0x00000004, - HomeBasicN = 0x00000005, - Business = 0x00000006, - StandardServer = 0x00000007, - DatacenterServer = 0x00000008, - SmallBusinessServer = 0x00000009, - EnterpriseServer = 0x0000000A, - Starter = 0x0000000B, - DatacenterServerCore = 0x0000000C, - StandardServerCore = 0x0000000D, - EnterpriseServerCore = 0x0000000E, - EnterpriseServerIA64 = 0x0000000F, - BusinessN = 0x00000010, - WebServer = 0x00000011, - ClusterServer = 0x00000012, - HomeServer = 0x00000013, - StorageExpressServer = 0x00000014, - StorageStandardServer = 0x00000015, - StorageWorkgroupServer = 0x00000016, - StorageEnterpriseServer = 0x00000017, - ServerForSmallBusiness = 0x00000018, - SmallBusinessServerPremium = 0x00000019, - HomePremiumN = 0x0000001A, - EnterpriseN = 0x0000001B, - UltimateN = 0x0000001C, - WebServerCore = 0x0000001D, - MediumBusinessServerManagement = 0x0000001E, - MediumBusinessServerSecurity = 0x0000001F, - MediumBusinessServerMessaging = 0x00000020, - ServerFoundation = 0x00000021, - HomePremiumServer = 0x00000022, - ServerForSmallBusinessV = 0x00000023, - StandardServerV = 0x00000024, - DatacenterServerV = 0x00000025, - EnterpriseServerV = 0x00000026, - DatacenterServerCoreV = 0x00000027, - StandardServerCoreV = 0x00000028, - EnterpriseServerCoreV = 0x00000029, - HyperV = 0x0000002A, - StorageExpressServerCore = 0x0000002B, - StorageServerStandardCore = 0x0000002C, - StorageWorkgroupServerCore = 0x0000002D, - StorageEnterpriseServerCore = 0x0000002E, - StarterN = 0x0000002F, - Professional = 0x00000030, - ProfessionalN = 0x00000031, - SBSolutionServer = 0x00000032, - ServerForSBSolutions = 0x00000033, - StandardServerSolutions = 0x00000034, - StandardServerSolutionsCore = 0x00000035, - SBSolutionServerEM = 0x00000036, - ServerForSBSolutionsEM = 0x00000037, - SolutionEmbeddedServer = 0x00000038, - SolutionEmbeddedServerCore = 0x00000039, - ProfessionalEmbedded = 0x0000003A, - EssentialBusinessServerMGMT = 0x0000003B, - EssentialBusinessServerADDL = 0x0000003C, - EssentialBusinessServerMGMTSVC = 0x0000003D, - EssentialBusinessServerADDLSVC = 0x0000003E, - SmallBusinessServerPremiumCore = 0x0000003F, - ClusterServerV = 0x00000040, - Embedded = 0x00000041, - StarterE = 0x00000042, - HomeBasicE = 0x00000043, - HomePremiumE = 0x00000044, - ProfessionalE = 0x00000045, - EnterpriseE = 0x00000046, - UltimateE = 0x00000047, - EnterpriseEvaluation = 0x00000048, - Unknown49, - Prerelease = 0x0000004A, - Unknown4B, - MultipointStandardServer = 0x0000004C, - MultipointPremiumServer = 0x0000004D, - Unknown4E = 0x0000004E, - StandardEvaluationServer = 0x0000004F, - DatacenterEvaluationServer = 0x00000050, - PrereleaseARM = 0x00000051, - PrereleaseN = 0x00000052, - Unknown53, - EnterpriseNEvaluation = 0x00000054, - EmbeddedAutomotive = 0x00000055, - EmbeddedIndustryA = 0x00000056, - ThinPC = 0x00000057, - EmbeddedA = 0x00000058, - EmbeddedIndustry = 0x00000059, - EmbeddedE = 0x0000005A, - EmbeddedIndustryE = 0x0000005B, - EmbeddedIndustryAE = 0x0000005C, - Unknown5D, - Unknown5E, - StorageWorkgroupEvaluationServer = 0x0000005F, - StorageStandardEvaluationServer = 0x00000060, - CoreARM = 0x00000061, - CoreN = 0x00000062, - CoreCountrySpecific = 0x00000063, - CoreSingleLanguage = 0x00000064, - Core = 0x00000065, - Unknown66, - ProfessionalWMC = 0x00000067, - MobileCore = 0x00000068, - EmbeddedIndustryEval = 0x00000069, - EmbeddedIndustryEEval = 0x0000006A, - EmbeddedEval = 0x0000006B, - EmbeddedEEval = 0x0000006C, - NanoServer = 0x0000006D, - CloudStorageServer = 0x0000006E, - CoreConnected = 0x0000006F, - ProfessionalStudent = 0x00000070, - CoreConnectedN = 0x00000071, - ProfessionalStudentN = 0x00000072, - CoreConnectedSingleLanguage = 0x00000073, - CoreConnectedCountrySpecific = 0x00000074, - ConnectedCAR = 0x00000075, - IndustryHandheld = 0x00000076, - PPIPro = 0x00000077, - ARM64Server = 0x00000078, - Education = 0x00000079, - EducationN = 0x0000007A, - IoTUAP = 0x0000007B, - CloudHostInfrastructureServer = 0x0000007C, - EnterpriseS = 0x0000007D, - EnterpriseSN = 0x0000007E, - ProfessionalS = 0x0000007F, - ProfessionalSN = 0x00000080, - EnterpriseSEvaluation = 0x00000081, - EnterpriseSNEvaluation = 0x00000082, - Unknown83, - Unknown84, - Unknown85, - Unknown86, - Holographic = 0x00000087, - HolographicBusiness = 0x00000088, - Unknown89 = 0x00000089, - ProSingleLanguage = 0x0000008A, - ProChina = 0x0000008B, - EnterpriseSubscription = 0x0000008C, - EnterpriseSubscriptionN = 0x0000008D, - Unknown8E, - DatacenterNanoServer = 0x0000008F, - StandardNanoServer = 0x00000090, - DatacenterAServerCore = 0x00000091, - StandardAServerCore = 0x00000092, - DatacenterWSServerCore = 0x00000093, - StandardWSServerCore = 0x00000094, - UtilityVM = 0x00000095, - Unknown96, - Unknown97, - Unknown98, - Unknown99, - Unknown9A, - Unknown9B, - Unknown9C, - Unknown9D, - Unknown9E, - DatacenterEvaluationServerCore = 0x0000009F, - StandardEvaluationServerCore = 0x000000A0, - ProWorkstation = 0x000000A1, - ProWorkstationN = 0x000000A2, - UnknownA3, - ProForEducation = 0x000000A4, - ProForEducationN = 0x000000A5, - UnknownA6, - UnknownA7, - AzureServerCore = 0x000000A8, - AzureNanoServer = 0x000000A9, - UnknownAA = 0x000000AA, - EnterpriseG = 0x000000AB, - EnterpriseGN = 0x000000AC, - UnknownAD, - UnknownAE, - ServerRDSH = 0x000000AF, - UnknownB0, - UnknownB1, - Cloud = 0x000000B2, - CloudN = 0x000000B3, - HubOS = 0x000000B4, - UnknownB5, - OneCoreUpdateOS = 0x000000B6, - CloudE = 0x000000B7, - Andromeda = 0x000000B8, - IoTOS = 0x000000B9, - CloudEN = 0x000000BA, - IoTEdgeOS = 0x000000BB, - IoTEnterprise = 0x000000BC, - Lite = 0x000000BD, - UnknownBE, - IoTEnterpriseS = 0x000000BF, - XboxSystemOS = 0x000000C0, - XboxNativeOS = 0x000000C1, - XboxGameOS = 0x000000C2, - XboxERAOS = 0x000000C3, - XboxDurangoHostOS = 0x000000C4, - XboxScarlettHostOS = 0x000000C5, - XboxKeystone = 0x000000C6, - AzureStackHCIServerCore = 0x00000196, - DatacenterServerAzureEdition = 0x00000197, - DatacenterServerCoreAzureEdition = 0x00000198 - } - public class CTAC { public string DeviceAttributes @@ -520,13 +287,5 @@ private void BuildCTAC( this.SyncCurrentVersionOnly = SyncCurrentVersionOnly; } - - public static string GenerateDeviceId(string Manufacturer, string Family, string Product, string Sku) - { - string inputString = Manufacturer + "&" + Family + "&" + Product + "&" + Sku; - Guid guidFromString = ComputerHardwareIDProvider.Class5GuidFromString(inputString); - string guidString = $"{{{guidFromString}}}"; - return guidString; - } } } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs new file mode 100644 index 00000000..3ef5001e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs @@ -0,0 +1,15 @@ +using System; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + internal class ComputerHardwareID + { + public static string GenerateDeviceId(string Manufacturer, string Family, string Product, string Sku) + { + string inputString = Manufacturer + "&" + Family + "&" + Product + "&" + Sku; + Guid guidFromString = ComputerHardwareIDProvider.Class5GuidFromString(inputString); + string guidString = $"{{{guidFromString}}}"; + return guidString; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs similarity index 68% rename from src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs rename to src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs index 3936d187..9662696b 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs @@ -2,11 +2,11 @@ using System.Security.Cryptography; using System.Text; -namespace UnifiedUpdatePlatform.Services.WindowsUpdate +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { public static class ComputerHardwareIDProvider { - private static readonly byte[] hwidIv = { 0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + private static readonly byte[] hardwareIDIv = { 0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; public static Guid Class5GuidFromString(string input) { @@ -19,14 +19,17 @@ public static Guid Class5GuidFromString(string input) private static byte[] GetPartialHash(string input) { byte[] partialHash; - using (SHA1 sha1Csp = SHA1.Create()) - { - _ = sha1Csp.TransformBlock(hwidIv, 0, hwidIv.Length, null, 0); - byte[] dataBin = Encoding.Unicode.GetBytes(input); - _ = sha1Csp.TransformFinalBlock(dataBin, 0, dataBin.Length); - partialHash = new byte[16]; - Array.Copy(sha1Csp.Hash, partialHash, partialHash.Length); - } + + using SHA1 sha1Csp = SHA1.Create(); + + _ = sha1Csp.TransformBlock(hardwareIDIv, 0, hardwareIDIv.Length, null, 0); + + byte[] dataBin = Encoding.Unicode.GetBytes(input); + _ = sha1Csp.TransformFinalBlock(dataBin, 0, dataBin.Length); + + partialHash = new byte[16]; + Array.Copy(sha1Csp.Hash, partialHash, partialHash.Length); + return partialHash; } @@ -54,4 +57,4 @@ private static uint SwapBytes32(uint x) return ((x & 0xFF00FF00) >> 8) | ((x & 0x00FF00FF) << 8); } } -} +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs new file mode 100644 index 00000000..0ea195b0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public enum MachineType : ushort + { + unknown = 0x0, + x86 = 0x14c, + r4000 = 0x166, + wcemipsv2 = 0x169, + axp = 0x184, + sh3 = 0x1a2, + sh3dsp = 0x1a3, + sh4 = 0x1a6, + sh5 = 0x1a8, + arm = 0x1c0, + thumb = 0x1c2, + woa = 0x1c4, + am33 = 0x1d3, + powerpc = 0x1f0, + powerpcfp = 0x1f1, + ia64 = 0x200, + mips16 = 0x266, + mipsfpu = 0x366, + mipsfpu16 = 0x466, + ebc = 0xebc, + amd64 = 0x8664, + m32r = 0x9041, + arm64 = 0xaa64, + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs new file mode 100644 index 00000000..1dc604b6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs @@ -0,0 +1,229 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public enum OSSkuId + { + Undefined = 0x00000000, + Ultimate = 0x00000001, + HomeBasic = 0x00000002, + HomePremium = 0x00000003, + Enterprise = 0x00000004, + HomeBasicN = 0x00000005, + Business = 0x00000006, + StandardServer = 0x00000007, + DatacenterServer = 0x00000008, + SmallBusinessServer = 0x00000009, + EnterpriseServer = 0x0000000A, + Starter = 0x0000000B, + DatacenterServerCore = 0x0000000C, + StandardServerCore = 0x0000000D, + EnterpriseServerCore = 0x0000000E, + EnterpriseServerIA64 = 0x0000000F, + BusinessN = 0x00000010, + WebServer = 0x00000011, + ClusterServer = 0x00000012, + HomeServer = 0x00000013, + StorageExpressServer = 0x00000014, + StorageStandardServer = 0x00000015, + StorageWorkgroupServer = 0x00000016, + StorageEnterpriseServer = 0x00000017, + ServerForSmallBusiness = 0x00000018, + SmallBusinessServerPremium = 0x00000019, + HomePremiumN = 0x0000001A, + EnterpriseN = 0x0000001B, + UltimateN = 0x0000001C, + WebServerCore = 0x0000001D, + MediumBusinessServerManagement = 0x0000001E, + MediumBusinessServerSecurity = 0x0000001F, + MediumBusinessServerMessaging = 0x00000020, + ServerFoundation = 0x00000021, + HomePremiumServer = 0x00000022, + ServerForSmallBusinessV = 0x00000023, + StandardServerV = 0x00000024, + DatacenterServerV = 0x00000025, + EnterpriseServerV = 0x00000026, + DatacenterServerCoreV = 0x00000027, + StandardServerCoreV = 0x00000028, + EnterpriseServerCoreV = 0x00000029, + HyperV = 0x0000002A, + StorageExpressServerCore = 0x0000002B, + StorageServerStandardCore = 0x0000002C, + StorageWorkgroupServerCore = 0x0000002D, + StorageEnterpriseServerCore = 0x0000002E, + StarterN = 0x0000002F, + Professional = 0x00000030, + ProfessionalN = 0x00000031, + SBSolutionServer = 0x00000032, + ServerForSBSolutions = 0x00000033, + StandardServerSolutions = 0x00000034, + StandardServerSolutionsCore = 0x00000035, + SBSolutionServerEM = 0x00000036, + ServerForSBSolutionsEM = 0x00000037, + SolutionEmbeddedServer = 0x00000038, + SolutionEmbeddedServerCore = 0x00000039, + ProfessionalEmbedded = 0x0000003A, + EssentialBusinessServerMGMT = 0x0000003B, + EssentialBusinessServerADDL = 0x0000003C, + EssentialBusinessServerMGMTSVC = 0x0000003D, + EssentialBusinessServerADDLSVC = 0x0000003E, + SmallBusinessServerPremiumCore = 0x0000003F, + ClusterServerV = 0x00000040, + Embedded = 0x00000041, + StarterE = 0x00000042, + HomeBasicE = 0x00000043, + HomePremiumE = 0x00000044, + ProfessionalE = 0x00000045, + EnterpriseE = 0x00000046, + UltimateE = 0x00000047, + EnterpriseEvaluation = 0x00000048, + Unknown49, + Prerelease = 0x0000004A, + Unknown4B, + MultipointStandardServer = 0x0000004C, + MultipointPremiumServer = 0x0000004D, + Unknown4E = 0x0000004E, + StandardEvaluationServer = 0x0000004F, + DatacenterEvaluationServer = 0x00000050, + PrereleaseARM = 0x00000051, + PrereleaseN = 0x00000052, + Unknown53, + EnterpriseNEvaluation = 0x00000054, + EmbeddedAutomotive = 0x00000055, + EmbeddedIndustryA = 0x00000056, + ThinPC = 0x00000057, + EmbeddedA = 0x00000058, + EmbeddedIndustry = 0x00000059, + EmbeddedE = 0x0000005A, + EmbeddedIndustryE = 0x0000005B, + EmbeddedIndustryAE = 0x0000005C, + Unknown5D, + Unknown5E, + StorageWorkgroupEvaluationServer = 0x0000005F, + StorageStandardEvaluationServer = 0x00000060, + CoreARM = 0x00000061, + CoreN = 0x00000062, + CoreCountrySpecific = 0x00000063, + CoreSingleLanguage = 0x00000064, + Core = 0x00000065, + Unknown66, + ProfessionalWMC = 0x00000067, + MobileCore = 0x00000068, + EmbeddedIndustryEval = 0x00000069, + EmbeddedIndustryEEval = 0x0000006A, + EmbeddedEval = 0x0000006B, + EmbeddedEEval = 0x0000006C, + NanoServer = 0x0000006D, + CloudStorageServer = 0x0000006E, + CoreConnected = 0x0000006F, + ProfessionalStudent = 0x00000070, + CoreConnectedN = 0x00000071, + ProfessionalStudentN = 0x00000072, + CoreConnectedSingleLanguage = 0x00000073, + CoreConnectedCountrySpecific = 0x00000074, + ConnectedCAR = 0x00000075, + IndustryHandheld = 0x00000076, + PPIPro = 0x00000077, + ARM64Server = 0x00000078, + Education = 0x00000079, + EducationN = 0x0000007A, + IoTUAP = 0x0000007B, + CloudHostInfrastructureServer = 0x0000007C, + EnterpriseS = 0x0000007D, + EnterpriseSN = 0x0000007E, + ProfessionalS = 0x0000007F, + ProfessionalSN = 0x00000080, + EnterpriseSEvaluation = 0x00000081, + EnterpriseSNEvaluation = 0x00000082, + Unknown83, + Unknown84, + Unknown85, + Unknown86, + Holographic = 0x00000087, + HolographicBusiness = 0x00000088, + Unknown89 = 0x00000089, + ProSingleLanguage = 0x0000008A, + ProChina = 0x0000008B, + EnterpriseSubscription = 0x0000008C, + EnterpriseSubscriptionN = 0x0000008D, + Unknown8E, + DatacenterNanoServer = 0x0000008F, + StandardNanoServer = 0x00000090, + DatacenterAServerCore = 0x00000091, + StandardAServerCore = 0x00000092, + DatacenterWSServerCore = 0x00000093, + StandardWSServerCore = 0x00000094, + UtilityVM = 0x00000095, + Unknown96, + Unknown97, + Unknown98, + Unknown99, + Unknown9A, + Unknown9B, + Unknown9C, + Unknown9D, + Unknown9E, + DatacenterEvaluationServerCore = 0x0000009F, + StandardEvaluationServerCore = 0x000000A0, + ProWorkstation = 0x000000A1, + ProWorkstationN = 0x000000A2, + UnknownA3, + ProForEducation = 0x000000A4, + ProForEducationN = 0x000000A5, + UnknownA6, + UnknownA7, + AzureServerCore = 0x000000A8, + AzureNanoServer = 0x000000A9, + UnknownAA = 0x000000AA, + EnterpriseG = 0x000000AB, + EnterpriseGN = 0x000000AC, + UnknownAD, + UnknownAE, + ServerRDSH = 0x000000AF, + UnknownB0, + UnknownB1, + Cloud = 0x000000B2, + CloudN = 0x000000B3, + HubOS = 0x000000B4, + UnknownB5, + OneCoreUpdateOS = 0x000000B6, + CloudE = 0x000000B7, + Andromeda = 0x000000B8, + IoTOS = 0x000000B9, + CloudEN = 0x000000BA, + IoTEdgeOS = 0x000000BB, + IoTEnterprise = 0x000000BC, + Lite = 0x000000BD, + UnknownBE, + IoTEnterpriseS = 0x000000BF, + XboxSystemOS = 0x000000C0, + XboxNativeOS = 0x000000C1, + XboxGameOS = 0x000000C2, + XboxERAOS = 0x000000C3, + XboxDurangoHostOS = 0x000000C4, + XboxScarlettHostOS = 0x000000C5, + XboxKeystone = 0x000000C6, + AzureStackHCIServerCore = 0x00000196, + DatacenterServerAzureEdition = 0x00000197, + DatacenterServerCoreAzureEdition = 0x00000198 + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj new file mode 100644 index 00000000..356526b2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj @@ -0,0 +1,9 @@ + + + net8.0 + AnyCPU;x64;x86;arm64 + $(SolutionDir)build\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\ + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\ + true + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs new file mode 100644 index 00000000..6c185310 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableBuild + { + public UpdateData UpdateData + { + get; set; + } + public string Title + { + get; set; + } + public string BuildString + { + get; set; + } + public string Description + { + get; set; + } + public string Created + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs new file mode 100644 index 00000000..e62da88c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs @@ -0,0 +1,44 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableBuildLanguages + { + public string Title + { + get; set; + } + public string LanguageCode + { + get; set; + } + public Uri FlagUri + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs new file mode 100644 index 00000000..48344ec6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs @@ -0,0 +1,34 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableEdition + { + public string Edition + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs index 543f90ce..11514482 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs @@ -27,101 +27,15 @@ using System.Linq; using System.Net; using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate { - public static class StringExtensions + public static partial class BuildFetcher { - public static bool Contains(this string str, string substring, - StringComparison comp) - { - if (substring == null) - { - throw new ArgumentNullException(nameof(substring), - "substring cannot be null."); - } - else if (!Enum.IsDefined(typeof(StringComparison), comp)) - { - throw new ArgumentException("comp is not a member of StringComparison", - nameof(comp)); - } - - return str.Contains(substring, comp); - } - - public static string Replace(this string originalString, string oldValue, string newValue, StringComparison comparisonType) - { - int startIndex = 0; - while (true) - { - startIndex = originalString.IndexOf(oldValue, startIndex, comparisonType); - if (startIndex == -1) - { - break; - } - - originalString = originalString[..startIndex] + newValue + originalString[(startIndex + oldValue.Length)..]; - - startIndex += newValue.Length; - } - - return originalString; - } - } - - public static class BuildFetcher - { - public class AvailableBuild - { - public UpdateData UpdateData - { - get; set; - } - public string Title - { - get; set; - } - public string BuildString - { - get; set; - } - public string Description - { - get; set; - } - public string Created - { - get; set; - } - } - - public class AvailableBuildLanguages - { - public string Title - { - get; set; - } - public string LanguageCode - { - get; set; - } - public Uri FlagUri - { - get; set; - } - } - - public class AvailableEdition - { - public string Edition - { - get; set; - } - } - public static async Task GetAvailableBuildsAsync(MachineType machineType) { - List availableBuilds = new(); + List availableBuilds = []; IEnumerable updates = await GetUpdates(machineType); @@ -145,7 +59,7 @@ public static async Task GetAvailableBuildsAsync(MachineType m availableBuilds.Add(availableBuild); } - return availableBuilds.OrderBy(x => x.Title).ToArray(); + return [.. availableBuilds.OrderBy(x => x.Title)]; } public static async Task GetAvailableBuildLanguagesAsync(UpdateData UpdateData) @@ -159,16 +73,16 @@ public static async Task GetAvailableBuildLanguagesAs availableBuildLanguages.Sort((x, y) => x.Title.CompareTo(y.Title)); - return availableBuildLanguages.ToArray(); + return [.. availableBuildLanguages]; } public static async Task GetAvailableEditions(UpdateData UpdateData, string languagecode) { - List availableEditions = new(); + List availableEditions = []; - List metadataCabs = new(); + List metadataCabs = []; - foreach (CExtendedUpdateInfoXml.File file in UpdateData.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in UpdateData.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -203,7 +117,7 @@ public static async Task GetAvailableEditions(UpdateData Upd availableEditions.Add(new AvailableEdition() { Edition = edition }); } - foreach (CExtendedUpdateInfoXml.File metadataCab in metadataCabs) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File metadataCab in metadataCabs) { FileExchangeV3FileDownloadInformation fileDownloadInfo = await FE3Handler.GetFileUrl(UpdateData, metadataCabs.First().Digest); if (fileDownloadInfo == null) @@ -271,7 +185,7 @@ public static async Task GetAvailableEditions(UpdateData Upd availableEditions.Sort((x, y) => x.Edition.CompareTo(y.Edition)); exit: - return availableEditions.ToArray(); + return [.. availableEditions]; } private static UpdateData TrimDeltasFromUpdateData(UpdateData update) @@ -292,9 +206,9 @@ private static void AddUpdatesIfNotPresentAlready(ICollection update { IEnumerable potentialDupes = updates.Where(x => x.Xml.Files.File.Length == update.Xml.Files.File.Length); - CExtendedUpdateInfoXml.File metadataCab = null; + Models.FE3.XML.ExtendedUpdateInfo.File metadataCab = null; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -312,9 +226,9 @@ private static void AddUpdatesIfNotPresentAlready(ICollection update foreach (UpdateData potentialDupe in potentialDupes) { - CExtendedUpdateInfoXml.File metadataCab2 = null; + Models.FE3.XML.ExtendedUpdateInfo.File metadataCab2 = null; - foreach (CExtendedUpdateInfoXml.File file in potentialDupe.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in potentialDupe.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -371,11 +285,11 @@ private static Dictionary GetRingCTACs(MachineType machineType, OS private static async Task> GetUpdates(MachineType MachineType) { - HashSet updates = new(); + HashSet updates = []; CTAC[] ctacs = GetRingCTACs(MachineType, OSSkuId.Professional).Union(GetRingCTACs(MachineType, OSSkuId.PPIPro)).Select(x => x.Key).ToArray(); - List>> tasks = new(); + List>> tasks = []; foreach (CTAC ctac in ctacs) { tasks.Add(GetUpdatesFor(ctac)); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs index d80a6203..6ee970b0 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs @@ -23,18 +23,16 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate { public static class Constants { - public const string ClientWebServiceServerNamespace = "http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService"; - public const string WindowsUpdateAuthorizationSchema = "http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization"; public const string Endpoint = "https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx"; public const string ClientProtocolVersion = "2.50"; public const string OldCookieExpiration = "2016-07-27T07:18:09Z"; public const string LastChangeDate = "2015-10-21T17:01:07.1472913Z"; public const string SecurityExpirationTimestamp = "2044-08-02T20:09:03Z"; - public static readonly string Action = $"{ClientWebServiceServerNamespace}/"; + public static readonly string Action = $"{Models.Constants.ClientWebServiceServerNamespace}/"; public static readonly string UserAgent = $"Windows-Update-Agent/10.0.10011.16384 Client-Protocol/{ClientProtocolVersion}"; - public static readonly int[] InstalledNonLeafUpdateIDs = new int[] - { + public static readonly int[] InstalledNonLeafUpdateIDs = + [ 1, 2, 3, @@ -111,6 +109,6 @@ public static class Constants 161870057, 161870058, 161870059 - }; + ]; } } \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs new file mode 100644 index 00000000..e57ec8fc --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs @@ -0,0 +1,57 @@ +/* + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +// +// Source: https://raw.githubusercontent.com/ADeltaX/ProtoBuildBot/main/src/BuildChecker/Classes/Helpers/CorrelationVector.cs +// Released under the MIT License (as of 2020-11-04) +// + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + internal partial class CorrelationVector + { + internal enum Settings + { + SYNCREFRESHINTERVAL, + QUEUEDRAININTERVAL, + SNAPSHOTSCHEDULEINTERVAL, + MAXEVENTSIZEINBYTES, + MAXEVENTSPERPOST, + SAMPLERATE, + MAXFILESSPACE, + UPLOADENABLED, + PERSISTENCE, + LATENCY, + HTTPTIMEOUTINTERVAL, + THREADSTOUSEWITHEXECUTOR, + MAXCORRELATIONVECTORLENGTH, + MAXCRITICALCANADDATTEMPTS, + MAXRETRYPERIOD, + BASERETRYPERIOD, + CONSTANTFORRETRYPERIOD, + NORMALEVENTMEMORYQUEUESIZE, + CLLSETTINGSURL, + HOSTSETTINGSETAG, + CLLSETTINGSETAG, + VORTEXPRODURL + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs index 76038ee2..93196776 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs @@ -28,7 +28,7 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate { - internal class CorrelationVector + internal partial class CorrelationVector { private string baseVector; private int currentVector; @@ -37,32 +37,6 @@ internal class CorrelationVector private readonly int id0Length = 16; private bool isInitialized = false; - internal enum Settings - { - SYNCREFRESHINTERVAL, - QUEUEDRAININTERVAL, - SNAPSHOTSCHEDULEINTERVAL, - MAXEVENTSIZEINBYTES, - MAXEVENTSPERPOST, - SAMPLERATE, - MAXFILESSPACE, - UPLOADENABLED, - PERSISTENCE, - LATENCY, - HTTPTIMEOUTINTERVAL, - THREADSTOUSEWITHEXECUTOR, - MAXCORRELATIONVECTORLENGTH, - MAXCRITICALCANADDATTEMPTS, - MAXRETRYPERIOD, - BASERETRYPERIOD, - CONSTANTFORRETRYPERIOD, - NORMALEVENTMEMORYQUEUESIZE, - CLLSETTINGSURL, - HOSTSETTINGSETAG, - CLLSETTINGSETAG, - VORTEXPRODURL - } - internal void Init() { baseVector = SeedCorrelationVector(); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs index 7fcd68b3..bfe1abbf 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs @@ -26,11 +26,21 @@ using System.Net; using System.Net.Http; using System.Text.Json; -using System.Text.Json.Serialization; using System.Threading.Tasks; using System.Xml; using System.Xml.Serialization; -using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate { @@ -76,7 +86,7 @@ private static async Task PostToWindowsUpdateAsync(string method, string return resultString; } - private static CSOAPCommon.Envelope GetEnveloppe(string method, string authorizationToken, bool secured) + private static Envelope GetEnveloppe(string method, string authorizationToken, bool secured) { string _endpoint = Constants.Endpoint; if (secured) @@ -84,42 +94,42 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza _endpoint += "/secured"; } - CSOAPCommon.Envelope envelope = new() + Envelope envelope = new() { - Header = new CSOAPCommon.Header() + Header = new Header() { - Action = new CSOAPCommon.Action() + Action = new Models.FE3.SOAP.Common.Action() { MustUnderstand = "1", Text = Constants.Action + method }, MessageID = $"urn:uuid:{Guid.NewGuid():D}", - To = new CSOAPCommon.To() + To = new To() { MustUnderstand = "1", Text = _endpoint }, - Security = new CSOAPCommon.Security() + Security = new Security() { MustUnderstand = "1", - Timestamp = new CSOAPCommon.Timestamp() + Timestamp = new Timestamp() { Created = DateTime.Now.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"), Expires = Constants.SecurityExpirationTimestamp }, - WindowsUpdateTicketsToken = new CSOAPCommon.WindowsUpdateTicketsToken() + WindowsUpdateTicketsToken = new WindowsUpdateTicketsToken() { Id = "ClientMSA" } } }, - Body = new CSOAPCommon.Body() + Body = new Body() }; if (!string.IsNullOrEmpty(authorizationToken)) { - envelope.Header.Security.WindowsUpdateTicketsToken.TicketType = new CSOAPCommon.TicketType[] - { + envelope.Header.Security.WindowsUpdateTicketsToken.TicketType = + [ new() { Name = "MSA", @@ -133,7 +143,7 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza Version = "1.0", Policy = "MBI_SSL" } - }; + ]; } else { @@ -143,14 +153,14 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza return envelope; } - private static string SerializeSOAPEnvelope(CSOAPCommon.Envelope envelope) + private static string SerializeSOAPEnvelope(Envelope envelope) { if (envelope == null) { return string.Empty; } - XmlSerializer xmlSerializer = new(typeof(CSOAPCommon.Envelope)); + XmlSerializer xmlSerializer = new(typeof(Envelope)); XmlSerializerNamespaces ns = new(); ns.Add("s", "http://www.w3.org/2003/05/soap-envelope"); @@ -162,20 +172,20 @@ private static string SerializeSOAPEnvelope(CSOAPCommon.Envelope envelope) return stringWriter.ToString().Replace("\r\n", "").Replace("\n", ""); } - private static CSOAPCommon.Envelope DeserializeSOAPEnvelope(string message) + private static Envelope DeserializeSOAPEnvelope(string message) { if (message == null) { return null; } - XmlSerializer xmlSerializer = new(typeof(CSOAPCommon.Envelope)); + XmlSerializer xmlSerializer = new(typeof(Envelope)); using StringReader stringReader = new(message); - return (CSOAPCommon.Envelope)xmlSerializer.Deserialize(stringReader); + return (Envelope)xmlSerializer.Deserialize(stringReader); } - private static CExtendedUpdateInfoXml.Xml DeserializeInfoXML(string xml) + private static Xml DeserializeInfoXML(string xml) { if (xml == null) { @@ -184,28 +194,28 @@ private static CExtendedUpdateInfoXml.Xml DeserializeInfoXML(string xml) string message = "" + xml + ""; - XmlSerializer xmlSerializer = new(typeof(CExtendedUpdateInfoXml.Xml)); + XmlSerializer xmlSerializer = new(typeof(Xml)); using StringReader stringReader = new(message); - return (CExtendedUpdateInfoXml.Xml)xmlSerializer.Deserialize(stringReader); + return (Xml)xmlSerializer.Deserialize(stringReader); } - private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string json) + private static AppxMetadataJson DeserializeAppxJSON(string json) { - return JsonSerializer.Deserialize(json); + return JsonSerializer.Deserialize(json); } #endregion Data manipulation #region WU functions - private static async Task<(CGetCookieResponse.GetCookieResponse, string)> GetCookie() + private static async Task<(GetCookieResponse, string)> GetCookie() { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetCookie", null, false); + Envelope envelope = GetEnveloppe("GetCookie", null, false); - envelope.Body.GetCookie = new CGetCookieRequest.GetCookie() + envelope.Body.GetCookie = new GetCookie() { - OldCookie = new CGetCookieRequest.OldCookie() + OldCookie = new OldCookie() { Expiration = Constants.OldCookieExpiration }, @@ -218,30 +228,30 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso string response = await PostToWindowsUpdateAsync("GetCookie", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetCookieResponse, response); } - private static async Task<(CGetExtendedUpdateInfoResponse.GetExtendedUpdateInfoResponse, string)> GetExtendedUpdateInfo( - CSOAPCommon.Cookie cookie, + private static async Task<(GetExtendedUpdateInfoResponse, string)> GetExtendedUpdateInfo( + Models.FE3.SOAP.Common.Cookie cookie, string token, string[] revisionId, CTAC ctac) { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo", token, false); + Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo", token, false); - envelope.Body.GetExtendedUpdateInfo = new CGetExtendedUpdateInfoRequest.GetExtendedUpdateInfo() + envelope.Body.GetExtendedUpdateInfo = new GetExtendedUpdateInfo() { Cookie = cookie, - RevisionIDs = new CGetExtendedUpdateInfoRequest.RevisionIDs() + RevisionIDs = new RevisionIDs() { Int = revisionId }, - InfoTypes = new CSOAPCommon.InfoTypes() + InfoTypes = new InfoTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "FileUrl", "FileDecryption", "Extended", @@ -250,11 +260,11 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso "Published", "Core", "VerificationRule" - } + ] }, - Locales = new CSOAPCommon.Locales() + Locales = new Locales() { - String = new string[] { "en-US", "en" } + String = ["en-US", "en"] }, DeviceAttributes = ctac.DeviceAttributes }; @@ -263,40 +273,40 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso string response = await PostToWindowsUpdateAsync("GetCookie", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetExtendedUpdateInfoResponse, response); } - public static async Task<(CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string)> GetExtendedUpdateInfo2( + public static async Task<(GetExtendedUpdateInfo2Response, string)> GetExtendedUpdateInfo2( string token, string UpdateID, string RevisionNumber, CTAC ctac ) { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo2", token, true); + Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo2", token, true); - envelope.Body.GetExtendedUpdateInfo2 = new CGetExtendedUpdateInfo2Request.GetExtendedUpdateInfo2() + envelope.Body.GetExtendedUpdateInfo2 = new GetExtendedUpdateInfo2() { - UpdateIDs = new CGetExtendedUpdateInfo2Request.UpdateIDs() + UpdateIDs = new UpdateIDs() { - UpdateIdentity = new CGetExtendedUpdateInfo2Request.UpdateIdentity() + UpdateIdentity = new Models.FE3.SOAP.GetExtendedUpdateInfo2.Request.UpdateIdentity() { UpdateID = UpdateID, RevisionNumber = RevisionNumber } }, - InfoTypes = new CSOAPCommon.InfoTypes() + InfoTypes = new InfoTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "FileUrl", "FileDecryption", "EsrpDecryptionInformation", "PiecesHashUrl", "BlockMapUrl" - } + ] }, DeviceAttributes = ctac.DeviceAttributes }; @@ -305,13 +315,13 @@ CTAC ctac string response = await PostToWindowsUpdateAsync("GetExtendedUpdateInfo2", message, true); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetExtendedUpdateInfo2Response, response); } - private static async Task<(CSyncUpdatesResponse.SyncUpdatesResponse, string)> SyncUpdates( - CSOAPCommon.Cookie cookie, + private static async Task<(SyncUpdatesResponse, string)> SyncUpdates( + Models.FE3.SOAP.Common.Cookie cookie, string token, IEnumerable InstalledNonLeafUpdateIDs, IEnumerable OtherCachedUpdateIDs, @@ -323,58 +333,58 @@ CTAC ctac if (InstalledNonLeafUpdateIDs != null) { - List tmplist = _InstalledNonLeafUpdateIDs.ToList(); + List tmplist = [.. _InstalledNonLeafUpdateIDs]; tmplist.AddRange(InstalledNonLeafUpdateIDs); - _InstalledNonLeafUpdateIDs = tmplist.ToArray(); + _InstalledNonLeafUpdateIDs = [.. tmplist]; } - CSOAPCommon.Envelope envelope = GetEnveloppe("SyncUpdates", token, false); + Envelope envelope = GetEnveloppe("SyncUpdates", token, false); - envelope.Body.SyncUpdates = new CSyncUpdatesRequest.SyncUpdates() + envelope.Body.SyncUpdates = new SyncUpdates() { Cookie = cookie, - Parameters = new CSyncUpdatesRequest.Parameters() + Parameters = new Parameters() { ExpressQuery = "false", - InstalledNonLeafUpdateIDs = new CSyncUpdatesRequest.InstalledNonLeafUpdateIDs() + InstalledNonLeafUpdateIDs = new InstalledNonLeafUpdateIDs() { Int = _InstalledNonLeafUpdateIDs }, - OtherCachedUpdateIDs = new CSyncUpdatesRequest.OtherCachedUpdateIDs() + OtherCachedUpdateIDs = new OtherCachedUpdateIDs() { Int = OtherCachedUpdateIDs != null ? OtherCachedUpdateIDs.ToArray() : [] }, SkipSoftwareSync = "false", NeedTwoGroupOutOfScopeUpdates = "true", - FilterAppCategoryIds = CategoryIdentifiers != null && CategoryIdentifiers.Length != 0 ? new CSyncUpdatesRequest.FilterAppCategoryIds() + FilterAppCategoryIds = CategoryIdentifiers != null && CategoryIdentifiers.Length != 0 ? new FilterAppCategoryIds() { - CategoryIdentifier = new CSyncUpdatesRequest.CategoryIdentifier() + CategoryIdentifier = new CategoryIdentifier() { Id = CategoryIdentifiers ?? [] } } : null, AlsoPerformRegularSync = "false", ComputerSpec = "", - ExtendedUpdateInfoParameters = new CSyncUpdatesRequest.ExtendedUpdateInfoParameters() + ExtendedUpdateInfoParameters = new ExtendedUpdateInfoParameters() { - XmlUpdateFragmentTypes = new CSyncUpdatesRequest.XmlUpdateFragmentTypes() + XmlUpdateFragmentTypes = new XmlUpdateFragmentTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "Extended", "LocalizedProperties", "Eula", "Published", "Core" - } + ] }, - Locales = new CSOAPCommon.Locales() + Locales = new Locales() { - String = new string[] { "en-US", "en" } + String = ["en-US", "en"] } }, ClientPreferredLanguages = "", - ProductsParameters = new CSyncUpdatesRequest.ProductsParameters() + ProductsParameters = new ProductsParameters() { SyncCurrentVersionOnly = ctac.SyncCurrentVersionOnly ? "true" : "false", DeviceAttributes = ctac.DeviceAttributes, @@ -388,9 +398,9 @@ CTAC ctac string response = await PostToWindowsUpdateAsync("SyncUpdates", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope responseEnvelope = DeserializeSOAPEnvelope(response); - return (renvelope.Body.SyncUpdatesResponse, response); + return (responseEnvelope.Body.SyncUpdatesResponse, response); } #endregion WU functions @@ -399,12 +409,12 @@ CTAC ctac public static async Task> GetUpdates(string[] categoryIds, CTAC ctac, string token, FileExchangeV3UpdateFilter filter = FileExchangeV3UpdateFilter.Application) // Or ProductRelease { - (CGetCookieResponse.GetCookieResponse cookie, string cookieresp) = await GetCookie(); + (GetCookieResponse cookie, string cookieresp) = await GetCookie(); - HashSet InstalledNonLeafUpdateIDs = new(); - HashSet OtherCachedUpdateIDs = new(); + HashSet InstalledNonLeafUpdateIDs = []; + HashSet OtherCachedUpdateIDs = []; - HashSet<(CSyncUpdatesResponse.SyncUpdatesResponse, string)> responses = new(); + HashSet<(SyncUpdatesResponse, string)> responses = []; // // Scan all updates @@ -413,7 +423,7 @@ public static async Task> GetUpdates(string[] categoryId // while (true) { - (CSyncUpdatesResponse.SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? [], ctac); + (SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? [], ctac); // Refresh the cookie cookie.GetCookieResult.EncryptedData = result.Item1.SyncUpdatesResult.NewCookie.EncryptedData; @@ -424,7 +434,7 @@ public static async Task> GetUpdates(string[] categoryId break; } - foreach (CSOAPCommon.Update update in result.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) + foreach (Update update in result.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) { _ = InstalledNonLeafUpdateIDs.Add(update.ID); _ = OtherCachedUpdateIDs.Add(update.ID); @@ -433,18 +443,18 @@ public static async Task> GetUpdates(string[] categoryId _ = responses.Add(result); } - HashSet updateDatas = new(); + HashSet updateDatas = []; - foreach ((CSyncUpdatesResponse.SyncUpdatesResponse, string) response in responses) + foreach ((SyncUpdatesResponse, string) response in responses) { - foreach (CSOAPCommon.Update update in response.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) + foreach (Update update in response.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) { UpdateData data = new() { Update = update }; - foreach (CSyncUpdatesResponse.UpdateInfo updateInfo in response.Item1.SyncUpdatesResult.NewUpdates.UpdateInfo) + foreach (UpdateInfo updateInfo in response.Item1.SyncUpdatesResult.NewUpdates.UpdateInfo) { if (ulong.Parse(update.ID) == ulong.Parse(updateInfo.ID)) { @@ -453,7 +463,7 @@ public static async Task> GetUpdates(string[] categoryId } } - CExtendedUpdateInfoXml.Xml updateXml = DeserializeInfoXML(data.Update.Xml + data.UpdateInfo.Xml); + Xml updateXml = DeserializeInfoXML(data.Update.Xml + data.UpdateInfo.Xml); data.Xml = updateXml; if (data.Xml.ApplicabilityRules?.Metadata?.AppxPackageMetadata?.AppxMetadata != null) @@ -466,7 +476,7 @@ public static async Task> GetUpdates(string[] categoryId UpdateData updateData = updateDatas.First(x => x.Update.ID == update.ID); if (data.Xml.LocalizedProperties == null) { - CExtendedUpdateInfoXml.Xml backup = updateData.Xml; + Xml backup = updateData.Xml; updateData.Xml = data.Xml; updateData.Xml.LocalizedProperties = backup.LocalizedProperties; @@ -486,7 +496,7 @@ public static async Task> GetUpdates(string[] categoryId } } - HashSet relevantUpdateDatas = new(); + HashSet relevantUpdateDatas = []; foreach (UpdateData updateData in updateDatas) { @@ -509,16 +519,16 @@ public static async Task> GetUpdates(string[] categoryId public static async Task GetFileUrl(UpdateData updateData, string fileDigest, string token = null) { - (CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); + (GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); - if (updateData.Xml?.Files?.File?.FirstOrDefault(x => x.AdditionalDigest?.Text == fileDigest) is CExtendedUpdateInfoXml.File file) + if (updateData.Xml?.Files?.File?.FirstOrDefault(x => x.AdditionalDigest?.Text == fileDigest) is Models.FE3.XML.ExtendedUpdateInfo.File file) { fileDigest = file.Digest; } if (result.Item1.GetExtendedUpdateInfo2Result.FileLocations != null) { - foreach (CGetExtendedUpdateInfo2Response.FileLocation fileLocation in result.Item1.GetExtendedUpdateInfo2Result.FileLocations.FileLocation) + foreach (FileLocation fileLocation in result.Item1.GetExtendedUpdateInfo2Result.FileLocations.FileLocation) { if (fileLocation.FileDigest == fileDigest) { @@ -532,7 +542,7 @@ public static async Task GetFileUrl(Updat public static async Task> GetFileUrls(UpdateData updateData, string token = null) { - (CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); + (GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); updateData.GEI2Response = result.Item2; @@ -541,136 +551,4 @@ public static async Task> Get #endregion File url specific functions } - - public enum FileExchangeV3UpdateFilter - { - ProductRelease, - Application, - OSFlight - } - - public class FileExchangeV3FileDownloadInformation - { - public string DownloadUrl - { - get; - } - - public bool IsEncrypted => EsrpDecryptionInformation != null; - - public DateTime ExpirationDate - { - get - { - DateTime dateTime = DateTime.MaxValue; - try - { - long value = long.Parse(DownloadUrl.Split("P1=")[1].Split("&")[0]); - dateTime = DateTimeOffset.FromUnixTimeSeconds(value).ToLocalTime().DateTime; - } - catch { } - return dateTime; - } - } - - public bool IsDownloadable => ExpirationDate > DateTime.Now; - - public TimeSpan TimeLeft => IsDownloadable ? DateTime.Now - ExpirationDate : new TimeSpan(0); - - public EsrpDecryptionInformation EsrpDecryptionInformation { get; set; } = null; - - public string Digest - { - get; - } - - internal FileExchangeV3FileDownloadInformation(CGetExtendedUpdateInfo2Response.FileLocation fileLocation) - { - DownloadUrl = fileLocation.Url; - if (!string.IsNullOrEmpty(fileLocation.EsrpDecryptionInformation)) - { - EsrpDecryptionInformation = EsrpDecryptionInformation.DeserializeFromJson(fileLocation.EsrpDecryptionInformation); - } - Digest = fileLocation.FileDigest; - } - - public override bool Equals(object obj) - { - return obj is FileExchangeV3FileDownloadInformation info && info.Digest == Digest; - } - - public override int GetHashCode() - { - return Digest.GetHashCode(); - } - - public async Task DecryptAsync(string InputFile, string OutputFile) - { - if (!IsEncrypted) - { - return false; - } - - try - { - using EsrpDecryptor esrp = new(EsrpDecryptionInformation); - await esrp.DecryptFileAsync(InputFile, OutputFile); - return true; - } - catch { } - - return false; - } - } - - public class UpdateData - { - [JsonPropertyName("UpdateInfo")] - public CSyncUpdatesResponse.UpdateInfo UpdateInfo - { - get; set; - } - - [JsonPropertyName("Update")] - public CSOAPCommon.Update Update - { - get; set; - } - - [JsonPropertyName("Xml")] - public CExtendedUpdateInfoXml.Xml Xml - { - get; set; - } - - [JsonPropertyName("AppxMetadata")] - public CAppxMetadataJSON.AppxMetadataJson AppxMetadata - { - get; set; - } - - [JsonPropertyName("CTAC")] - public CTAC CTAC - { - get; set; - } - - [JsonPropertyName("SyncUpdatesResponse")] - public string SyncUpdatesResponse - { - get; set; - } - - [JsonPropertyName("GEI2Response")] - public string GEI2Response - { - get; set; - } - - [JsonPropertyName("CompDBs")] - public HashSet CompDBs - { - get; set; - } - } } \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs deleted file mode 100644 index 9afb681f..00000000 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs +++ /dev/null @@ -1,2375 +0,0 @@ -/* - * Copyright (c) Gustave Monce and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Json; -using System.Text; -using System.Text.Json.Serialization; -using System.Xml; -using System.Xml.Serialization; - -namespace UnifiedUpdatePlatform.Services.WindowsUpdate -{ - #region XML Objects - public static class CSOAPCommon - { - [XmlRoot(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] - public class Action - { - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Update - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Xml - { - get; set; - } - } - - [XmlRoot(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Updates - { - [XmlElement(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] - public Update[] Update - { - get; set; - } - } - - [XmlRoot(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public class InfoTypes - { - [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] XmlUpdateFragmentType - { - get; set; - } - } - - [XmlRoot(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OutOfScopeRevisionIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Locales - { - [XmlElement(ElementName = "string", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] String - { - get; set; - } - } - - public class Cookie - { - [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Expiration - { - get; set; - } - - [XmlElement(ElementName = "EncryptedData", Namespace = Constants.ClientWebServiceServerNamespace)] - public string EncryptedData - { - get; set; - } - } - - [XmlRoot(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] - public class To - { - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public class Timestamp - { - [XmlElement(ElementName = "Created", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Created - { - get; set; - } - - [XmlElement(ElementName = "Expires", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Expires - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - - [XmlAttribute(AttributeName = "Id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Id - { - get; set; - } - } - - [XmlRoot(ElementName = "TicketType")] - public class TicketType - { - [XmlElement(ElementName = "User")] - public string User - { - get; set; - } - - [XmlAttribute(AttributeName = "Name")] - public string Name - { - get; set; - } - - [XmlAttribute(AttributeName = "Version")] - public string Version - { - get; set; - } - - [XmlAttribute(AttributeName = "Policy")] - public string Policy - { - get; set; - } - } - - [XmlRoot(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] - public class WindowsUpdateTicketsToken - { - [XmlNamespaceDeclarations] - public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { - new("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"), - new("wuws", Constants.WindowsUpdateAuthorizationSchema) - } - ); - - [XmlElement(ElementName = "TicketType", Namespace = "")] - public TicketType[] TicketType - { - get; set; - } - - [XmlAttribute(AttributeName = "id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Id - { - get; set; - } - - [XmlAttribute(AttributeName = "wsu", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Wsu - { - get; set; - } - - [XmlAttribute(AttributeName = "wuws", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Wuws - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] - public class Security - { - [XmlNamespaceDeclarations] - public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { - new("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") - } - ); - - [XmlElement(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public Timestamp Timestamp - { - get; set; - } - - [XmlElement(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] - public WindowsUpdateTicketsToken WindowsUpdateTicketsToken - { - get; set; - } - - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlAttribute(AttributeName = "o", Namespace = "http://www.w3.org/2000/xmlns/")] - public string O - { - get; set; - } - } - - [XmlRoot(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Header - { - [XmlElement(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] - public Action Action - { - get; set; - } - - [XmlElement(ElementName = "MessageID", Namespace = "http://www.w3.org/2005/08/addressing")] - public string MessageID - { - get; set; - } - - [XmlElement(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] - public To To - { - get; set; - } - - [XmlElement(ElementName = "RelatesTo", Namespace = "http://www.w3.org/2005/08/addressing")] - public string RelatesTo - { - get; set; - } - - [XmlElement(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] - public Security Security - { - get; set; - } - } - - [XmlRoot(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Body - { - [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsi - { - get; set; - } - - [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsd - { - get; set; - } - - // - // Requests - // - - [XmlElement(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetCookieRequest.GetCookie GetCookie - { - get; set; - } - - [XmlElement(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSyncUpdatesRequest.SyncUpdates SyncUpdates - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfoRequest.GetExtendedUpdateInfo GetExtendedUpdateInfo - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfo2Request.GetExtendedUpdateInfo2 GetExtendedUpdateInfo2 - { - get; set; - } - - // - // Responses - // - - [XmlElement(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetCookieResponse.GetCookieResponse GetCookieResponse - { - get; set; - } - - [XmlElement(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSyncUpdatesResponse.SyncUpdatesResponse SyncUpdatesResponse - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfoResponse.GetExtendedUpdateInfoResponse GetExtendedUpdateInfoResponse - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response GetExtendedUpdateInfo2Response - { - get; set; - } - } - - [XmlRoot(ElementName = "Envelope", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Envelope - { - [XmlElement(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public Header Header - { - get; set; - } - - [XmlElement(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public Body Body - { - get; set; - } - - [XmlAttribute(AttributeName = "a", Namespace = "http://www.w3.org/2000/xmlns/")] - public string A - { - get; set; - } - - [XmlAttribute(AttributeName = "s", Namespace = "http://www.w3.org/2000/xmlns/")] - public string S - { - get; set; - } - - [XmlAttribute(AttributeName = "u", Namespace = "http://www.w3.org/2000/xmlns/")] - public string U - { - get; set; - } - } - } - - public static class CGetCookieRequest - { - [XmlRoot(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OldCookie - { - [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Expiration - { - get; set; - } - } - - [XmlRoot(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetCookie - { - [XmlElement(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public OldCookie OldCookie - { - get; set; - } - - [XmlElement(ElementName = "lastChange", Namespace = Constants.ClientWebServiceServerNamespace)] - public string LastChange - { - get; set; - } - - [XmlElement(ElementName = "currentTime", Namespace = Constants.ClientWebServiceServerNamespace)] - public string CurrentTime - { - get; set; - } - - [XmlElement(ElementName = "protocolVersion", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ProtocolVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetCookieResponse - { - [XmlRoot(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetCookieResponse - { - [XmlElement(ElementName = "GetCookieResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie GetCookieResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CSyncUpdatesRequest - { - [XmlRoot(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class InstalledNonLeafUpdateIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OtherCachedUpdateIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] - public class CategoryIdentifier - { - [XmlElement(ElementName = "Id", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Id - { - get; set; - } - } - - [XmlRoot(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FilterAppCategoryIds - { - [XmlElement(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] - public CategoryIdentifier CategoryIdentifier - { - get; set; - } - } - - [XmlRoot(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public class XmlUpdateFragmentTypes - { - [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] XmlUpdateFragmentType - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ExtendedUpdateInfoParameters - { - [XmlElement(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public XmlUpdateFragmentTypes XmlUpdateFragmentTypes - { - get; set; - } - - [XmlElement(ElementName = "Locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Locales Locales - { - get; set; - } - } - - [XmlRoot(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ProductsParameters - { - [XmlElement(ElementName = "SyncCurrentVersionOnly", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SyncCurrentVersionOnly - { - get; set; - } - - [XmlElement(ElementName = "DeviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlElement(ElementName = "CallerAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string CallerAttributes - { - get; set; - } - - [XmlElement(ElementName = "Products", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Products - { - get; set; - } - } - - [XmlRoot(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Parameters - { - [XmlElement(ElementName = "ExpressQuery", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ExpressQuery - { - get; set; - } - - [XmlElement(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public InstalledNonLeafUpdateIDs InstalledNonLeafUpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public OtherCachedUpdateIDs OtherCachedUpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "SkipSoftwareSync", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SkipSoftwareSync - { - get; set; - } - - [XmlElement(ElementName = "NeedTwoGroupOutOfScopeUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public string NeedTwoGroupOutOfScopeUpdates - { - get; set; - } - - [XmlElement(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] - public FilterAppCategoryIds FilterAppCategoryIds - { - get; set; - } - - [XmlElement(ElementName = "AlsoPerformRegularSync", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AlsoPerformRegularSync - { - get; set; - } - - [XmlElement(ElementName = "ComputerSpec", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ComputerSpec - { - get; set; - } - - [XmlElement(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public ExtendedUpdateInfoParameters ExtendedUpdateInfoParameters - { - get; set; - } - - [XmlElement(ElementName = "ClientPreferredLanguages", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ClientPreferredLanguages - { - get; set; - } - - [XmlElement(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public ProductsParameters ProductsParameters - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdates - { - [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie Cookie - { - get; set; - } - - [XmlElement(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public Parameters Parameters - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CSyncUpdatesResponse - { - [XmlRoot(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Deployment - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Action", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Action2 - { - get; set; - } - - [XmlElement(ElementName = "IsAssigned", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsAssigned - { - get; set; - } - - [XmlElement(ElementName = "LastChangeTime", Namespace = Constants.ClientWebServiceServerNamespace)] - public string LastChangeTime - { - get; set; - } - - [XmlElement(ElementName = "AutoSelect", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AutoSelect - { - get; set; - } - - [XmlElement(ElementName = "AutoDownload", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AutoDownload - { - get; set; - } - - [XmlElement(ElementName = "SupersedenceBehavior", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SupersedenceBehavior - { - get; set; - } - - [XmlElement(ElementName = "Priority", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Priority - { - get; set; - } - - [XmlElement(ElementName = "HandlerSpecificAction", Namespace = Constants.ClientWebServiceServerNamespace)] - public string HandlerSpecificAction - { - get; set; - } - - [XmlElement(ElementName = "FlightId", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FlightId - { - get; set; - } - - [XmlElement(ElementName = "FlightMetadata", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FlightMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateInfo - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] - public Deployment Deployment - { - get; set; - } - - [XmlElement(ElementName = "IsLeaf", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsLeaf - { - get; set; - } - - [XmlElement(ElementName = "IsShared", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsShared - { - get; set; - } - - [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Xml - { - get; set; - } - } - - [XmlRoot(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class NewUpdates - { - [XmlElement(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateInfo[] UpdateInfo - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ExtendedUpdateInfo - { - [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Updates Updates - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdatesResult - { - [XmlElement(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public NewUpdates NewUpdates - { - get; set; - } - - [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.OutOfScopeRevisionIDs OutOfScopeRevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "Truncated", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Truncated - { - get; set; - } - - [XmlElement(ElementName = "NewCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie NewCookie - { - get; set; - } - - [XmlElement(ElementName = "DriverSyncNotNeeded", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DriverSyncNotNeeded - { - get; set; - } - - [XmlElement(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public ExtendedUpdateInfo ExtendedUpdateInfo - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdatesResponse - { - [XmlElement(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public SyncUpdatesResult SyncUpdatesResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfo2Request - { - [XmlRoot(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateIdentity - { - [XmlElement(ElementName = "UpdateID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string UpdateID - { - get; set; - } - - [XmlElement(ElementName = "RevisionNumber", Namespace = Constants.ClientWebServiceServerNamespace)] - public string RevisionNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateIDs - { - [XmlElement(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateIdentity UpdateIdentity - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2 - { - [XmlElement(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateIDs UpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.InfoTypes InfoTypes - { - get; set; - } - - [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfo2Response - { - [XmlRoot(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileLocation - { - [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FileDigest - { - get; set; - } - - [XmlElement(ElementName = "Url", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Url - { - get; set; - } - - [XmlElement(ElementName = "PiecesHashUrl", Namespace = Constants.ClientWebServiceServerNamespace)] - public string PiecesHashUrl - { - get; set; - } - - [XmlElement(ElementName = "BlockMapUrl", Namespace = Constants.ClientWebServiceServerNamespace)] - public string BlockMapUrl - { - get; set; - } - - [XmlElement(ElementName = "EsrpDecryptionInformation", Namespace = Constants.ClientWebServiceServerNamespace)] - public string EsrpDecryptionInformation - { - get; set; - } - } - - [XmlRoot(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileLocations - { - [XmlElement(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileLocation[] FileLocation - { - get; set; - } - } - - [XmlRoot(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileDecryptionData - { - [XmlElement(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileDecryption FileDecryption - { - get; set; - } - } - - [XmlRoot(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileDecryption - { - [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FileDigest - { - get; set; - } - - [XmlElement(ElementName = "DecryptionKey", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DecryptionKey - { - get; set; - } - - [XmlElement(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] - public SecurityData SecurityData - { - get; set; - } - } - - [XmlRoot(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SecurityData - { - [XmlElement(ElementName = "base64Binary", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Base64Binary - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2Result - { - [XmlElement(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileLocations FileLocations - { - get; set; - } - - [XmlElement(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileDecryptionData FileDecryptionData - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2Response - { - [XmlElement(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] - public GetExtendedUpdateInfo2Result GetExtendedUpdateInfo2Result - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfoRequest - { - [XmlRoot(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class RevisionIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo - { - [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie Cookie - { - get; set; - } - - [XmlElement(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public RevisionIDs RevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.InfoTypes InfoTypes - { - get; set; - } - - [XmlElement(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Locales Locales - { - get; set; - } - - [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfoResponse - { - [XmlRoot(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfoResult - { - [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.OutOfScopeRevisionIDs OutOfScopeRevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Updates Updates - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfoResponse - { - [XmlElement(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public GetExtendedUpdateInfoResult GetExtendedUpdateInfoResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - - [XmlRoot(ElementName = "Verification", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Verification - { - [XmlAttribute(AttributeName = "Timestamp")] - public string Timestamp - { - get; set; - } - - [XmlAttribute(AttributeName = "LeafCertificateId")] - public string LeafCertificateId - { - get; set; - } - - [XmlAttribute(AttributeName = "Signature")] - public string Signature - { - get; set; - } - - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - } - } - - public static class CExtendedUpdateInfoXml - { - [XmlRoot(ElementName = "LocalizedProperties")] - public class LocalizedProperties - { - [XmlElement(ElementName = "Language")] - public string Language - { - get; set; - } - - [XmlElement(ElementName = "Title")] - public string Title - { - get; set; - } - - [XmlElement(ElementName = "Description")] - public string Description - { - get; set; - } - } - - [XmlRoot(ElementName = "UpdateIdentity")] - public class UpdateIdentity - { - [XmlAttribute(AttributeName = "UpdateID")] - public string UpdateID - { - get; set; - } - - [XmlAttribute(AttributeName = "RevisionNumber")] - public string RevisionNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "Properties")] - public class Properties - { - [XmlAttribute(AttributeName = "UpdateType")] - public string UpdateType - { - get; set; - } - - [XmlAttribute(AttributeName = "PerUser")] - public string PerUser - { - get; set; - } - - [XmlElement(ElementName = "SecuredFragment")] - public string SecuredFragment - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageRank")] - public string PackageRank - { - get; set; - } - - [XmlAttribute(AttributeName = "ExplicitlyDeployable")] - public string ExplicitlyDeployable - { - get; set; - } - - [XmlAttribute(AttributeName = "ApplyPackageRank")] - public string ApplyPackageRank - { - get; set; - } - } - - [XmlRoot(ElementName = "b.WindowsVersion")] - public class BWindowsVersion - { - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "MajorVersion")] - public string MajorVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "MinorVersion")] - public string MinorVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "BuildNumber")] - public string BuildNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "IsInstalled")] - public class IsInstalled - { - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "True")] - public string True - { - get; set; - } - - [XmlElement(ElementName = "Or")] - public Or Or - { - get; set; - } - - [XmlElement(ElementName = "And")] - public And And - { - get; set; - } - - [XmlElement(ElementName = "b.WmiQuery")] - public BWmiQuery BWmiQuery - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - - [XmlElement(ElementName = "b.SystemMetric")] - public BSystemMetric BSystemMetric - { - get; set; - } - - [XmlElement(ElementName = "b.Memory")] - public BMemory BMemory - { - get; set; - } - - [XmlElement(ElementName = "b.Direct3D")] - public BDirect3D BDirect3D - { - get; set; - } - - [XmlElement(ElementName = "b.SensorById")] - public BSensorById BSensorById - { - get; set; - } - - [XmlElement(ElementName = "b.Camera")] - public BCamera BCamera - { - get; set; - } - - [XmlElement(ElementName = "b.NFC")] - public BNFC BNFC - { - get; set; - } - - [XmlElement(ElementName = "b.VideoMemory")] - public BVideoMemory BVideoMemory - { - get; set; - } - - [XmlElement(ElementName = "AppxPackageInstalled")] - public string AppxPackageInstalled - { - get; set; - } - } - - [XmlRoot(ElementName = "ApplicabilityRules")] - public class ApplicabilityRules - { - [XmlElement(ElementName = "IsInstalled")] - public IsInstalled IsInstalled - { - get; set; - } - - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "Metadata")] - public Metadata Metadata - { - get; set; - } - - [XmlElement(ElementName = "IsInstallable")] - public IsInstallable IsInstallable - { - get; set; - } - } - - [XmlRoot(ElementName = "Xml")] - public class Xml - { - [XmlElement(ElementName = "LocalizedProperties")] - public LocalizedProperties LocalizedProperties - { - get; set; - } - - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity UpdateIdentity - { - get; set; - } - - [XmlElement(ElementName = "Properties")] - public Properties Properties - { - get; set; - } - - [XmlElement(ElementName = "ApplicabilityRules")] - public ApplicabilityRules ApplicabilityRules - { - get; set; - } - - [XmlElement(ElementName = "ExtendedProperties")] - public ExtendedProperties ExtendedProperties - { - get; set; - } - - [XmlElement(ElementName = "HandlerSpecificData")] - public HandlerSpecificData HandlerSpecificData - { - get; set; - } - - [XmlElement(ElementName = "Relationships")] - public Relationships Relationships - { - get; set; - } - - [XmlElement(ElementName = "Files")] - public Files Files - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedProperties")] - public class ExtendedProperties - { - [XmlAttribute(AttributeName = "DefaultPropertiesLanguage")] - public string DefaultPropertiesLanguage - { - get; set; - } - - [XmlAttribute(AttributeName = "Handler")] - public string Handler - { - get; set; - } - - [XmlAttribute(AttributeName = "CreationDate")] - public string CreationDate - { - get; set; - } - - [XmlAttribute(AttributeName = "IsAppxFramework")] - public string IsAppxFramework - { - get; set; - } - - [XmlAttribute(AttributeName = "CompatibleProtocolVersion")] - public string CompatibleProtocolVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "FromStoreService")] - public string FromStoreService - { - get; set; - } - - [XmlAttribute(AttributeName = "ContentType")] - public string ContentType - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageIdentityName")] - public string PackageIdentityName - { - get; set; - } - - [XmlAttribute(AttributeName = "LegacyMobileProductId")] - public string LegacyMobileProductId - { - get; set; - } - - [XmlElement(ElementName = "InstallationBehavior")] - public string InstallationBehavior - { - get; set; - } - - [XmlAttribute(AttributeName = "MaxDownloadSize")] - public string MaxDownloadSize - { - get; set; - } - - [XmlAttribute(AttributeName = "MinDownloadSize")] - public string MinDownloadSize - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageContentId")] - public string PackageContentId - { - get; set; - } - - [XmlAttribute(AttributeName = "ProductName")] - public string ProductName - { - get; set; - } - - [XmlAttribute(AttributeName = "ReleaseVersion")] - public string ReleaseVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "AutoSelectOnWebsites")] - public string AutoSelectOnWebsites - { - get; set; - } - - [XmlAttribute(AttributeName = "BrowseOnly")] - public string BrowseOnly - { - get; set; - } - } - - [XmlRoot(ElementName = "CategoryInformation")] - public class CategoryInformation - { - [XmlAttribute(AttributeName = "CategoryType")] - public string CategoryType - { - get; set; - } - - [XmlAttribute(AttributeName = "ProhibitsSubcategories")] - public string ProhibitsSubcategories - { - get; set; - } - - [XmlAttribute(AttributeName = "ProhibitsUpdates")] - public string ProhibitsUpdates - { - get; set; - } - - [XmlAttribute(AttributeName = "DisplayOrder")] - public string DisplayOrder - { - get; set; - } - - [XmlAttribute(AttributeName = "ExcludedByDefault")] - public string ExcludedByDefault - { - get; set; - } - } - - [XmlRoot(ElementName = "HandlerSpecificData")] - public class HandlerSpecificData - { - [XmlElement(ElementName = "CategoryInformation")] - public CategoryInformation CategoryInformation - { - get; set; - } - - [XmlAttribute(AttributeName = "type")] - public string Type - { - get; set; - } - - [XmlElement(ElementName = "AppxPackageInstallData")] - public AppxPackageInstallData AppxPackageInstallData - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegValueExists")] - public class BRegValueExists - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Type")] - public string Type - { - get; set; - } - - [XmlAttribute(AttributeName = "RegType32")] - public string RegType32 - { - get; set; - } - } - - [XmlRoot(ElementName = "Not")] - public class Not - { - [XmlElement(ElementName = "b.RegValueExists")] - public BRegValueExists BRegValueExists - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword BRegDword - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegDword")] - public class BRegDword - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Data")] - public string Data - { - get; set; - } - } - - [XmlRoot(ElementName = "Or")] - public class Or - { - [XmlElement(ElementName = "Not")] - public Not Not - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword BRegDword - { - get; set; - } - - [XmlElement(ElementName = "And")] - public And[] And - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - /*[XmlElement(ElementName = "Or")] - public Or Or { get; set; }*/ // TODO: fix - } - - [XmlRoot(ElementName = "And")] - public class And - { - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion[] BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "Not")] - public Not[] Not - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword[] BRegDword - { - get; set; - } - - [XmlElement(ElementName = "Or")] - public Or[] Or - { - get; set; - } - - [XmlElement(ElementName = "b.SystemMetric")] - public BSystemMetric[] BSystemMetric - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - } - - [XmlRoot(ElementName = "b.WmiQuery")] - public class BWmiQuery - { - [XmlAttribute(AttributeName = "Namespace")] - public string Namespace - { - get; set; - } - - [XmlAttribute(AttributeName = "WqlQuery")] - public string WqlQuery - { - get; set; - } - } - - [XmlRoot(ElementName = "b.SystemMetric")] - public class BSystemMetric - { - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Index")] - public string Index - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegSz")] - public class BRegSz - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Data")] - public string Data - { - get; set; - } - - [XmlAttribute(AttributeName = "RegType32")] - public string RegType32 - { - get; set; - } - } - - [XmlRoot(ElementName = "Prerequisites")] - public class Prerequisites - { - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity[] UpdateIdentity - { - get; set; - } - - [XmlElement(ElementName = "AtLeastOne")] - public AtLeastOne[] AtLeastOne - { - get; set; - } - } - - [XmlRoot(ElementName = "Relationships")] - public class Relationships - { - [XmlElement(ElementName = "Prerequisites")] - public Prerequisites Prerequisites - { - get; set; - } - - [XmlElement(ElementName = "BundledUpdates")] - public BundledUpdates BundledUpdates - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Memory")] - public class BMemory - { - [XmlAttribute(AttributeName = "MinSizeInMB")] - public string MinSizeInMB - { - get; set; - } - - [XmlAttribute(AttributeName = "Type")] - public string Type - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Direct3D")] - public class BDirect3D - { - [XmlAttribute(AttributeName = "HardwareVersion")] - public string HardwareVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "FeatureLevelMajor")] - public string FeatureLevelMajor - { - get; set; - } - - [XmlAttribute(AttributeName = "FeatureLevelMinor")] - public string FeatureLevelMinor - { - get; set; - } - } - - [XmlRoot(ElementName = "b.SensorById")] - public class BSensorById - { - [XmlAttribute(AttributeName = "Id")] - public string Id - { - get; set; - } - } - - [XmlRoot(ElementName = "AtLeastOne")] - public class AtLeastOne - { - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity[] UpdateIdentity - { - get; set; - } - - [XmlAttribute(AttributeName = "IsCategory")] - public string IsCategory - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Camera")] - public class BCamera - { - [XmlAttribute(AttributeName = "Location")] - public string Location - { - get; set; - } - } - - [XmlRoot(ElementName = "b.NFC")] - public class BNFC - { - [XmlAttribute(AttributeName = "Capability")] - public string Capability - { - get; set; - } - } - - [XmlRoot(ElementName = "b.VideoMemory")] - public class BVideoMemory - { - [XmlAttribute(AttributeName = "MinSizeInMB")] - public string MinSizeInMB - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxFamilyMetadata")] - public class AppxFamilyMetadata - { - [XmlAttribute(AttributeName = "Name")] - public string Name - { - get; set; - } - - [XmlAttribute(AttributeName = "Publisher")] - public string Publisher - { - get; set; - } - - [XmlAttribute(AttributeName = "LegacyMobileProductId")] - public string LegacyMobileProductId - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxPackageMetadata")] - public class AppxPackageMetadata - { - [XmlElement(ElementName = "AppxFamilyMetadata")] - public AppxFamilyMetadata AppxFamilyMetadata - { - get; set; - } - - [XmlElement(ElementName = "AppxMetadata")] - public AppxMetadata AppxMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "Metadata")] - public class Metadata - { - [XmlElement(ElementName = "AppxPackageMetadata")] - public AppxPackageMetadata AppxPackageMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "IsInstallable")] - public class IsInstallable - { - [XmlElement(ElementName = "AppxPackageInstallable")] - public string AppxPackageInstallable - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxMetadata")] - public class AppxMetadata - { - [XmlElement(ElementName = "ApplicabilityBlob")] - public string ApplicabilityBlob - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageType")] - public string PackageType - { - get; set; - } - - [XmlAttribute(AttributeName = "IsAppxBundle")] - public string IsAppxBundle - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageMoniker")] - public string PackageMoniker - { - get; set; - } - } - - [XmlRoot(ElementName = "BundledUpdates")] - public class BundledUpdates - { - [XmlElement(ElementName = "AtLeastOne")] - public AtLeastOne AtLeastOne - { - get; set; - } - } - - [XmlRoot(ElementName = "AdditionalDigest")] - public class AdditionalDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "PiecesHashDigest")] - public class PiecesHashDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "BlockMapDigest")] - public class BlockMapDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "File")] - public class File - { - [XmlElement(ElementName = "AdditionalDigest")] - public AdditionalDigest AdditionalDigest - { - get; set; - } - - [XmlElement(ElementName = "PiecesHashDigest")] - public PiecesHashDigest PiecesHashDigest - { - get; set; - } - - [XmlElement(ElementName = "BlockMapDigest")] - public BlockMapDigest BlockMapDigest - { - get; set; - } - - [XmlAttribute(AttributeName = "FileName")] - public string FileName - { - get; set; - } - - [XmlAttribute(AttributeName = "Digest")] - public string Digest - { - get; set; - } - - [XmlAttribute(AttributeName = "DigestAlgorithm")] - public string DigestAlgorithm - { - get; set; - } - - [XmlAttribute(AttributeName = "Size")] - public string Size - { - get; set; - } - - [XmlAttribute(AttributeName = "Modified")] - public string Modified - { - get; set; - } - - [XmlAttribute(AttributeName = "InstallerSpecificIdentifier")] - public string InstallerSpecificIdentifier - { - get; set; - } - - [XmlAttribute(AttributeName = "PatchingType")] - public string PatchingType - { - get; set; - } - - public override string ToString() - { - return !string.IsNullOrEmpty(FileName) ? (PatchingType + ":" + FileName) : base.ToString(); - } - } - - [XmlRoot(ElementName = "Files")] - public class Files - { - [XmlElement(ElementName = "File")] - public File[] File - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxPackageInstallData")] - public class AppxPackageInstallData - { - [XmlAttribute(AttributeName = "PackageFileName")] - public string PackageFileName - { - get; set; - } - - [XmlAttribute(AttributeName = "MainPackage")] - public string MainPackage - { - get; set; - } - - public override string ToString() - { - return PackageFileName ?? base.ToString(); - } - } - } - #endregion XML Objects - - #region JSON Objects - public class EsrpDecryptionInformation - { - [DataMember(Name = "KeyData")] - public string KeyData - { - get; set; - } - - [DataMember(Name = "EncryptionBufferSize")] - public long EncryptionBufferSize - { - get; set; - } - - [DataMember(Name = "AlgorithmName")] - public string AlgorithmName - { - get; set; - } - - [DataMember(Name = "ChainingMode")] - public string ChainingMode - { - get; set; - } - - public static EsrpDecryptionInformation DeserializeFromJson(string json) - { - using MemoryStream memoryStream = new(Encoding.UTF8.GetBytes(json)); - DataContractJsonSerializer serializer = new(typeof(EsrpDecryptionInformation)); - return serializer.ReadObject(memoryStream) as EsrpDecryptionInformation; - } - } - - public static class CAppxMetadataJSON - { - public partial class AppxMetadataJson - { - [JsonPropertyName("blob.version")] - public long BlobVersion - { - get; set; - } - - [JsonPropertyName("content.isMain")] - public bool ContentIsMain - { - get; set; - } - - [JsonPropertyName("content.packageId")] - public string ContentPackageId - { - get; set; - } - - [JsonPropertyName("content.productId")] - public Guid ContentProductId - { - get; set; - } - - [JsonPropertyName("content.targetPlatforms")] - public ContentTargetPlatform[] ContentTargetPlatforms - { - get; set; - } - - [JsonPropertyName("content.type")] - public long ContentType - { - get; set; - } - - [JsonPropertyName("policy")] - public Policy Policy - { - get; set; - } - - [JsonPropertyName("policy2")] - public Policy2 Policy2 - { - get; set; - } - } - - public partial class ContentTargetPlatform - { - [JsonPropertyName("platform.maxVersionTested")] - public long PlatformMaxVersionTested - { - get; set; - } - - [JsonPropertyName("platform.minVersion")] - public long PlatformMinVersion - { - get; set; - } - - [JsonPropertyName("platform.target")] - public long PlatformTarget - { - get; set; - } - } - - public partial class Policy - { - [JsonPropertyName("category.first")] - public string CategoryFirst - { - get; set; - } - - [JsonPropertyName("category.second")] - public string CategorySecond - { - get; set; - } - - [JsonPropertyName("category.third")] - public string CategoryThird - { - get; set; - } - - [JsonPropertyName("optOut.backupRestore")] - public bool OptOutBackupRestore - { - get; set; - } - - [JsonPropertyName("optOut.removeableMedia")] - public bool OptOutRemoveableMedia - { - get; set; - } - } - - public partial class Policy2 - { - [JsonPropertyName("ageRating")] - public long AgeRating - { - get; set; - } - - [JsonPropertyName("optOut.DVR")] - public bool OptOutDvr - { - get; set; - } - - [JsonPropertyName("thirdPartyAppRatings")] - public ThirdPartyAppRating[] ThirdPartyAppRatings - { - get; set; - } - } - - public partial class ThirdPartyAppRating - { - [JsonPropertyName("level")] - public long Level - { - get; set; - } - - [JsonPropertyName("systemId")] - public long SystemId - { - get; set; - } - } - } - #endregion JSON Objects -} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs new file mode 100644 index 00000000..66e33ae5 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs @@ -0,0 +1,103 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public class FileExchangeV3FileDownloadInformation + { + public string DownloadUrl + { + get; + } + + public bool IsEncrypted => EsrpDecryptionInformation != null; + + public DateTime ExpirationDate + { + get + { + DateTime dateTime = DateTime.MaxValue; + try + { + long value = long.Parse(DownloadUrl.Split("P1=")[1].Split("&")[0]); + dateTime = DateTimeOffset.FromUnixTimeSeconds(value).ToLocalTime().DateTime; + } + catch { } + return dateTime; + } + } + + public bool IsDownloadable => ExpirationDate > DateTime.Now; + + public TimeSpan TimeLeft => IsDownloadable ? DateTime.Now - ExpirationDate : new TimeSpan(0); + + public EsrpDecryptionInformation EsrpDecryptionInformation { get; set; } = null; + + public string Digest + { + get; + } + + internal FileExchangeV3FileDownloadInformation(FileLocation fileLocation) + { + DownloadUrl = fileLocation.Url; + if (!string.IsNullOrEmpty(fileLocation.EsrpDecryptionInformation)) + { + EsrpDecryptionInformation = EsrpDecryptionInformation.DeserializeFromJson(fileLocation.EsrpDecryptionInformation); + } + Digest = fileLocation.FileDigest; + } + + public override bool Equals(object obj) + { + return obj is FileExchangeV3FileDownloadInformation info && info.Digest == Digest; + } + + public override int GetHashCode() + { + return Digest.GetHashCode(); + } + + public async Task DecryptAsync(string InputFile, string OutputFile) + { + if (!IsEncrypted) + { + return false; + } + + try + { + using ESRPCryptography esrp = new(EsrpDecryptionInformation); + await esrp.DecryptFileAsync(InputFile, OutputFile); + return true; + } + catch { } + + return false; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs new file mode 100644 index 00000000..2e936735 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs @@ -0,0 +1,30 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public enum FileExchangeV3UpdateFilter + { + ProductRelease, + Application, + OSFlight + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs new file mode 100644 index 00000000..ea466ed5 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs @@ -0,0 +1,64 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static class StringExtensions + { + public static bool Contains(this string str, string substring, + StringComparison comp) + { + if (substring == null) + { + throw new ArgumentNullException(nameof(substring), + "substring cannot be null."); + } + else if (!Enum.IsDefined(typeof(StringComparison), comp)) + { + throw new ArgumentException("comp is not a member of StringComparison", + nameof(comp)); + } + + return str.Contains(substring, comp); + } + + public static string Replace(this string originalString, string oldValue, string newValue, StringComparison comparisonType) + { + int startIndex = 0; + while (true) + { + startIndex = originalString.IndexOf(oldValue, startIndex, comparisonType); + if (startIndex == -1) + { + break; + } + + originalString = originalString[..startIndex] + newValue + originalString[(startIndex + oldValue.Length)..]; + + startIndex += newValue.Length; + } + + return originalString; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj index 4c067d9c..09acf8b6 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj @@ -1,4 +1,4 @@ - + net8.0 Library @@ -10,6 +10,9 @@ True + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs new file mode 100644 index 00000000..855b03d3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs @@ -0,0 +1,83 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Collections.Generic; +using System.Text.Json.Serialization; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public class UpdateData + { + [JsonPropertyName("UpdateInfo")] + public UpdateInfo UpdateInfo + { + get; set; + } + + [JsonPropertyName("Update")] + public Update Update + { + get; set; + } + + [JsonPropertyName("Xml")] + public Xml Xml + { + get; set; + } + + [JsonPropertyName("AppxMetadata")] + public AppxMetadataJson AppxMetadata + { + get; set; + } + + [JsonPropertyName("CTAC")] + public CTAC CTAC + { + get; set; + } + + [JsonPropertyName("SyncUpdatesResponse")] + public string SyncUpdatesResponse + { + get; set; + } + + [JsonPropertyName("GEI2Response")] + public string GEI2Response + { + get; set; + } + + [JsonPropertyName("CompDBs")] + public HashSet CompDBs + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs index 4fc90446..4fa70b7d 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs @@ -77,9 +77,9 @@ public static async Task GetBuildStringAsync(this UpdateData update) try { - CExtendedUpdateInfoXml.File deploymentCab = null; + Models.FE3.XML.ExtendedUpdateInfo.File deploymentCab = null; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.FileName.Replace('\\', Path.DirectorySeparatorChar).EndsWith("deployment.cab", StringComparison.InvariantCultureIgnoreCase)) { @@ -168,13 +168,13 @@ public static async Task GetBuildStringAsync(this UpdateData update) private static string GetBuildStringFromUpdateAgent(byte[] updateAgentFile) { - byte[] sign = new byte[] { + byte[] sign = [ 0x46, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00 - }; + ]; int fIndex = IndexOf(updateAgentFile, sign) + sign.Length; - int lIndex = IndexOf(updateAgentFile, new byte[] { 0x00, 0x00, 0x00 }, fIndex) + 1; + int lIndex = IndexOf(updateAgentFile, [0x00, 0x00, 0x00], fIndex) + 1; byte[] sliced = SliceByteArray(updateAgentFile, lIndex - fIndex, fIndex); @@ -229,10 +229,10 @@ public static async Task> GetAvailableLanguagesAsync(this Up private static async Task> GetCompDBs(UpdateData update) { - HashSet neutralCompDB = new(); - HashSet metadataCabs = new(); + HashSet neutralCompDB = []; + HashSet metadataCabs = []; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -245,7 +245,7 @@ private static async Task> GetCompDBs(UpdateData update) return neutralCompDB; } - foreach (CExtendedUpdateInfoXml.File metadataCab in metadataCabs) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File metadataCab in metadataCabs) { FileExchangeV3FileDownloadInformation fileDownloadInfo = await FE3Handler.GetFileUrl(update, metadataCab.Digest); if (fileDownloadInfo == null) diff --git a/src/Windows.Internal.Flighting/NativeMethods.cs b/src/Windows.Internal.Flighting/NativeMethods.cs index 5b6eb565..68503ef1 100644 --- a/src/Windows.Internal.Flighting/NativeMethods.cs +++ b/src/Windows.Internal.Flighting/NativeMethods.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Windows.Internal.Flighting diff --git a/src/Windows.Internal.Flighting/PlatformCTAC.cs b/src/Windows.Internal.Flighting/PlatformCTAC.cs index 769e002f..b7991fb6 100644 --- a/src/Windows.Internal.Flighting/PlatformCTAC.cs +++ b/src/Windows.Internal.Flighting/PlatformCTAC.cs @@ -1,11 +1,10 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; namespace Windows.Internal.Flighting { public class PlatformCTAC : IEquatable { - private static ClientAttributes ClientAttributes; + private static ClientAttributes? ClientAttributes; public string JSON { @@ -68,9 +67,9 @@ public bool Equals(PlatformCTAC other) public override int GetHashCode() { int hashCode = 1698843082; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(JSON); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(UriQuery); - hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(AttributeErrors); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(JSON); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(UriQuery); + hashCode = (hashCode * -1521134295) + EqualityComparer>.Default.GetHashCode(AttributeErrors); return hashCode; } diff --git a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs index d23e0f4c..98ca7a52 100644 --- a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs +++ b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs @@ -26,7 +26,7 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath appPath, dependencyPackages, optionalPackages: null, - licensePaths: string.IsNullOrEmpty(licensePath) ? null : new List { licensePath! }, + licensePaths: string.IsNullOrEmpty(licensePath) ? null : [licensePath!], customDataPath: customDataPath, regions: "all", stubPackageOption: stubPackageOption); @@ -48,7 +48,7 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath appPath, dependencyPackages, optionalPackages: null, - licensePaths: string.IsNullOrEmpty(licensePath) ? null : new List { licensePath! }, + licensePaths: string.IsNullOrEmpty(licensePath) ? null : [licensePath!], customDataPath: customDataPath, regions: null); } diff --git a/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs b/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs index 9411ffaf..49463e87 100644 --- a/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs +++ b/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs @@ -19,12 +19,12 @@ internal sealed class WimRegisteredCallbacks /// /// Stores a list of registered callbacks by their WimHandle. /// - private readonly Dictionary> _registeredCallbacksByHandle = new(); + private readonly Dictionary> _registeredCallbacksByHandle = []; /// /// Stores a list of globally registered callbacks. /// - private readonly Dictionary _registeredCallbacksGlobal = new(); + private readonly Dictionary _registeredCallbacksGlobal = []; /// /// Gets a native callback for passing to the WIMGAPI for the specified registered callback associated with the @@ -121,7 +121,7 @@ public bool RegisterCallback(WimHandle wimHandle, WimMessageCallback messageCall if (!_registeredCallbacksByHandle.ContainsKey(wimHandle)) { // Add an item for the wimHandle to the dictionary - _registeredCallbacksByHandle.Add(wimHandle, new Dictionary()); + _registeredCallbacksByHandle.Add(wimHandle, []); } // Create a callback wrapper and add the callback to the list diff --git a/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs b/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs index 0250fcce..8d2c4cc5 100644 --- a/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs +++ b/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs @@ -49,7 +49,7 @@ public static WimMountInfoCollection GetMountedImageInfo() case 0: // Return an empty list because there are no images - return new WimMountInfoCollection(new List()); + return new WimMountInfoCollection([]); case WimgApi.ERROR_INSUFFICIENT_BUFFER: @@ -63,7 +63,7 @@ public static WimMountInfoCollection GetMountedImageInfo() } // Create a collection of WimMountInfo objects - List wimMountInfos = new(); + List wimMountInfos = []; // Allocate enough memory for the return array IntPtr mountInfoPtr = Marshal.AllocHGlobal((int)returnLength); diff --git a/thirdparty/Privileges/Privilege.cs b/thirdparty/Privileges/Privilege.cs index 0a16013d..500505f8 100644 --- a/thirdparty/Privileges/Privilege.cs +++ b/thirdparty/Privileges/Privilege.cs @@ -14,8 +14,8 @@ public sealed class Privilege : IDisposable #region Private static members private static readonly LocalDataStoreSlot tlsSlot = Thread.AllocateDataSlot(); - private static readonly HybridDictionary privileges = new(); - private static readonly HybridDictionary luids = new(); + private static readonly HybridDictionary privileges = []; + private static readonly HybridDictionary luids = []; private static readonly ReaderWriterLock privilegeLock = new(); #endregion Private static members diff --git a/thirdparty/Privileges/PrivilegeNotHeldException.cs b/thirdparty/Privileges/PrivilegeNotHeldException.cs index 17dfaaa8..8a62dc60 100644 --- a/thirdparty/Privileges/PrivilegeNotHeldException.cs +++ b/thirdparty/Privileges/PrivilegeNotHeldException.cs @@ -31,6 +31,7 @@ private PrivilegeNotHeldException(SerializationInfo info, StreamingContext conte public string PrivilegeName { get; } = null; + [Obsolete] public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) From 1c3edc042f41048927c333367575935de3268aa4 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Fri, 6 Sep 2024 22:37:17 +0200 Subject: [PATCH 03/26] Cleanup CTAC attributes building --- .../CTAC.cs | 193 +++++++++--------- 1 file changed, 100 insertions(+), 93 deletions(-) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs index 04ea41bf..87407b96 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs @@ -20,6 +20,8 @@ * SOFTWARE. */ using System; +using System.Collections.Generic; +using System.Linq; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { @@ -137,99 +139,103 @@ private void BuildCTAC( DeviceFamily = "Windows.Team"; } - DeviceAttributes = "E:IsContainerMgrInstalled=1&" + - $"FlightRing={FlightRing}&" + - "TelemetryLevel=3&" + - "HidOverGattReg=C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll&" + - "AppVer=0.0.0.0&" + - "IsAutopilotRegistered=0&" + - "ProcessorIdentifier=Intel64 Family 6 Model 151 Stepping 2&" + - "OEMModel=RM-1085_1045&" + - "ProcessorManufacturer=GenuineIntel&" + - "InstallDate=1577722757&" + - "OEMModelBaseBoard=OEM Board Name&" + - $"BranchReadinessLevel={BranchReadinessLevel}&" + - "DataExpDateEpoch_20H1=1593425114&" + - "IsCloudDomainJoined=0&" + - "Bios=2019&" + - "DchuAmdGrfxVen=4098&" + - "IsDeviceRetailDemo=0&" + - $"FlightingBranchName={FlightingBranchName}&" + - "OSUILocale=en-US&" + - $"DeviceFamily={DeviceFamily}&" + - "UpgEx_20H1=Green&" + - $"WuClientVer={ReportingVersion}&" + - $"IsFlightingEnabled={flightEnabled}&" + - $"OSSkuId={(int)ReportingSku}&" + - "GStatus_20H1=2&" + - $"App={App}&" + - $"CurrentBranch={CurrentBranch}&" + - "InstallLanguage=en-US&" + - "OEMName_Uncleaned=MICROSOFTMDG&" + - $"InstallationType={InstallType}&" + - "AttrDataVer=264&" + - "IsEdgeWithChromiumInstalled=1&" + - "TimestampEpochString_20H1=1593425114&" + - $"OSVersion={ReportingVersion}&" + - "IsMDMEnrolled=0&" + - "TencentType=1&" + - $"FlightContent={content}&" + - "ActivationChannel=Retail&" + - "Steam=URL:steam protocol&" + - "Free=gt64&" + - "TencentReg=79 d0 01 d7 9f 54 d5 01&" + - "FirmwareVersion=7704&" + - "DchuAmdGrfxExists=1&" + - "SdbVer_20H1=2000000000&" + - "UpgEx_CO21H2=Green&" + - //$"OSArchitecture={MachineType.ToString().ToUpper()}&" + - $"OSArchitecture=AMD64&" + - "DefaultUserRegion=244&" + - $"ReleaseType={ReleaseType}&" + - "UpdateManagementGroup=2&" + - "MobileOperatorCommercialized=000-88&" + - "PhoneTargetingName=Lumia 950 XL&" + - "AllowInPlaceUpgrade=1&" + - "AllowUpgradesWithUnsupportedTPMOrCPU=1&" + - "CloudPBR=1&" + - "DataExpDateEpoch_19H1=1593425114&" + - "DataExpDateEpoch_21H1=1593425114&" + - "DataExpDateEpoch_21H2=1593425114&" + - "DataExpDateEpoch_CO21H2=1593425114&" + - "DataExpDateEpoch_CO21H2Setup=1593425114&" + - "DataVer_RS5=2000000000&" + - "DUScan=1&" + - "EKB19H2InstallCount=1&" + - "EKB19H2InstallTimeEpoch=1255000000&" + - "GenTelRunTimestamp_19H1=1593425114&" + - "GStatus_19H1=2&" + - "GStatus_19H1Setup=2&" + - "GStatus_20H1Setup=2&" + - "GStatus_21H2=2&" + - "GStatus_CO21H2=2&" + - "GStatus_CO21H2Setup=2&" + - "GStatus_RS5=2&" + - "MediaBranch=&" + - "ProcessorModel=12th Gen Intel(R) Core(TM) i9-12900K&" + - "SdbVer_19H1=2000000000&" + - "SecureBootCapable=1&" + - "TimestampEpochString_19H1=1593425114&" + - "TimestampEpochString_21H1=1593425114&" + - "TimestampEpochString_21H2=1593425114&" + - "TimestampEpochString_CO21H2=1593425114&" + - "TimestampEpochString_CO21H2Setup=1593425114&" + - "TPMVersion=2&" + - "UpdateOfferedDays=0&" + - "UpgEx_19H1=Green&" + - "UpgEx_21H1=Green&" + - "UpgEx_21H2=Green&" + - "UpgEx_NI22H2=Green&" + - "UpgEx_RS5=Green&" + - "UpgradeEligible=1&" + - "Version_RS5=2000000000&" + - $"IsRetailOS={FlightRing == "Retail"}&" + - $"MediaVersion={ReportingVersion}" + - $"IsVbsEnabled={(IsVbsEnabled ? 1 : 0)}"; + Dictionary deviceAttributeDictionary = []; + + deviceAttributeDictionary.Add("IsContainerMgrInstalled", "1"); + deviceAttributeDictionary.Add("FlightRing", FlightRing); + deviceAttributeDictionary.Add("TelemetryLevel", "3"); + deviceAttributeDictionary.Add("HidOverGattReg", "C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll"); + deviceAttributeDictionary.Add("AppVer", "0.0.0.0"); + deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); + deviceAttributeDictionary.Add("ProcessorIdentifier", "Intel64 Family 6 Model 151 Stepping 2"); + deviceAttributeDictionary.Add("OEMModel", "RM-1085_1045"); + deviceAttributeDictionary.Add("ProcessorManufacturer", "GenuineIntel"); + deviceAttributeDictionary.Add("InstallDate", "1577722757"); + deviceAttributeDictionary.Add("OEMModelBaseBoard", "OEM Board Name"); + deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); + deviceAttributeDictionary.Add("DataExpDateEpoch_20H1", "1593425114"); + deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); + deviceAttributeDictionary.Add("Bios", "2019"); + deviceAttributeDictionary.Add("DchuAmdGrfxVen", "4098"); + deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); + deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); + deviceAttributeDictionary.Add("OSUILocale", "en-US"); + deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); + deviceAttributeDictionary.Add("UpgEx_20H1", "Green"); + deviceAttributeDictionary.Add("WuClientVer", ReportingVersion); + deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); + deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); + deviceAttributeDictionary.Add("GStatus_20H1", "2"); + deviceAttributeDictionary.Add("App", App); + deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); + deviceAttributeDictionary.Add("InstallLanguage", "en-US"); + deviceAttributeDictionary.Add("OEMName_Uncleaned", "MICROSOFTMDG"); + deviceAttributeDictionary.Add("InstallationType", InstallType); + deviceAttributeDictionary.Add("AttrDataVer", "264"); + deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_20H1", "1593425114"); + deviceAttributeDictionary.Add("OSVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); + deviceAttributeDictionary.Add("TencentType", "1"); + deviceAttributeDictionary.Add("FlightContent", content); + deviceAttributeDictionary.Add("ActivationChannel", "Retail"); + deviceAttributeDictionary.Add("Steam", "URL:steam protocol"); + deviceAttributeDictionary.Add("Free", "gt64"); + deviceAttributeDictionary.Add("TencentReg", "79 d0 01 d7 9f 54 d5 01"); + deviceAttributeDictionary.Add("FirmwareVersion", "7704"); + deviceAttributeDictionary.Add("DchuAmdGrfxExists", "1"); + deviceAttributeDictionary.Add("SdbVer_20H1", "2000000000"); + deviceAttributeDictionary.Add("UpgEx_CO21H2", "Green"); + //deviceAttributeDictionary.Add("OSArchitecture", MachineType.ToString().ToUpper()); + deviceAttributeDictionary.Add("OSArchitecture", "AMD64"); + deviceAttributeDictionary.Add("DefaultUserRegion", "244"); + deviceAttributeDictionary.Add("ReleaseType", ReleaseType); + deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); + deviceAttributeDictionary.Add("MobileOperatorCommercialized", "000-88"); + deviceAttributeDictionary.Add("PhoneTargetingName", "Lumia 950 XL"); + deviceAttributeDictionary.Add("AllowInPlaceUpgrade", "1"); + deviceAttributeDictionary.Add("AllowUpgradesWithUnsupportedTPMOrCPU", "1"); + deviceAttributeDictionary.Add("CloudPBR", "1"); + deviceAttributeDictionary.Add("DataExpDateEpoch_19H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("DataVer_RS5", "2000000000"); + deviceAttributeDictionary.Add("DUScan", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallCount", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallTimeEpoch", "1255000000"); + deviceAttributeDictionary.Add("GenTelRunTimestamp_19H1", "1593425114"); + deviceAttributeDictionary.Add("GStatus_19H1", "2"); + deviceAttributeDictionary.Add("GStatus_19H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_20H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2Setup", "2"); + deviceAttributeDictionary.Add("GStatus_RS5", "2"); + deviceAttributeDictionary.Add("MediaBranch", ""); + deviceAttributeDictionary.Add("ProcessorModel", "12th Gen Intel(R) Core(TM) i9-12900K"); + deviceAttributeDictionary.Add("SdbVer_19H1", "2000000000"); + deviceAttributeDictionary.Add("SecureBootCapable", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_19H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("TPMVersion", "2"); + deviceAttributeDictionary.Add("UpdateOfferedDays", "0"); + deviceAttributeDictionary.Add("UpgEx_19H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_NI22H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_RS5", "Green"); + deviceAttributeDictionary.Add("UpgradeEligible", "1"); + deviceAttributeDictionary.Add("Version_RS5", "2000000000"); + deviceAttributeDictionary.Add("IsRetailOS", (FlightRing == "Retail").ToString()); + deviceAttributeDictionary.Add("MediaVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + + DeviceAttributes = $"E:{string.Join("&", deviceAttributeDictionary.Select(x => $"{x.Key}={x.Value}"))}"; if (ReportingSku is OSSkuId.EnterpriseS or OSSkuId.EnterpriseSN || ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase)) { @@ -279,6 +285,7 @@ private void BuildCTAC( { CallerAttributes += "Id=UpdateOrchestrator&"; } + Products = ""; if (!IsStore) { From 2d31e3aa02b894278068109fafacadba71f91e03 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Fri, 6 Sep 2024 22:51:44 +0200 Subject: [PATCH 04/26] Make the ImageUpdate Namespace a constant --- src/CompDB/ApplyTo.cs | 6 ++-- src/CompDB/ApplyToInfo.cs | 4 +-- src/CompDB/Appx.cs | 4 +-- src/CompDB/AppxPackage.cs | 6 ++-- src/CompDB/AppxPackages.cs | 4 +-- src/CompDB/CompDB.cs | 46 ++++++++++++++--------------- src/CompDB/Condition.cs | 20 ++++++------- src/CompDB/ConditionSet.cs | 8 ++--- src/CompDB/ConditionSets.cs | 4 +-- src/CompDB/ConditionalFeature.cs | 14 ++++----- src/CompDB/Conditions.cs | 4 +-- src/CompDB/Constants.cs | 28 ++++++++++++++++++ src/CompDB/CustomInfo.cs | 4 +-- src/CompDB/CustomInformation.cs | 4 +-- src/CompDB/Declare.cs | 6 ++-- src/CompDB/DeclareInfo.cs | 4 +-- src/CompDB/Dependencies.cs | 4 +-- src/CompDB/DeviceManifest.cs | 2 +- src/CompDB/Feature.cs | 20 ++++++------- src/CompDB/Features.cs | 4 +-- src/CompDB/InitialIntent.cs | 4 +-- src/CompDB/InitialIntents.cs | 4 +-- src/CompDB/MSConditionalFeatures.cs | 4 +-- src/CompDB/Package.cs | 16 +++++----- src/CompDB/Packages.cs | 4 +-- src/CompDB/Payload.cs | 4 +-- src/CompDB/PayloadItem.cs | 14 ++++----- src/CompDB/Require.cs | 6 ++-- src/CompDB/RequireInfo.cs | 4 +-- src/CompDB/SatelliteInfo.cs | 8 ++--- src/CompDB/Tag.cs | 6 ++-- src/CompDB/Tags.cs | 6 ++-- 32 files changed, 152 insertions(+), 124 deletions(-) create mode 100644 src/CompDB/Constants.cs diff --git a/src/CompDB/ApplyTo.cs b/src/CompDB/ApplyTo.cs index e2540b09..4a3649e5 100644 --- a/src/CompDB/ApplyTo.cs +++ b/src/CompDB/ApplyTo.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyTo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ApplyTo", Namespace = Constants.ImageUpdateNamespace)] public class ApplyTo { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; diff --git a/src/CompDB/ApplyToInfo.cs b/src/CompDB/ApplyToInfo.cs index e643ec57..89ea22fb 100644 --- a/src/CompDB/ApplyToInfo.cs +++ b/src/CompDB/ApplyToInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyToInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ApplyToInfo", Namespace = Constants.ImageUpdateNamespace)] public class ApplyToInfo { - [XmlElement(ElementName = "ApplyTo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ApplyTo", Namespace = Constants.ImageUpdateNamespace)] public List ApplyTo { get; set; diff --git a/src/CompDB/Appx.cs b/src/CompDB/Appx.cs index c10e58f2..d51546a7 100644 --- a/src/CompDB/Appx.cs +++ b/src/CompDB/Appx.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppX", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "AppX", Namespace = Constants.ImageUpdateNamespace)] public class Appx { - [XmlElement(ElementName = "AppXPackages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "AppXPackages", Namespace = Constants.ImageUpdateNamespace)] public AppxPackages AppXPackages { get; set; diff --git a/src/CompDB/AppxPackage.cs b/src/CompDB/AppxPackage.cs index 921051b8..defe5feb 100644 --- a/src/CompDB/AppxPackage.cs +++ b/src/CompDB/AppxPackage.cs @@ -23,7 +23,7 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] public class AppxPackage { [XmlAttribute(AttributeName = "AppXPackageType")] @@ -41,12 +41,12 @@ public string FamilyName { get; set; } - [XmlElement(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] public Payload Payload { get; set; } - [XmlElement(ElementName = "LicenseData", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "LicenseData", Namespace = Constants.ImageUpdateNamespace)] public string LicenseData { get; set; diff --git a/src/CompDB/AppxPackages.cs b/src/CompDB/AppxPackages.cs index 36c6ab26..82e1360e 100644 --- a/src/CompDB/AppxPackages.cs +++ b/src/CompDB/AppxPackages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppXPackages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "AppXPackages", Namespace = Constants.ImageUpdateNamespace)] public class AppxPackages { - [XmlElement(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] public List Package { get; set; diff --git a/src/CompDB/CompDB.cs b/src/CompDB/CompDB.cs index a841ae40..e00461fc 100644 --- a/src/CompDB/CompDB.cs +++ b/src/CompDB/CompDB.cs @@ -24,15 +24,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CompDB", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "CompDB", Namespace = Constants.ImageUpdateNamespace)] public class CompDB { - [XmlElement(ElementName = "Tags", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Tags", Namespace = Constants.ImageUpdateNamespace)] public Tags Tags { get; set; } - [XmlElement(ElementName = "Features", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Features", Namespace = Constants.ImageUpdateNamespace)] public Features Features { get; set; @@ -47,102 +47,102 @@ public string Xsd { get; set; } - [XmlAttribute(AttributeName = "CreatedDate", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "CreatedDate", Namespace = Constants.ImageUpdateNamespace)] public string CreatedDate { get; set; } - [XmlAttribute(AttributeName = "Revision", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Revision", Namespace = Constants.ImageUpdateNamespace)] public string Revision { get; set; } - [XmlAttribute(AttributeName = "SchemaVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "SchemaVersion", Namespace = Constants.ImageUpdateNamespace)] public string SchemaVersion { get; set; } - [XmlAttribute(AttributeName = "Product", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Product", Namespace = Constants.ImageUpdateNamespace)] public string Product { get; set; } - [XmlAttribute(AttributeName = "BuildID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "BuildID", Namespace = Constants.ImageUpdateNamespace)] public string BuildID { get; set; } - [XmlAttribute(AttributeName = "BuildInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "BuildInfo", Namespace = Constants.ImageUpdateNamespace)] public string BuildInfo { get; set; } - [XmlAttribute(AttributeName = "OSVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "OSVersion", Namespace = Constants.ImageUpdateNamespace)] public string OSVersion { get; set; } - [XmlAttribute(AttributeName = "BuildArch", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "BuildArch", Namespace = Constants.ImageUpdateNamespace)] public string BuildArch { get; set; } - [XmlAttribute(AttributeName = "ReleaseType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "ReleaseType", Namespace = Constants.ImageUpdateNamespace)] public string ReleaseType { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] public string Name { get; set; } - [XmlAttribute(AttributeName = "xmlns", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "xmlns", Namespace = Constants.ImageUpdateNamespace)] public string Xmlns { get; set; } - [XmlElement(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] public Packages Packages { get; set; } - [XmlElement(ElementName = "AppX", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "AppX", Namespace = Constants.ImageUpdateNamespace)] public Appx AppX { get; set; } - [XmlElement(ElementName = "MSConditionalFeatures", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "MSConditionalFeatures", Namespace = Constants.ImageUpdateNamespace)] public MSConditionalFeatures MSConditionalFeatures { get; set; } - [XmlAttribute(AttributeName = "TargetBuildID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "TargetBuildID", Namespace = Constants.ImageUpdateNamespace)] public string TargetBuildID { get; set; } - [XmlAttribute(AttributeName = "TargetBuildInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "TargetBuildInfo", Namespace = Constants.ImageUpdateNamespace)] public string TargetBuildInfo { get; set; } - [XmlAttribute(AttributeName = "TargetOSVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "TargetOSVersion", Namespace = Constants.ImageUpdateNamespace)] public string TargetOSVersion { get; set; } - [XmlAttribute(AttributeName = "UUPProduct", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UUPProduct", Namespace = Constants.ImageUpdateNamespace)] public string UUPProduct { get; set; } - [XmlAttribute(AttributeName = "UUPProductVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UUPProductVersion", Namespace = Constants.ImageUpdateNamespace)] public string UUPProductVersion { get; set; diff --git a/src/CompDB/Condition.cs b/src/CompDB/Condition.cs index 1b62c537..310f6ea3 100644 --- a/src/CompDB/Condition.cs +++ b/src/CompDB/Condition.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] public class Condition { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] public string Name { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Operator", Namespace = Constants.ImageUpdateNamespace)] public string Operator { get; set; } - [XmlAttribute(AttributeName = "RegistryKey", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "RegistryKey", Namespace = Constants.ImageUpdateNamespace)] public string RegistryKey { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; } - [XmlAttribute(AttributeName = "RegistryKeyType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "RegistryKeyType", Namespace = Constants.ImageUpdateNamespace)] public string RegistryKeyType { get; set; } - [XmlAttribute(AttributeName = "Status", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Status", Namespace = Constants.ImageUpdateNamespace)] public string Status { get; set; } - [XmlAttribute(AttributeName = "FeatureStatus", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureStatus", Namespace = Constants.ImageUpdateNamespace)] public string FeatureStatus { get; set; diff --git a/src/CompDB/ConditionSet.cs b/src/CompDB/ConditionSet.cs index 6cb6b5a2..d1446382 100644 --- a/src/CompDB/ConditionSet.cs +++ b/src/CompDB/ConditionSet.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] public class ConditionSet { - [XmlElement(ElementName = "Conditions", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Conditions", Namespace = Constants.ImageUpdateNamespace)] public Conditions Conditions { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Operator", Namespace = Constants.ImageUpdateNamespace)] public string Operator { get; set; } - [XmlElement(ElementName = "ConditionSets", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSets", Namespace = Constants.ImageUpdateNamespace)] public ConditionSets ConditionSets { get; set; diff --git a/src/CompDB/ConditionSets.cs b/src/CompDB/ConditionSets.cs index 55d4fcf5..792241c8 100644 --- a/src/CompDB/ConditionSets.cs +++ b/src/CompDB/ConditionSets.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSets", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionSets", Namespace = Constants.ImageUpdateNamespace)] public class ConditionSets { - [XmlElement(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] public ConditionSet ConditionSet { get; set; diff --git a/src/CompDB/ConditionalFeature.cs b/src/CompDB/ConditionalFeature.cs index f3924f03..fa9cbc41 100644 --- a/src/CompDB/ConditionalFeature.cs +++ b/src/CompDB/ConditionalFeature.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionalFeature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionalFeature", Namespace = Constants.ImageUpdateNamespace)] public class ConditionalFeature { - [XmlElement(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] public Condition Condition { get; set; } - [XmlAttribute(AttributeName = "InstallAction", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "InstallAction", Namespace = Constants.ImageUpdateNamespace)] public string InstallAction { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureID", Namespace = Constants.ImageUpdateNamespace)] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] public string FMID { get; set; } - [XmlElement(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] public ConditionSet ConditionSet { get; set; } - [XmlAttribute(AttributeName = "UpdateAction", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UpdateAction", Namespace = Constants.ImageUpdateNamespace)] public string UpdateAction { get; set; diff --git a/src/CompDB/Conditions.cs b/src/CompDB/Conditions.cs index 8d723b77..f714c3be 100644 --- a/src/CompDB/Conditions.cs +++ b/src/CompDB/Conditions.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Conditions", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Conditions", Namespace = Constants.ImageUpdateNamespace)] public class Conditions { - [XmlElement(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] public List Condition { get; set; diff --git a/src/CompDB/Constants.cs b/src/CompDB/Constants.cs new file mode 100644 index 00000000..1fb0239b --- /dev/null +++ b/src/CompDB/Constants.cs @@ -0,0 +1,28 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.Composition.Database +{ + public static class Constants + { + public const string ImageUpdateNamespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate"; + } +} \ No newline at end of file diff --git a/src/CompDB/CustomInfo.cs b/src/CompDB/CustomInfo.cs index 3273e602..586be4444 100644 --- a/src/CompDB/CustomInfo.cs +++ b/src/CompDB/CustomInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "CustomInfo", Namespace = Constants.ImageUpdateNamespace)] public class CustomInfo { - [XmlAttribute(AttributeName = "Key", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Key", Namespace = Constants.ImageUpdateNamespace)] public string Key { get; set; diff --git a/src/CompDB/CustomInformation.cs b/src/CompDB/CustomInformation.cs index 830c28de..3db5c3b7 100644 --- a/src/CompDB/CustomInformation.cs +++ b/src/CompDB/CustomInformation.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInformation", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "CustomInformation", Namespace = Constants.ImageUpdateNamespace)] public class CustomInformation { - [XmlElement(ElementName = "CustomInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "CustomInfo", Namespace = Constants.ImageUpdateNamespace)] public CustomInfo[] CustomInfo { get; set; diff --git a/src/CompDB/Declare.cs b/src/CompDB/Declare.cs index dea2c09c..5c5fa828 100644 --- a/src/CompDB/Declare.cs +++ b/src/CompDB/Declare.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Declare", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Declare", Namespace = Constants.ImageUpdateNamespace)] public class Declare { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; diff --git a/src/CompDB/DeclareInfo.cs b/src/CompDB/DeclareInfo.cs index e67d0e92..b136cfe7 100644 --- a/src/CompDB/DeclareInfo.cs +++ b/src/CompDB/DeclareInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeclareInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "DeclareInfo", Namespace = Constants.ImageUpdateNamespace)] public class DeclareInfo { - [XmlElement(ElementName = "Declare", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Declare", Namespace = Constants.ImageUpdateNamespace)] public Declare Declare { get; set; diff --git a/src/CompDB/Dependencies.cs b/src/CompDB/Dependencies.cs index 0c76ac22..fc42f9d3 100644 --- a/src/CompDB/Dependencies.cs +++ b/src/CompDB/Dependencies.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Dependencies", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Dependencies", Namespace = Constants.ImageUpdateNamespace)] public class Dependencies { - [XmlElement(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] public List Feature { get; set; diff --git a/src/CompDB/DeviceManifest.cs b/src/CompDB/DeviceManifest.cs index b5f5f48f..efa95adc 100644 --- a/src/CompDB/DeviceManifest.cs +++ b/src/CompDB/DeviceManifest.cs @@ -23,7 +23,7 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeviceManifest", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "DeviceManifest", Namespace = Constants.ImageUpdateNamespace)] public class DeviceManifest : CompDB { } diff --git a/src/CompDB/Feature.cs b/src/CompDB/Feature.cs index acc5c34a..fa711a30 100644 --- a/src/CompDB/Feature.cs +++ b/src/CompDB/Feature.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] public class Feature { - [XmlElement(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] public Packages Packages { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureID", Namespace = Constants.ImageUpdateNamespace)] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Group", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Group", Namespace = Constants.ImageUpdateNamespace)] public string Group { get; set; } - [XmlElement(ElementName = "Dependencies", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Dependencies", Namespace = Constants.ImageUpdateNamespace)] public Dependencies Dependencies { get; set; } - [XmlElement(ElementName = "InitialIntents", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "InitialIntents", Namespace = Constants.ImageUpdateNamespace)] public InitialIntents InitialIntents { get; set; } - [XmlElement(ElementName = "CustomInformation", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "CustomInformation", Namespace = Constants.ImageUpdateNamespace)] public CustomInformation CustomInformation { get; set; } - [XmlAttribute(AttributeName = "Family", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Family", Namespace = Constants.ImageUpdateNamespace)] public string Family { get; set; diff --git a/src/CompDB/Features.cs b/src/CompDB/Features.cs index c6d93a16..ee398173 100644 --- a/src/CompDB/Features.cs +++ b/src/CompDB/Features.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Features", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Features", Namespace = Constants.ImageUpdateNamespace)] public class Features { - [XmlElement(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] public Feature[] Feature { get; set; diff --git a/src/CompDB/InitialIntent.cs b/src/CompDB/InitialIntent.cs index 8e1f5fcc..d417e745 100644 --- a/src/CompDB/InitialIntent.cs +++ b/src/CompDB/InitialIntent.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntent", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "InitialIntent", Namespace = Constants.ImageUpdateNamespace)] public class InitialIntent { - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; diff --git a/src/CompDB/InitialIntents.cs b/src/CompDB/InitialIntents.cs index 26478725..0df48200 100644 --- a/src/CompDB/InitialIntents.cs +++ b/src/CompDB/InitialIntents.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntents", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "InitialIntents", Namespace = Constants.ImageUpdateNamespace)] public class InitialIntents { - [XmlElement(ElementName = "InitialIntent", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "InitialIntent", Namespace = Constants.ImageUpdateNamespace)] public List InitialIntent { get; set; diff --git a/src/CompDB/MSConditionalFeatures.cs b/src/CompDB/MSConditionalFeatures.cs index 49309015..f62de760 100644 --- a/src/CompDB/MSConditionalFeatures.cs +++ b/src/CompDB/MSConditionalFeatures.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "MSConditionalFeatures", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "MSConditionalFeatures", Namespace = Constants.ImageUpdateNamespace)] public class MSConditionalFeatures { - [XmlElement(ElementName = "ConditionalFeature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionalFeature", Namespace = Constants.ImageUpdateNamespace)] public List ConditionalFeature { get; set; diff --git a/src/CompDB/Package.cs b/src/CompDB/Package.cs index ded84baa..595e40ed 100644 --- a/src/CompDB/Package.cs +++ b/src/CompDB/Package.cs @@ -23,40 +23,40 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] public class Package { - [XmlAttribute(AttributeName = "ID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "ID", Namespace = Constants.ImageUpdateNamespace)] public string ID { get; set; } - [XmlAttribute(AttributeName = "PackageType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PackageType", Namespace = Constants.ImageUpdateNamespace)] public string PackageType { get; set; } - [XmlElement(ElementName = "SatelliteInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "SatelliteInfo", Namespace = Constants.ImageUpdateNamespace)] public SatelliteInfo SatelliteInfo { get; set; } - [XmlElement(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] public Payload Payload { get; set; } - [XmlAttribute(AttributeName = "InstalledSize", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "InstalledSize", Namespace = Constants.ImageUpdateNamespace)] public string InstalledSize { get; set; } - [XmlAttribute(AttributeName = "Version", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Version", Namespace = Constants.ImageUpdateNamespace)] public string Version { get; set; } - [XmlAttribute(AttributeName = "UpdateType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UpdateType", Namespace = Constants.ImageUpdateNamespace)] public string UpdateType { get; set; diff --git a/src/CompDB/Packages.cs b/src/CompDB/Packages.cs index 960a277c..a2ab7382 100644 --- a/src/CompDB/Packages.cs +++ b/src/CompDB/Packages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] public class Packages { - [XmlElement(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] public List Package { get; set; diff --git a/src/CompDB/Payload.cs b/src/CompDB/Payload.cs index 4d61d6d0..3c500d64 100644 --- a/src/CompDB/Payload.cs +++ b/src/CompDB/Payload.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] public class Payload { - [XmlElement(ElementName = "PayloadItem", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "PayloadItem", Namespace = Constants.ImageUpdateNamespace)] public List PayloadItem { get; set; diff --git a/src/CompDB/PayloadItem.cs b/src/CompDB/PayloadItem.cs index 3449a4de..03777827 100644 --- a/src/CompDB/PayloadItem.cs +++ b/src/CompDB/PayloadItem.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "PayloadItem", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "PayloadItem", Namespace = Constants.ImageUpdateNamespace)] public class PayloadItem { - [XmlAttribute(AttributeName = "PayloadHash", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadHash", Namespace = Constants.ImageUpdateNamespace)] public string SourceHash { get; set; } - [XmlAttribute(AttributeName = "PayloadSize", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadSize", Namespace = Constants.ImageUpdateNamespace)] public string PayloadSize { get; set; } - [XmlAttribute(AttributeName = "Path", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Path", Namespace = Constants.ImageUpdateNamespace)] public string SourceName { get; set; } - [XmlAttribute(AttributeName = "PayloadType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadType", Namespace = Constants.ImageUpdateNamespace)] public string PayloadType { get; set; } - [XmlAttribute(AttributeName = "AltSourceName", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "AltSourceName", Namespace = Constants.ImageUpdateNamespace)] public string AltSourceName { get; set; } - [XmlAttribute(AttributeName = "AltSourceHash", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "AltSourceHash", Namespace = Constants.ImageUpdateNamespace)] public string AltSourceHash { get; set; diff --git a/src/CompDB/Require.cs b/src/CompDB/Require.cs index c952a0de..73d39482 100644 --- a/src/CompDB/Require.cs +++ b/src/CompDB/Require.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Require", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Require", Namespace = Constants.ImageUpdateNamespace)] public class Require { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; diff --git a/src/CompDB/RequireInfo.cs b/src/CompDB/RequireInfo.cs index 4a8206e2..469b7ed9 100644 --- a/src/CompDB/RequireInfo.cs +++ b/src/CompDB/RequireInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "RequireInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "RequireInfo", Namespace = Constants.ImageUpdateNamespace)] public class RequireInfo { - [XmlElement(ElementName = "Require", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Require", Namespace = Constants.ImageUpdateNamespace)] public List Require { get; set; diff --git a/src/CompDB/SatelliteInfo.cs b/src/CompDB/SatelliteInfo.cs index 1808885c..f12e5373 100644 --- a/src/CompDB/SatelliteInfo.cs +++ b/src/CompDB/SatelliteInfo.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "SatelliteInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "SatelliteInfo", Namespace = Constants.ImageUpdateNamespace)] public class SatelliteInfo { - [XmlElement(ElementName = "RequireInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "RequireInfo", Namespace = Constants.ImageUpdateNamespace)] public RequireInfo RequireInfo { get; set; } - [XmlElement(ElementName = "ApplyToInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ApplyToInfo", Namespace = Constants.ImageUpdateNamespace)] public ApplyToInfo ApplyToInfo { get; set; } - [XmlElement(ElementName = "DeclareInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "DeclareInfo", Namespace = Constants.ImageUpdateNamespace)] public DeclareInfo DeclareInfo { get; set; diff --git a/src/CompDB/Tag.cs b/src/CompDB/Tag.cs index 3b93c561..aacbca46 100644 --- a/src/CompDB/Tag.cs +++ b/src/CompDB/Tag.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tag", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Tag", Namespace = Constants.ImageUpdateNamespace)] public class Tag { - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] public string Name { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] public string Value { get; set; diff --git a/src/CompDB/Tags.cs b/src/CompDB/Tags.cs index 36cb8146..48007620 100644 --- a/src/CompDB/Tags.cs +++ b/src/CompDB/Tags.cs @@ -24,15 +24,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tags", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Tags", Namespace = Constants.ImageUpdateNamespace)] public class Tags { - [XmlElement(ElementName = "Tag", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Tag", Namespace = Constants.ImageUpdateNamespace)] public List Tag { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] public string Type { get; set; From dd1f6902c97d6771677d2aed61eb832ee1ecdce5 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 11:09:07 +0200 Subject: [PATCH 05/26] Further splitting of inner classes --- ...uildTargets.EditionPlanningWithLanguage.cs | 35 ++++++++ src/Applications/UUPDownload/BuildTargets.cs | 8 +- .../UUPDownload/DownloadReplayOptions.cs | 78 +++++++++++++++++ ...LIOptions.cs => DownloadRequestOptions.cs} | 86 ------------------- .../UUPDownload/GetBuildsOptions.cs | 60 +++++++++++++ .../UUPDownload/Logging.LoggingLevel.cs | 33 +++++++ src/Applications/UUPDownload/Logging.cs | 8 +- 7 files changed, 208 insertions(+), 100 deletions(-) create mode 100644 src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs create mode 100644 src/Applications/UUPDownload/DownloadReplayOptions.cs rename src/Applications/UUPDownload/{CLIOptions.cs => DownloadRequestOptions.cs} (60%) create mode 100644 src/Applications/UUPDownload/GetBuildsOptions.cs create mode 100644 src/Applications/UUPDownload/Logging.LoggingLevel.cs diff --git a/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs b/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs new file mode 100644 index 00000000..db6d491a --- /dev/null +++ b/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs @@ -0,0 +1,35 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Collections.Generic; +using UnifiedUpdatePlatform.Media.Creator.Planning; + +namespace UUPDownload +{ + public static partial class BuildTargets + { + public class EditionPlanningWithLanguage + { + public List EditionTargets; + public string LanguageCode; + } + } +} diff --git a/src/Applications/UUPDownload/BuildTargets.cs b/src/Applications/UUPDownload/BuildTargets.cs index ff10fea0..a0ca2ad7 100644 --- a/src/Applications/UUPDownload/BuildTargets.cs +++ b/src/Applications/UUPDownload/BuildTargets.cs @@ -29,14 +29,8 @@ namespace UUPDownload { - public static class BuildTargets + public static partial class BuildTargets { - public class EditionPlanningWithLanguage - { - public List EditionTargets; - public string LanguageCode; - } - public static async Task GetTargetedPlanAsync(this UpdateData update, string LanguageCode) { HashSet compDBs = await update.GetCompDBsAsync(); diff --git a/src/Applications/UUPDownload/DownloadReplayOptions.cs b/src/Applications/UUPDownload/DownloadReplayOptions.cs new file mode 100644 index 00000000..a059f5d1 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadReplayOptions.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload +{ + [Verb("replay-download", isDefault: false, HelpText = "Replay a download from zero using a *.uupmcreplay file.")] + internal class DownloadReplayOptions + { + [Option('r', "replay-metadata", HelpText = @"The path to a *.uupmcreplay file to replay an older update and resume the download process. Example: D:\20236.1005.uupmcreplay", Required = true)] + public string ReplayMetadata + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] + public string Edition + { + get; set; + } + + [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] + public string Language + { + get; set; + } + + [Option("fixup", HelpText = @"Applies a fixup to files in output folder. Example: Appx", Required = false)] + public Fixup? Fixup + { + get; set; + } + + [Option("appxroot", HelpText = @"The folder containing the appx files for use with the Appx fixup", Required = false)] + public string AppxRoot + { + get; set; + } + + [Option("cabsroot", HelpText = @"The folder containing the cab files for use with the Appx fixup", Required = false)] + public string CabsRoot + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/CLIOptions.cs b/src/Applications/UUPDownload/DownloadRequestOptions.cs similarity index 60% rename from src/Applications/UUPDownload/CLIOptions.cs rename to src/Applications/UUPDownload/DownloadRequestOptions.cs index 7be57b38..636e71f9 100644 --- a/src/Applications/UUPDownload/CLIOptions.cs +++ b/src/Applications/UUPDownload/DownloadRequestOptions.cs @@ -117,90 +117,4 @@ public string Password get; set; } } - - [Verb("replay-download", isDefault: false, HelpText = "Replay a download from zero using a *.uupmcreplay file.")] - internal class DownloadReplayOptions - { - [Option('r', "replay-metadata", HelpText = @"The path to a *.uupmcreplay file to replay an older update and resume the download process. Example: D:\20236.1005.uupmcreplay", Required = true)] - public string ReplayMetadata - { - get; set; - } - - [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] - public MachineType MachineType - { - get; set; - } - - [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] - public string OutputFolder - { - get; set; - } - - [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] - public string Edition - { - get; set; - } - - [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] - public string Language - { - get; set; - } - - [Option("fixup", HelpText = @"Applies a fixup to files in output folder. Example: Appx", Required = false)] - public Fixup? Fixup - { - get; set; - } - - [Option("appxroot", HelpText = @"The folder containing the appx files for use with the Appx fixup", Required = false)] - public string AppxRoot - { - get; set; - } - - [Option("cabsroot", HelpText = @"The folder containing the cab files for use with the Appx fixup", Required = false)] - public string CabsRoot - { - get; set; - } - } - - [Verb("get-builds", isDefault: false, HelpText = "Get builds in all rings matching the request type")] - internal class GetBuildsOptions - { - [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] - public OSSkuId ReportingSku - { - get; set; - } - - [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] - public MachineType MachineType - { - get; set; - } - - [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] - public string Mail - { - get; set; - } - - [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] - public string Password - { - get; set; - } - - [Option("preview-targeting-attribute", HelpText = "The name of the set of targeting attributes to use. (Optional, Preview)", Required = false, Default = "")] - public string TargetingAttribute - { - get; set; - } - } } diff --git a/src/Applications/UUPDownload/GetBuildsOptions.cs b/src/Applications/UUPDownload/GetBuildsOptions.cs new file mode 100644 index 00000000..7bfc2e69 --- /dev/null +++ b/src/Applications/UUPDownload/GetBuildsOptions.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload +{ + [Verb("get-builds", isDefault: false, HelpText = "Get builds in all rings matching the request type")] + internal class GetBuildsOptions + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + + [Option("preview-targeting-attribute", HelpText = "The name of the set of targeting attributes to use. (Optional, Preview)", Required = false, Default = "")] + public string TargetingAttribute + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Logging.LoggingLevel.cs b/src/Applications/UUPDownload/Logging.LoggingLevel.cs new file mode 100644 index 00000000..541cb7e1 --- /dev/null +++ b/src/Applications/UUPDownload/Logging.LoggingLevel.cs @@ -0,0 +1,33 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UUPDownload +{ + internal static partial class Logging + { + public enum LoggingLevel + { + Information, + Warning, + Error + } + } +} \ No newline at end of file diff --git a/src/Applications/UUPDownload/Logging.cs b/src/Applications/UUPDownload/Logging.cs index 22bb85a8..ad3a8f04 100644 --- a/src/Applications/UUPDownload/Logging.cs +++ b/src/Applications/UUPDownload/Logging.cs @@ -23,14 +23,8 @@ namespace UUPDownload { - internal static class Logging + internal static partial class Logging { - public enum LoggingLevel - { - Information, - Warning, - Error - } private static readonly ConsoleColor Foreground; From f4023567ba29869b1fd2c5b7f8a7921188a2963c Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 13:12:05 +0200 Subject: [PATCH 06/26] fix: Export CHID api --- .../ComputerHardwareID.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs index 3ef5001e..c3b1b827 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs @@ -2,7 +2,7 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { - internal class ComputerHardwareID + public class ComputerHardwareID { public static string GenerateDeviceId(string Manufacturer, string Family, string Product, string Sku) { From 979ddccfc7adab4a40d26ccba1f828854f42449c Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 13:13:20 +0200 Subject: [PATCH 07/26] CompDB: Fix compat between DM and CDB --- src/CompDB/ApplyTo.cs | 6 +- src/CompDB/ApplyToInfo.cs | 4 +- src/CompDB/Appx.cs | 4 +- src/CompDB/AppxPackage.cs | 6 +- src/CompDB/AppxPackages.cs | 4 +- src/CompDB/BaseManifest.cs | 154 ++++++++++++++++++++++++++++ src/CompDB/CompDB.cs | 127 +---------------------- src/CompDB/Condition.cs | 20 ++-- src/CompDB/ConditionSet.cs | 8 +- src/CompDB/ConditionSets.cs | 4 +- src/CompDB/ConditionalFeature.cs | 14 +-- src/CompDB/Conditions.cs | 4 +- src/CompDB/CustomInfo.cs | 4 +- src/CompDB/CustomInformation.cs | 4 +- src/CompDB/Declare.cs | 6 +- src/CompDB/DeclareInfo.cs | 4 +- src/CompDB/Dependencies.cs | 4 +- src/CompDB/DeviceManifest.cs | 4 +- src/CompDB/Feature.cs | 20 ++-- src/CompDB/Features.cs | 4 +- src/CompDB/InitialIntent.cs | 4 +- src/CompDB/InitialIntents.cs | 4 +- src/CompDB/MSConditionalFeatures.cs | 4 +- src/CompDB/Package.cs | 16 +-- src/CompDB/Packages.cs | 4 +- src/CompDB/Payload.cs | 4 +- src/CompDB/PayloadItem.cs | 14 +-- src/CompDB/Require.cs | 6 +- src/CompDB/RequireInfo.cs | 4 +- src/CompDB/SatelliteInfo.cs | 8 +- src/CompDB/Tag.cs | 6 +- src/CompDB/Tags.cs | 6 +- 32 files changed, 257 insertions(+), 228 deletions(-) create mode 100644 src/CompDB/BaseManifest.cs diff --git a/src/CompDB/ApplyTo.cs b/src/CompDB/ApplyTo.cs index 4a3649e5..c8c5c370 100644 --- a/src/CompDB/ApplyTo.cs +++ b/src/CompDB/ApplyTo.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyTo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "ApplyTo")] public class ApplyTo { - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/ApplyToInfo.cs b/src/CompDB/ApplyToInfo.cs index 89ea22fb..7480b28c 100644 --- a/src/CompDB/ApplyToInfo.cs +++ b/src/CompDB/ApplyToInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyToInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "ApplyToInfo")] public class ApplyToInfo { - [XmlElement(ElementName = "ApplyTo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ApplyTo")] public List ApplyTo { get; set; diff --git a/src/CompDB/Appx.cs b/src/CompDB/Appx.cs index d51546a7..5ef088f8 100644 --- a/src/CompDB/Appx.cs +++ b/src/CompDB/Appx.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppX", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "AppX")] public class Appx { - [XmlElement(ElementName = "AppXPackages", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "AppXPackages")] public AppxPackages AppXPackages { get; set; diff --git a/src/CompDB/AppxPackage.cs b/src/CompDB/AppxPackage.cs index defe5feb..347d16c6 100644 --- a/src/CompDB/AppxPackage.cs +++ b/src/CompDB/AppxPackage.cs @@ -23,7 +23,7 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Package")] public class AppxPackage { [XmlAttribute(AttributeName = "AppXPackageType")] @@ -41,12 +41,12 @@ public string FamilyName { get; set; } - [XmlElement(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Payload")] public Payload Payload { get; set; } - [XmlElement(ElementName = "LicenseData", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "LicenseData")] public string LicenseData { get; set; diff --git a/src/CompDB/AppxPackages.cs b/src/CompDB/AppxPackages.cs index 82e1360e..f882ec54 100644 --- a/src/CompDB/AppxPackages.cs +++ b/src/CompDB/AppxPackages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppXPackages", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "AppXPackages")] public class AppxPackages { - [XmlElement(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Package")] public List Package { get; set; diff --git a/src/CompDB/BaseManifest.cs b/src/CompDB/BaseManifest.cs new file mode 100644 index 00000000..f0b23d79 --- /dev/null +++ b/src/CompDB/BaseManifest.cs @@ -0,0 +1,154 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.Composition.Database +{ + public class BaseManifest + { + [XmlElement(ElementName = "Tags")] + public Tags Tags + { + get; set; + } + [XmlElement(ElementName = "Features")] + public Features Features + { + get; set; + } + [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsi + { + get; set; + } + [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsd + { + get; set; + } + [XmlAttribute(AttributeName = "CreatedDate")] + public string CreatedDate + { + get; set; + } + [XmlAttribute(AttributeName = "Revision")] + public string Revision + { + get; set; + } + [XmlAttribute(AttributeName = "SchemaVersion")] + public string SchemaVersion + { + get; set; + } + [XmlAttribute(AttributeName = "Product")] + public string Product + { + get; set; + } + [XmlAttribute(AttributeName = "BuildID")] + public string BuildID + { + get; set; + } + [XmlAttribute(AttributeName = "BuildInfo")] + public string BuildInfo + { + get; set; + } + [XmlAttribute(AttributeName = "OSVersion")] + public string OSVersion + { + get; set; + } + [XmlAttribute(AttributeName = "BuildArch")] + public string BuildArch + { + get; set; + } + [XmlAttribute(AttributeName = "ReleaseType")] + public string ReleaseType + { + get; set; + } + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + [XmlElement(ElementName = "Packages")] + public Packages Packages + { + get; set; + } + [XmlElement(ElementName = "AppX")] + public Appx AppX + { + get; set; + } + [XmlElement(ElementName = "MSConditionalFeatures")] + public MSConditionalFeatures MSConditionalFeatures + { + get; set; + } + [XmlAttribute(AttributeName = "TargetBuildID")] + public string TargetBuildID + { + get; set; + } + [XmlAttribute(AttributeName = "TargetBuildInfo")] + public string TargetBuildInfo + { + get; set; + } + [XmlAttribute(AttributeName = "TargetOSVersion")] + public string TargetOSVersion + { + get; set; + } + [XmlAttribute(AttributeName = "UUPProduct")] + public string UUPProduct + { + get; set; + } + [XmlAttribute(AttributeName = "UUPProductVersion")] + public string UUPProductVersion + { + get; set; + } + + public override string ToString() + { + return Name; + } + } +} diff --git a/src/CompDB/CompDB.cs b/src/CompDB/CompDB.cs index e00461fc..18aeef74 100644 --- a/src/CompDB/CompDB.cs +++ b/src/CompDB/CompDB.cs @@ -25,132 +25,7 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { [XmlRoot(ElementName = "CompDB", Namespace = Constants.ImageUpdateNamespace)] - public class CompDB + public class CompDB : BaseManifest { - [XmlElement(ElementName = "Tags", Namespace = Constants.ImageUpdateNamespace)] - public Tags Tags - { - get; set; - } - [XmlElement(ElementName = "Features", Namespace = Constants.ImageUpdateNamespace)] - public Features Features - { - get; set; - } - [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsi - { - get; set; - } - [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsd - { - get; set; - } - [XmlAttribute(AttributeName = "CreatedDate", Namespace = Constants.ImageUpdateNamespace)] - public string CreatedDate - { - get; set; - } - [XmlAttribute(AttributeName = "Revision", Namespace = Constants.ImageUpdateNamespace)] - public string Revision - { - get; set; - } - [XmlAttribute(AttributeName = "SchemaVersion", Namespace = Constants.ImageUpdateNamespace)] - public string SchemaVersion - { - get; set; - } - [XmlAttribute(AttributeName = "Product", Namespace = Constants.ImageUpdateNamespace)] - public string Product - { - get; set; - } - [XmlAttribute(AttributeName = "BuildID", Namespace = Constants.ImageUpdateNamespace)] - public string BuildID - { - get; set; - } - [XmlAttribute(AttributeName = "BuildInfo", Namespace = Constants.ImageUpdateNamespace)] - public string BuildInfo - { - get; set; - } - [XmlAttribute(AttributeName = "OSVersion", Namespace = Constants.ImageUpdateNamespace)] - public string OSVersion - { - get; set; - } - [XmlAttribute(AttributeName = "BuildArch", Namespace = Constants.ImageUpdateNamespace)] - public string BuildArch - { - get; set; - } - [XmlAttribute(AttributeName = "ReleaseType", Namespace = Constants.ImageUpdateNamespace)] - public string ReleaseType - { - get; set; - } - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] - public string Type - { - get; set; - } - [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] - public string Name - { - get; set; - } - [XmlAttribute(AttributeName = "xmlns", Namespace = Constants.ImageUpdateNamespace)] - public string Xmlns - { - get; set; - } - [XmlElement(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] - public Packages Packages - { - get; set; - } - [XmlElement(ElementName = "AppX", Namespace = Constants.ImageUpdateNamespace)] - public Appx AppX - { - get; set; - } - [XmlElement(ElementName = "MSConditionalFeatures", Namespace = Constants.ImageUpdateNamespace)] - public MSConditionalFeatures MSConditionalFeatures - { - get; set; - } - [XmlAttribute(AttributeName = "TargetBuildID", Namespace = Constants.ImageUpdateNamespace)] - public string TargetBuildID - { - get; set; - } - [XmlAttribute(AttributeName = "TargetBuildInfo", Namespace = Constants.ImageUpdateNamespace)] - public string TargetBuildInfo - { - get; set; - } - [XmlAttribute(AttributeName = "TargetOSVersion", Namespace = Constants.ImageUpdateNamespace)] - public string TargetOSVersion - { - get; set; - } - [XmlAttribute(AttributeName = "UUPProduct", Namespace = Constants.ImageUpdateNamespace)] - public string UUPProduct - { - get; set; - } - [XmlAttribute(AttributeName = "UUPProductVersion", Namespace = Constants.ImageUpdateNamespace)] - public string UUPProductVersion - { - get; set; - } - - public override string ToString() - { - return Name; - } } } \ No newline at end of file diff --git a/src/CompDB/Condition.cs b/src/CompDB/Condition.cs index 310f6ea3..bba9ce2c 100644 --- a/src/CompDB/Condition.cs +++ b/src/CompDB/Condition.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Condition")] public class Condition { - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Name")] public string Name { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Operator")] public string Operator { get; set; } - [XmlAttribute(AttributeName = "RegistryKey", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "RegistryKey")] public string RegistryKey { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; } - [XmlAttribute(AttributeName = "RegistryKeyType", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "RegistryKeyType")] public string RegistryKeyType { get; set; } - [XmlAttribute(AttributeName = "Status", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Status")] public string Status { get; set; } - [XmlAttribute(AttributeName = "FeatureStatus", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FeatureStatus")] public string FeatureStatus { get; set; diff --git a/src/CompDB/ConditionSet.cs b/src/CompDB/ConditionSet.cs index d1446382..67f6214b 100644 --- a/src/CompDB/ConditionSet.cs +++ b/src/CompDB/ConditionSet.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "ConditionSet")] public class ConditionSet { - [XmlElement(ElementName = "Conditions", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Conditions")] public Conditions Conditions { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Operator")] public string Operator { get; set; } - [XmlElement(ElementName = "ConditionSets", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ConditionSets")] public ConditionSets ConditionSets { get; set; diff --git a/src/CompDB/ConditionSets.cs b/src/CompDB/ConditionSets.cs index 792241c8..8dd9b71d 100644 --- a/src/CompDB/ConditionSets.cs +++ b/src/CompDB/ConditionSets.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSets", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "ConditionSets")] public class ConditionSets { - [XmlElement(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ConditionSet")] public ConditionSet ConditionSet { get; set; diff --git a/src/CompDB/ConditionalFeature.cs b/src/CompDB/ConditionalFeature.cs index fa9cbc41..de9af0de 100644 --- a/src/CompDB/ConditionalFeature.cs +++ b/src/CompDB/ConditionalFeature.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionalFeature", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "ConditionalFeature")] public class ConditionalFeature { - [XmlElement(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Condition")] public Condition Condition { get; set; } - [XmlAttribute(AttributeName = "InstallAction", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "InstallAction")] public string InstallAction { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FeatureID")] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlElement(ElementName = "ConditionSet", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ConditionSet")] public ConditionSet ConditionSet { get; set; } - [XmlAttribute(AttributeName = "UpdateAction", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "UpdateAction")] public string UpdateAction { get; set; diff --git a/src/CompDB/Conditions.cs b/src/CompDB/Conditions.cs index f714c3be..315ccbfc 100644 --- a/src/CompDB/Conditions.cs +++ b/src/CompDB/Conditions.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Conditions", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Conditions")] public class Conditions { - [XmlElement(ElementName = "Condition", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Condition")] public List Condition { get; set; diff --git a/src/CompDB/CustomInfo.cs b/src/CompDB/CustomInfo.cs index 586be4444..55fb1cc7 100644 --- a/src/CompDB/CustomInfo.cs +++ b/src/CompDB/CustomInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "CustomInfo")] public class CustomInfo { - [XmlAttribute(AttributeName = "Key", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Key")] public string Key { get; set; diff --git a/src/CompDB/CustomInformation.cs b/src/CompDB/CustomInformation.cs index 3db5c3b7..3331c8e2 100644 --- a/src/CompDB/CustomInformation.cs +++ b/src/CompDB/CustomInformation.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInformation", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "CustomInformation")] public class CustomInformation { - [XmlElement(ElementName = "CustomInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "CustomInfo")] public CustomInfo[] CustomInfo { get; set; diff --git a/src/CompDB/Declare.cs b/src/CompDB/Declare.cs index 5c5fa828..cc681894 100644 --- a/src/CompDB/Declare.cs +++ b/src/CompDB/Declare.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Declare", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Declare")] public class Declare { - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/DeclareInfo.cs b/src/CompDB/DeclareInfo.cs index b136cfe7..d679f251 100644 --- a/src/CompDB/DeclareInfo.cs +++ b/src/CompDB/DeclareInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeclareInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "DeclareInfo")] public class DeclareInfo { - [XmlElement(ElementName = "Declare", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Declare")] public Declare Declare { get; set; diff --git a/src/CompDB/Dependencies.cs b/src/CompDB/Dependencies.cs index fc42f9d3..e4392439 100644 --- a/src/CompDB/Dependencies.cs +++ b/src/CompDB/Dependencies.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Dependencies", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Dependencies")] public class Dependencies { - [XmlElement(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Feature")] public List Feature { get; set; diff --git a/src/CompDB/DeviceManifest.cs b/src/CompDB/DeviceManifest.cs index efa95adc..db481657 100644 --- a/src/CompDB/DeviceManifest.cs +++ b/src/CompDB/DeviceManifest.cs @@ -23,8 +23,8 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeviceManifest", Namespace = Constants.ImageUpdateNamespace)] - public class DeviceManifest : CompDB + [XmlRoot(ElementName = "DeviceManifest")] + public class DeviceManifest : BaseManifest { } } \ No newline at end of file diff --git a/src/CompDB/Feature.cs b/src/CompDB/Feature.cs index fa711a30..305b83ef 100644 --- a/src/CompDB/Feature.cs +++ b/src/CompDB/Feature.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Feature")] public class Feature { - [XmlElement(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Packages")] public Packages Packages { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FeatureID")] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Group", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Group")] public string Group { get; set; } - [XmlElement(ElementName = "Dependencies", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Dependencies")] public Dependencies Dependencies { get; set; } - [XmlElement(ElementName = "InitialIntents", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "InitialIntents")] public InitialIntents InitialIntents { get; set; } - [XmlElement(ElementName = "CustomInformation", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "CustomInformation")] public CustomInformation CustomInformation { get; set; } - [XmlAttribute(AttributeName = "Family", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Family")] public string Family { get; set; diff --git a/src/CompDB/Features.cs b/src/CompDB/Features.cs index ee398173..2bdecdcd 100644 --- a/src/CompDB/Features.cs +++ b/src/CompDB/Features.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Features", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Features")] public class Features { - [XmlElement(ElementName = "Feature", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Feature")] public Feature[] Feature { get; set; diff --git a/src/CompDB/InitialIntent.cs b/src/CompDB/InitialIntent.cs index d417e745..6d2da505 100644 --- a/src/CompDB/InitialIntent.cs +++ b/src/CompDB/InitialIntent.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntent", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "InitialIntent")] public class InitialIntent { - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/InitialIntents.cs b/src/CompDB/InitialIntents.cs index 0df48200..3a0bdae3 100644 --- a/src/CompDB/InitialIntents.cs +++ b/src/CompDB/InitialIntents.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntents", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "InitialIntents")] public class InitialIntents { - [XmlElement(ElementName = "InitialIntent", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "InitialIntent")] public List InitialIntent { get; set; diff --git a/src/CompDB/MSConditionalFeatures.cs b/src/CompDB/MSConditionalFeatures.cs index f62de760..bc41d323 100644 --- a/src/CompDB/MSConditionalFeatures.cs +++ b/src/CompDB/MSConditionalFeatures.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "MSConditionalFeatures", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "MSConditionalFeatures")] public class MSConditionalFeatures { - [XmlElement(ElementName = "ConditionalFeature", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ConditionalFeature")] public List ConditionalFeature { get; set; diff --git a/src/CompDB/Package.cs b/src/CompDB/Package.cs index 595e40ed..5a2c9a94 100644 --- a/src/CompDB/Package.cs +++ b/src/CompDB/Package.cs @@ -23,40 +23,40 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Package")] public class Package { - [XmlAttribute(AttributeName = "ID", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "ID")] public string ID { get; set; } - [XmlAttribute(AttributeName = "PackageType", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "PackageType")] public string PackageType { get; set; } - [XmlElement(ElementName = "SatelliteInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "SatelliteInfo")] public SatelliteInfo SatelliteInfo { get; set; } - [XmlElement(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Payload")] public Payload Payload { get; set; } - [XmlAttribute(AttributeName = "InstalledSize", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "InstalledSize")] public string InstalledSize { get; set; } - [XmlAttribute(AttributeName = "Version", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Version")] public string Version { get; set; } - [XmlAttribute(AttributeName = "UpdateType", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "UpdateType")] public string UpdateType { get; set; diff --git a/src/CompDB/Packages.cs b/src/CompDB/Packages.cs index a2ab7382..80f05548 100644 --- a/src/CompDB/Packages.cs +++ b/src/CompDB/Packages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Packages", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Packages")] public class Packages { - [XmlElement(ElementName = "Package", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Package")] public List Package { get; set; diff --git a/src/CompDB/Payload.cs b/src/CompDB/Payload.cs index 3c500d64..e38cd19a 100644 --- a/src/CompDB/Payload.cs +++ b/src/CompDB/Payload.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Payload", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Payload")] public class Payload { - [XmlElement(ElementName = "PayloadItem", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "PayloadItem")] public List PayloadItem { get; set; diff --git a/src/CompDB/PayloadItem.cs b/src/CompDB/PayloadItem.cs index 03777827..b0d958a2 100644 --- a/src/CompDB/PayloadItem.cs +++ b/src/CompDB/PayloadItem.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "PayloadItem", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "PayloadItem")] public class PayloadItem { - [XmlAttribute(AttributeName = "PayloadHash", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "PayloadHash")] public string SourceHash { get; set; } - [XmlAttribute(AttributeName = "PayloadSize", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "PayloadSize")] public string PayloadSize { get; set; } - [XmlAttribute(AttributeName = "Path", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Path")] public string SourceName { get; set; } - [XmlAttribute(AttributeName = "PayloadType", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "PayloadType")] public string PayloadType { get; set; } - [XmlAttribute(AttributeName = "AltSourceName", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "AltSourceName")] public string AltSourceName { get; set; } - [XmlAttribute(AttributeName = "AltSourceHash", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "AltSourceHash")] public string AltSourceHash { get; set; diff --git a/src/CompDB/Require.cs b/src/CompDB/Require.cs index 73d39482..e29f54d4 100644 --- a/src/CompDB/Require.cs +++ b/src/CompDB/Require.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Require", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Require")] public class Require { - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/RequireInfo.cs b/src/CompDB/RequireInfo.cs index 469b7ed9..ddd73dcc 100644 --- a/src/CompDB/RequireInfo.cs +++ b/src/CompDB/RequireInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "RequireInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "RequireInfo")] public class RequireInfo { - [XmlElement(ElementName = "Require", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Require")] public List Require { get; set; diff --git a/src/CompDB/SatelliteInfo.cs b/src/CompDB/SatelliteInfo.cs index f12e5373..6fb45cb8 100644 --- a/src/CompDB/SatelliteInfo.cs +++ b/src/CompDB/SatelliteInfo.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "SatelliteInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "SatelliteInfo")] public class SatelliteInfo { - [XmlElement(ElementName = "RequireInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "RequireInfo")] public RequireInfo RequireInfo { get; set; } - [XmlElement(ElementName = "ApplyToInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "ApplyToInfo")] public ApplyToInfo ApplyToInfo { get; set; } - [XmlElement(ElementName = "DeclareInfo", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "DeclareInfo")] public DeclareInfo DeclareInfo { get; set; diff --git a/src/CompDB/Tag.cs b/src/CompDB/Tag.cs index aacbca46..33d4be89 100644 --- a/src/CompDB/Tag.cs +++ b/src/CompDB/Tag.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tag", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Tag")] public class Tag { - [XmlAttribute(AttributeName = "Name", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Name")] public string Name { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/Tags.cs b/src/CompDB/Tags.cs index 48007620..ef2def51 100644 --- a/src/CompDB/Tags.cs +++ b/src/CompDB/Tags.cs @@ -24,15 +24,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tags", Namespace = Constants.ImageUpdateNamespace)] + [XmlRoot(ElementName = "Tags")] public class Tags { - [XmlElement(ElementName = "Tag", Namespace = Constants.ImageUpdateNamespace)] + [XmlElement(ElementName = "Tag")] public List Tag { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = Constants.ImageUpdateNamespace)] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; From b05ec03e8481c2363b2366c075125c698dde27cd Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 13:50:07 +0200 Subject: [PATCH 08/26] CompDB -> BaseManifest --- src/Applications/UUPDownload/BuildTargets.cs | 4 +- .../UUPDownload/DownloadRequest/Process.cs | 8 +- .../Applications/AppxSelectionEngine.cs | 14 +- ...xtensions.cs => BaseManifestExtensions.cs} | 122 +++++++++--------- .../ConversionPlanBuilder.cs | 12 +- .../FileLocator.cs | 6 +- .../BaseEditions/BaseEditionBuilder.cs | 6 +- .../FileLocator.cs | 26 ++-- .../Installer/SetupMediaCreator.cs | 2 +- .../MediaCreator.cs | 8 +- .../DownloadHelpers.cs | 44 +++---- .../UpdateData.cs | 2 +- .../UpdateDataExtensions.cs | 10 +- 13 files changed, 132 insertions(+), 132 deletions(-) rename src/CompDB/{CompDBExtensions.cs => BaseManifestExtensions.cs} (53%) diff --git a/src/Applications/UUPDownload/BuildTargets.cs b/src/Applications/UUPDownload/BuildTargets.cs index a0ca2ad7..f0687ad2 100644 --- a/src/Applications/UUPDownload/BuildTargets.cs +++ b/src/Applications/UUPDownload/BuildTargets.cs @@ -33,7 +33,7 @@ public static partial class BuildTargets { public static async Task GetTargetedPlanAsync(this UpdateData update, string LanguageCode) { - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); Package editionPackPkg = compDBs.GetEditionPackFromCompDBs(); string editionPkg = await update.DownloadFileFromDigestAsync(editionPackPkg.Payload.PayloadItem.First(x => !x.Path.EndsWith(".psf")).PayloadHash); @@ -42,7 +42,7 @@ public static async Task GetTargetedPlanAsync(this public static async Task GetTargetedPlanAsync(this UpdateData update, string LanguageCode, string editionPkg) { - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); if (string.IsNullOrEmpty(editionPkg)) { return null; diff --git a/src/Applications/UUPDownload/DownloadRequest/Process.cs b/src/Applications/UUPDownload/DownloadRequest/Process.cs index b97863e8..7ffb001e 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Process.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Process.cs @@ -103,7 +103,7 @@ private static async Task ApplyAppxFixUpAsync(UpdateData update, string appxRoot update.CompDBs = await update.GetCompDBsAsync(); } - CompDB canonicalCompdb = update.CompDBs + BaseManifest canonicalCompdb = update.CompDBs .Where(compDB => compDB.Tags.Tag .Find(x => x.Name .Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value? @@ -230,7 +230,7 @@ private static async Task ProcessUpdateAsync(UpdateData update, string pOutputFo Logging.Log("Gathering update metadata..."); - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); await Task.WhenAll( Task.Run(async () => buildstr = await update.GetBuildStringAsync()), @@ -249,9 +249,9 @@ await Task.WhenAll( // We need to fallback to CompDB (less accurate but we have no choice, due to CUs etc... // Loop through all CompDBs to find the highest version reported - CompDB selectedCompDB = null; + BaseManifest selectedCompDB = null; Version currentHighest = null; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest compDB in compDBs) { if (compDB.TargetOSVersion != null) { diff --git a/src/CompDB/Applications/AppxSelectionEngine.cs b/src/CompDB/Applications/AppxSelectionEngine.cs index 58365e13..6d10a151 100644 --- a/src/CompDB/Applications/AppxSelectionEngine.cs +++ b/src/CompDB/Applications/AppxSelectionEngine.cs @@ -37,7 +37,7 @@ public static class AppxSelectionEngine /// /// /// - private static (Dictionary preinstalledApps, Feature[] appsFeatures) SetupVariables(CompDB editionCdb, IEnumerable appsCdbs) + private static (Dictionary preinstalledApps, Feature[] appsFeatures) SetupVariables(BaseManifest editionCdb, IEnumerable appsCdbs) { Dictionary preinstalledApps = editionCdb.Features.Feature .First(x => x.Type == "DesktopMedia") @@ -50,7 +50,7 @@ private static (Dictionary preinstalledApps, Featu List appsFeatures = []; - foreach (CompDB appsCdb in appsCdbs) + foreach (BaseManifest appsCdb in appsCdbs) { appsFeatures.AddRange(appsCdb.Features.Feature); } @@ -108,7 +108,7 @@ private static (Dictionary preinstalledApps, Featu /// The edition Composition Database to generate licenses for /// The application Composition Database /// The path to the repository file set - public static void GenerateLicenseXmlFiles(CompDB editionCdb, IEnumerable appsCdbs, string repositoryPath) + public static void GenerateLicenseXmlFiles(BaseManifest editionCdb, IEnumerable appsCdbs, string repositoryPath) { (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); @@ -142,7 +142,7 @@ public static void GenerateLicenseXmlFiles(CompDB editionCdb, IEnumerableThe application Composition Database /// The path to the repository file set /// - public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionCdb, IEnumerable appsCdbs, string editionLanguage) + public static AppxInstallWorkload[] GetAppxInstallationWorkloads(BaseManifest editionCdb, IEnumerable appsCdbs, string editionLanguage) { List workloads = []; @@ -185,7 +185,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC } Dictionary packageHashDict = []; - foreach (CompDB appsCdb in appsCdbs) + foreach (BaseManifest appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) { @@ -496,7 +496,7 @@ private static IEnumerable GetAllPossibleLanguageCombinations(string edi /// The application Composition Database /// The path to the repository file set /// - public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumerable appsCdbs, string editionLanguage) + public static PackageProperties[] GetAppxFilesToKeep(BaseManifest editionCdb, IEnumerable appsCdbs, string editionLanguage) { IEnumerable applicableLanguageTags = GetAllPossibleLanguageCombinations(editionLanguage); @@ -537,7 +537,7 @@ public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumera } Dictionary packageHashDict = []; - foreach (CompDB appsCdb in appsCdbs) + foreach (BaseManifest appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) { diff --git a/src/CompDB/CompDBExtensions.cs b/src/CompDB/BaseManifestExtensions.cs similarity index 53% rename from src/CompDB/CompDBExtensions.cs rename to src/CompDB/BaseManifestExtensions.cs index 273c9fdd..b3110377 100644 --- a/src/CompDB/CompDBExtensions.cs +++ b/src/CompDB/BaseManifestExtensions.cs @@ -26,134 +26,134 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - public static class CompDBExtensions + public static class BaseManifestExtensions { public static string GetCommonlyUsedIncorrectFileName(this Package pkg) { return pkg.Payload.PayloadItem.First(x => !x.Path.EndsWith(".psf")).Path.Replace('\\', Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Last().Replace("~31bf3856ad364e35", "").Replace("~.", ".").Replace("~", "-").Replace("-.", "."); } - public static CompDB GetNeutralCompDB(this IEnumerable compDBs) + public static BaseManifest GetNeutralCompDB(this IEnumerable BaseManifests) { - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { - if (compDB.Type != "Build") + if (BaseManifest.Type != "Build") { continue; } - if (compDB.Name?.Contains("Desktop_FOD") == true) + if (BaseManifest.Name?.Contains("Desktop_FOD") == true) { continue; } // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Neutral", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Features?.Feature != null && - compDB.Packages?.Package != null) + if (BaseManifest.Tags.Type.Equals("Neutral", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Features?.Feature != null && + BaseManifest.Packages?.Package != null) { - return compDB; + return BaseManifest; } } // - // Older style compdbs have no tag elements, we need to find out if it's a neutral compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's a neutral BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("BaseNeutral", StringComparison.InvariantCultureIgnoreCase) == true) != null) { - return compDB; + return BaseManifest; } } return null; } - public static HashSet GetEditionCompDBsForLanguage( - this IEnumerable compDBs, + public static HashSet GetEditionCompDBsForLanguage( + this IEnumerable BaseManifests, string LanguageCode) { - HashSet filteredCompDBs = []; + HashSet filteredBaseManifests = []; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // TODO: Do not do contains // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Count == 3 && - compDB.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Find(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + if (BaseManifest.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Count == 3 && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } // - // Older style compdbs have no tag elements, we need to find out if it's an edition compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's an edition BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("DesktopMedia", StringComparison.InvariantCultureIgnoreCase) == true && x.FeatureID?.Contains(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true) != null && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } - return filteredCompDBs; + return filteredBaseManifests; } - public static HashSet GetEditionCompDBs(this IEnumerable compDBs) + public static HashSet GetEditionCompDBs(this IEnumerable BaseManifests) { - HashSet filteredCompDBs = []; + HashSet filteredBaseManifests = []; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // TODO: Do not do contains // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Count == 3 && - compDB.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + if (BaseManifest.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Count == 3 && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } // - // Older style compdbs have no tag elements, we need to find out if it's an edition compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's an edition BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("DesktopMedia", StringComparison.InvariantCultureIgnoreCase) == true) != null && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } - return filteredCompDBs; + return filteredBaseManifests; } - public static IEnumerable GetAvailableLanguages(this IEnumerable compDBs) + public static IEnumerable GetAvailableLanguages(this IEnumerable BaseManifests) { - return compDBs.GetEditionCompDBs().Select(x => + return BaseManifests.GetEditionCompDBs().Select(x => { if (x.Tags != null) { @@ -171,22 +171,22 @@ public static IEnumerable GetAvailableLanguages(this IEnumerable }).Where(x => !string.IsNullOrEmpty(x)).Distinct(); } - public static Package GetEditionPackFromCompDBs(this IEnumerable compDBs) + public static Package GetEditionPackFromCompDBs(this IEnumerable BaseManifests) { HashSet pkgs = []; // // Get base editions that are available with all their files // - HashSet filteredCompDBs = compDBs.GetEditionCompDBs(); + HashSet filteredBaseManifests = BaseManifests.GetEditionCompDBs(); - if (filteredCompDBs.Count > 0) + if (filteredBaseManifests.Count > 0) { - foreach (CompDB compDB in filteredCompDBs) + foreach (BaseManifest BaseManifest in filteredBaseManifests) { - foreach (Package feature in filteredCompDBs.First().Features.Feature[0].Packages.Package) + foreach (Package feature in filteredBaseManifests.First().Features.Feature[0].Packages.Package) { - Package pkg = filteredCompDBs.First().Packages.Package.First(x => x.ID == feature.ID); + Package pkg = filteredBaseManifests.First().Packages.Package.First(x => x.ID == feature.ID); IEnumerable files = pkg.Payload.PayloadItem.Select(x => x.Path.Replace('\\', Path.DirectorySeparatorChar)); diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs index c77c000a..7b98653b 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs @@ -276,7 +276,7 @@ ref List editionsAdded private static (List, List) GetEditionsThatCanBeTargetedUsingPackageDowngrade( string UUPPath, - IEnumerable compDBs, + IEnumerable compDBs, IEnumerable availableCanonicalEditions, List possibleEditionUpgrades, ProgressCallback? progressCallback = null) @@ -287,7 +287,7 @@ private static (List, List) GetEditionsThatCanBe // // Attempt to get the neutral Composition Database listing all available files // - CompDB? neutralCompDB = compDBs.GetNeutralCompDB(); + BaseManifest? neutralCompDB = compDBs.GetNeutralCompDB(); if (neutralCompDB != null && neutralCompDB.Features.Feature.FirstOrDefault(x => x.FeatureID == "BaseNeutral")? @@ -387,7 +387,7 @@ private static (List, List) GetEditionsThatCanBe } public static bool GetTargetedPlan( - IEnumerable compDBs, + IEnumerable compDBs, string EditionPack, string LanguageCode, bool IncludeServicingCapableOnlyTargets, @@ -444,7 +444,7 @@ public static List PrintEditionTarget(EditionTarget editionTarget, int p public static bool GetTargetedPlan( string UUPPath, - IEnumerable compDBs, + IEnumerable compDBs, string EditionPack, string LanguageCode, bool IncludeServicingCapableOnlyTargets, @@ -463,7 +463,7 @@ public static bool GetTargetedPlan( // // Get base editions that are available with all their files // - IEnumerable filteredCompDBs = compDBs.GetEditionCompDBsForLanguage(LanguageCode).Where(x => + IEnumerable filteredCompDBs = compDBs.GetEditionCompDBsForLanguage(LanguageCode).Where(x => { bool success = !VerifyFiles; if (!success) @@ -504,7 +504,7 @@ public static bool GetTargetedPlan( if (compDBs.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { - IEnumerable AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); + IEnumerable AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); edition.AppXInstallWorkloads = AppxSelectionEngine.GetAppxInstallationWorkloads(compDB, AppCompDBs, LanguageCode); } diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs index f91d29ec..c136f068 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs @@ -34,9 +34,9 @@ namespace UnifiedUpdatePlatform.Media.Creator.Planning { public static class FileLocator { - public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager tempManager) + public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager tempManager) { - List compDBs = []; + List compDBs = []; try { @@ -87,7 +87,7 @@ public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager te return compDBs; } - public static (bool, HashSet) VerifyFilesAreAvailableForCompDB(CompDB compDB, string UUPPath) + public static (bool, HashSet) VerifyFilesAreAvailableForCompDB(BaseManifest compDB, string UUPPath) { HashSet missingPackages = []; diff --git a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs index 79fa52f7..b848384e 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs @@ -45,7 +45,7 @@ public static bool CreateBaseEdition( string InputWindowsREPath, string OutputInstallImage, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { @@ -178,7 +178,7 @@ public static bool CreateBaseEditionWithAppXs( string OutputInstallImage, Common.Messaging.Common.CompressionType CompressionType, AppxInstallWorkload[] appxWorkloads, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, bool keepVhd, out string vhdPath, @@ -355,7 +355,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs index 9d3b6704..d001cb5c 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs @@ -32,11 +32,11 @@ namespace UnifiedUpdatePlatform.Media.Creator { internal static class FileLocator { - internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDatabases(HashSet CompositionDatabases, string UUPPath) + internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDatabases(HashSet CompositionDatabases, string UUPPath) { HashSet missingPackages = []; - foreach (CompDB compDB in CompositionDatabases) + foreach (BaseManifest compDB in CompositionDatabases) { (bool succeeded, HashSet missingFiles) = Planning.FileLocator.VerifyFilesAreAvailableForCompDB(compDB, UUPPath); foreach (string? missingFile in missingFiles) @@ -51,12 +51,12 @@ internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDat return (missingPackages.Count == 0, missingPackages); } - internal static CompDB? GetEditionCompDBForLanguage( - IEnumerable CompositionDatabases, + internal static BaseManifest? GetEditionCompDBForLanguage( + IEnumerable CompositionDatabases, string Edition, string LanguageCode) { - foreach (CompDB? compDB in CompositionDatabases) + foreach (BaseManifest? compDB in CompositionDatabases) { // // Newer style compdbs have a tag attribute, make use of it. @@ -95,15 +95,15 @@ internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDat internal static (bool Succeeded, string BaseESD) LocateFilesForSetupMediaCreation( string UUPPath, string LanguageCode, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Looking up Composition Database in order to find a Base ESD image appropriate for building windows setup files."); - HashSet filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode); + HashSet filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode); if (filteredCompositionDatabases.Count > 0) { - foreach (CompDB? currentCompDB in filteredCompositionDatabases) + foreach (BaseManifest? currentCompDB in filteredCompositionDatabases) { foreach (Package feature in currentCompDB.Features.Feature[0].Packages.Package) { @@ -136,14 +136,14 @@ internal static bool GenerateAppXLicenseFiles( string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { bool success = true; progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Enumerating files"); - CompDB? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); + BaseManifest? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); if (compDB == null) { @@ -153,7 +153,7 @@ internal static bool GenerateAppXLicenseFiles( if (CompositionDatabases.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { - IEnumerable AppCompDBs = CompositionDatabases.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); + IEnumerable AppCompDBs = CompositionDatabases.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); AppxSelectionEngine.GenerateLicenseXmlFiles(compDB, AppCompDBs, UUPPath); } @@ -170,7 +170,7 @@ internal static (bool Succeeded, string BaseESD, HashSet ReferencePackag string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { bool success = true; @@ -180,7 +180,7 @@ internal static (bool Succeeded, string BaseESD, HashSet ReferencePackag string? BaseESD = null; progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Enumerating files"); - CompDB? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); + BaseManifest? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); if (compDB == null) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs b/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs index a2284966..4a605e79 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs @@ -35,7 +35,7 @@ public static bool CreateSetupMedia( string OutputMediaPath, string OutputWindowsREPath, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs b/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs index 566b366e..1495b8ea 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs @@ -48,7 +48,7 @@ private static bool HandleEditionPlan( string InstallWIMFilePath, string WinREWIMFilePath, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, string VHDMountPath = null, string CurrentBackupVHD = null, @@ -285,7 +285,7 @@ void callback(string Operation, int ProgressPercentage, bool IsIndeterminate) public static bool GetTargetedPlan( string UUPPath, string LanguageCode, - List CompositionDatabases, + List CompositionDatabases, out List EditionTargets, TempManager tempManager, ProgressCallback progressCallback = null) @@ -297,7 +297,7 @@ public static bool GetTargetedPlan( // // Get base editions that are available with all their files // - IEnumerable filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode).Where(x => + IEnumerable filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode).Where(x => { (bool success, HashSet missingfiles) = Planning.FileLocator.VerifyFilesAreAvailableForCompDB(x, UUPPath); return success; @@ -388,7 +388,7 @@ public static void CreateISOMedia( try { - List CompositionDatabases = Planning.FileLocator.GetCompDBsFromUUPFiles(UUPPath, tempManager); + List CompositionDatabases = Planning.FileLocator.GetCompDBsFromUUPFiles(UUPPath, tempManager); result = GetTargetedPlan(UUPPath, LanguageCode, CompositionDatabases, out List editionTargets, tempManager, progressCallback); if (!result) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index 20c2d8a1..88518b3c 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -85,17 +85,17 @@ private static bool IsFileBanned(Models.FE3.XML.ExtendedUpdateInfo.File file2, I private static ( - HashSet selectedCompDBs, - HashSet discardedCompDBs, - HashSet specificCompDBs + HashSet selectedCompDBs, + HashSet discardedCompDBs, + HashSet specificCompDBs ) - FilterCompDBs(HashSet compDBs, string Edition, string Language) + FilterCompDBs(HashSet compDBs, string Edition, string Language) { - HashSet selectedCompDBs = []; - HashSet discardedCompDBs = []; - HashSet specificCompDBs = []; + HashSet selectedCompDBs = []; + HashSet discardedCompDBs = []; + HashSet specificCompDBs = []; - foreach (CompDB cdb in compDBs) + foreach (BaseManifest cdb in compDBs) { bool IsDiff = cdb.Tags?.Tag?.Any(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase) && (x.Value.Equals("Diff", StringComparison.InvariantCultureIgnoreCase) || x.Value.Equals("Baseless", StringComparison.InvariantCultureIgnoreCase))) == true; @@ -175,7 +175,7 @@ private static HashSet payloadItems, HashSet bannedPayloadItems ) - BuildListOfPayloads(HashSet compDBs, string Edition, string Language) + BuildListOfPayloads(HashSet compDBs, string Edition, string Language) { HashSet payloadItems = []; HashSet bannedPayloadItems = []; @@ -185,16 +185,16 @@ HashSet bannedPayloadItems return (payloadItems, bannedPayloadItems); } - IEnumerable AppCompDBs = null; + IEnumerable AppCompDBs = null; - (HashSet selectedCompDBs, HashSet discardedCompDBs, HashSet specificCompDBs) = FilterCompDBs(compDBs, Edition, Language); + (HashSet selectedCompDBs, HashSet discardedCompDBs, HashSet specificCompDBs) = FilterCompDBs(compDBs, Edition, Language); if (compDBs.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); } - foreach (CompDB cdb in selectedCompDBs) + foreach (BaseManifest cdb in selectedCompDBs) { if (AppCompDBs?.Contains(cdb) == true || cdb.Packages == null) { @@ -235,7 +235,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB cdb in discardedCompDBs) + foreach (BaseManifest cdb in discardedCompDBs) { if (AppCompDBs?.Contains(cdb) == true || cdb.Packages == null) { @@ -281,7 +281,7 @@ HashSet bannedPayloadItems // Get everything case (false, false): { - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { foreach (Package pkg in AppCompDB.Packages.Package) { @@ -323,7 +323,7 @@ HashSet bannedPayloadItems // Get edition case (false, true): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasEdition = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -344,7 +344,7 @@ HashSet bannedPayloadItems // Get language case (true, false): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasLang = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -365,7 +365,7 @@ HashSet bannedPayloadItems // Get edition + language case (true, true): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasLang = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase)) == true; bool hasEdition = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -387,7 +387,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { foreach (Package pkg in AppCompDB.Packages.Package) { @@ -403,7 +403,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { if (AppCompDB.AppX?.AppXPackages?.Package != null) { @@ -431,7 +431,7 @@ HashSet bannedPayloadItems } else { - foreach (CompDB specificCompDB in specificCompDBs) + foreach (BaseManifest specificCompDB in specificCompDBs) { if (AppCompDBs?.Contains(specificCompDB) == true || specificCompDB.Packages == null) { @@ -481,7 +481,7 @@ public static async Task ProcessUpdateAsync(UpdateData update, string pO int returnCode = 0; IEnumerable filesToDownload = null; - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); await Task.WhenAll( Task.Run(async () => buildstr = await update.GetBuildStringAsync()), @@ -546,7 +546,7 @@ await Task.WhenAll( { /*try { - foreach (CompDB compDb in compDBs) + foreach (BaseManifest compDb in compDBs) { foreach (Package pkg in compDb.Packages.Package) { diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs index 855b03d3..200ab5bc 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs @@ -75,7 +75,7 @@ public string GEI2Response } [JsonPropertyName("CompDBs")] - public HashSet CompDBs + public HashSet CompDBs { get; set; } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs index 4fa70b7d..d48b8725 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs @@ -142,8 +142,8 @@ public static async Task GetBuildStringAsync(this UpdateData update) { try { - HashSet compDBs = await update.GetCompDBsAsync(); - CompDB firstCompDB = compDBs.First(); + HashSet compDBs = await update.GetCompDBsAsync(); + BaseManifest firstCompDB = compDBs.First(); // example: // BuildInfo="co_release.21382.1.210511-1416" OSVersion="10.0.21382.1" TargetBuildInfo="co_release.21382.1.210511-1416" TargetOSVersion="10.0.21382.1" @@ -227,9 +227,9 @@ public static async Task> GetAvailableLanguagesAsync(this Up return (await update.GetCompDBsAsync()).GetAvailableLanguages(); } - private static async Task> GetCompDBs(UpdateData update) + private static async Task> GetCompDBs(UpdateData update) { - HashSet neutralCompDB = []; + HashSet neutralCompDB = []; HashSet metadataCabs = []; foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) @@ -328,7 +328,7 @@ private static async Task> GetCompDBs(UpdateData update) return neutralCompDB; } - public static async Task> GetCompDBsAsync(this UpdateData update) + public static async Task> GetCompDBsAsync(this UpdateData update) { return update.CompDBs ??= await GetCompDBs(update); } From 4de985cbaa695942501bbe75b4183c699c548039 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 15:17:29 +0200 Subject: [PATCH 09/26] Add CHID unit tests --- UUPMediaCreator.sln | 25 ++- .../ComputerHardwareIDUnitTests.cs | 176 ++++++++++++++++++ ...vices.WindowsUpdate.Targeting.Tests.csproj | 27 +++ .../ComputerHardwareID.cs | 164 +++++++++++++++- 4 files changed, 389 insertions(+), 3 deletions(-) create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj diff --git a/UUPMediaCreator.sln b/UUPMediaCreator.sln index 72fdb4c2..502f572e 100644 --- a/UUPMediaCreator.sln +++ b/UUPMediaCreator.sln @@ -47,7 +47,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Servi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj", "{E5A8D8A2-6219-4632-84EC-8F8BF625A596}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Models", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Models\UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj", "{D78B2286-F75B-4FE6-990B-84117E722CD4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Models", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Models\UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj", "{D78B2286-F75B-4FE6-990B-84117E722CD4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj", "{95007D84-20A1-4711-9CBC-DEE3B1798E74}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -483,6 +485,26 @@ Global {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x64.Build.0 = Release|Any CPU {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.ActiveCfg = Release|Any CPU {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|ARM.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|ARM.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|arm64.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|arm64.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x64.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x64.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x86.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x86.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|Any CPU.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|ARM.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|ARM.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|arm64.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|arm64.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x64.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x64.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -509,6 +531,7 @@ Global {7AFF6421-B605-43F1-B849-D331E979B3B1} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {E5A8D8A2-6219-4632-84EC-8F8BF625A596} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {D78B2286-F75B-4FE6-990B-84117E722CD4} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {95007D84-20A1-4711-9CBC-DEE3B1798E74} = {162FE1A9-890A-4101-AFF8-54F6B1483882} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FEE89471-4FE8-4620-991F-4EBAD0F4CFEA} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs new file mode 100644 index 00000000..0ba555ab --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs @@ -0,0 +1,176 @@ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests +{ + [TestClass] + public class ComputerHardwareIDUnitTests + { + private readonly string BIOSVendor; + private readonly string BIOSVersionString; + private readonly string SystemBIOSMajorRelease; + private readonly string SystemBIOSMinorRelease; + + private readonly string SystemManufacturer; + private readonly string SystemFamily; + private readonly string SystemProductName; + private readonly string SKUNumber; + + private readonly string SystemEnclosureorChassisType; + + private readonly string BaseboardManufacturer; + private readonly string BaseboardProductName; + + private readonly string HardwareId1; + private readonly string HardwareId2; + private readonly string HardwareId3; + private readonly string HardwareId4; + private readonly string HardwareId5; + private readonly string HardwareId6; + private readonly string HardwareId7; + private readonly string HardwareId8; + private readonly string HardwareId9; + private readonly string HardwareId10; + private readonly string HardwareId11; + private readonly string HardwareId12; + private readonly string HardwareId13; + private readonly string HardwareId14; + private readonly string HardwareId15; + + public ComputerHardwareIDUnitTests() + { + BIOSVendor = "Microsoft Corporation"; + BIOSVersionString = "160.2002.235"; + SystemBIOSMajorRelease = "ff"; + SystemBIOSMinorRelease = "ff"; + + SystemManufacturer = "Microsoft Corporation"; + SystemFamily = "Surface"; + SystemProductName = "Microsoft Surface Pro, 11th Edition"; + SKUNumber = "Surface_Pro_11th_Edition_2076"; + + SystemEnclosureorChassisType = "9"; + + BaseboardManufacturer = "Microsoft Corporation"; + BaseboardProductName = "Microsoft Surface Pro, 11th Edition"; + + HardwareId1 = "{2a25cf22-7385-57f4-a540-83e187999901}"; + HardwareId2 = "{ca17c43e-840f-5ce5-8dfb-8b847cc3c9da}"; + HardwareId3 = "{83dfc1ca-dad7-5529-9805-3b4d4468b2a1}"; + HardwareId4 = "{aca467c0-5fc2-59ad-8ed5-1b7a0988d11c}"; + HardwareId5 = "{95971fb3-d478-591f-9ea3-eb0af0d1dfb5}"; + HardwareId6 = "{c9c14db9-2b61-597a-a4ba-84397fe75f63}"; + HardwareId7 = "{7cef06f5-e7e6-56d7-b123-a6d640a5d302}"; + HardwareId8 = "{48b86a5e-1955-5799-9577-150f9e1a69e4}"; + HardwareId9 = "{06128fee-87dc-50f6-8a3f-97cd9a6d8bf6}"; + HardwareId10 = "{84b2e1d1-e695-5f41-8c41-cf1f059c616a}"; + HardwareId11 = "{16a47337-1f8b-5bd3-b3bd-8e50b31cb1c9}"; + HardwareId12 = "{ca2e5189-1d32-509f-88a0-d4ebcc721899}"; + HardwareId13 = "{aca387a9-183e-5da9-8f9d-f460c3f50f54}"; + HardwareId14 = "{fdef4ae0-6bfb-5706-8aae-a565639505f5}"; + HardwareId15 = "{cc0aea32-ad2c-5013-8bed-cede6be8c9f4}"; + } + + [TestMethod] + public void Test_GenerateHardwareId1_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId1(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId1, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId2_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId2(SystemManufacturer, SystemFamily, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId2, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId3_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId3(SystemManufacturer, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId3, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId4_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId4(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId4, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId5_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId5(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber); + Assert.AreEqual(HardwareId5, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId6_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId6(SystemManufacturer, SystemFamily, SystemProductName); + Assert.AreEqual(HardwareId6, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId7_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId7(SystemManufacturer, SKUNumber, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId7, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId8_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId8(SystemManufacturer, SKUNumber); + Assert.AreEqual(HardwareId8, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId9_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId9(SystemManufacturer, SystemProductName, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId9, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId10_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId10(SystemManufacturer, SystemProductName); + Assert.AreEqual(HardwareId10, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId11_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId11(SystemManufacturer, SystemFamily, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId11, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId12_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId12(SystemManufacturer, SystemFamily); + Assert.AreEqual(HardwareId12, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId13_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId13(SystemManufacturer, SystemEnclosureorChassisType); + Assert.AreEqual(HardwareId13, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId14_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId14(SystemManufacturer, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId14, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId15_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId15(SystemManufacturer); + Assert.AreEqual(HardwareId15, GeneratedComputerHardwareID); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj new file mode 100644 index 00000000..49446e7d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + + + + + + + + + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs index c3b1b827..8de61ec9 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs @@ -1,12 +1,172 @@ using System; +using System.Collections.Generic; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { public class ComputerHardwareID { - public static string GenerateDeviceId(string Manufacturer, string Family, string Product, string Sku) + public static string GenerateHardwareId1(string Manufacturer, string Family, string ProductName, string SKUNumber, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) { - string inputString = Manufacturer + "&" + Family + "&" + Product + "&" + Sku; + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId2(string Manufacturer, string Family, string ProductName, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId3(string Manufacturer, string ProductName, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) + { + return GenerateHardwareId([Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId4(string Manufacturer, string Family, string ProductName, string SKUNumber, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId5(string Manufacturer, string Family, string ProductName, string SKUNumber) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber]); + } + + public static string GenerateHardwareId6(string Manufacturer, string Family, string ProductName) + { + return GenerateHardwareId([Manufacturer, Family, ProductName]); + } + + public static string GenerateHardwareId7(string Manufacturer, string SKUNumber, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId8(string Manufacturer, string SKUNumber) + { + return GenerateHardwareId([Manufacturer, SKUNumber]); + } + + public static string GenerateHardwareId9(string Manufacturer, string ProductName, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId10(string Manufacturer, string ProductName) + { + return GenerateHardwareId([Manufacturer, ProductName]); + } + + public static string GenerateHardwareId11(string Manufacturer, string Family, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, Family, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId12(string Manufacturer, string Family) + { + return GenerateHardwareId([Manufacturer, Family]); + } + + public static string GenerateHardwareId13(string Manufacturer, string EnclosureType) + { + return GenerateHardwareId([Manufacturer, EnclosureType]); + } + + public static string GenerateHardwareId14(string Manufacturer, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId15(string Manufacturer) + { + return GenerateHardwareId([Manufacturer]); + } + + public static string[] GenerateHardwareIds(string Manufacturer, string Family = null, string ProductName = null, string SKUNumber = null, string BIOSVendor = null, string BaseboardManufacturer = null, string BaseboardProduct = null, string EnclosureType = null, string BIOSVersion = null, string BIOSMajorRelease = null, string BIOSMinorRelease = null) + { + List HardwareIds = []; + + if (Manufacturer == null) + { + throw new Exception("At least a non null Manufacturer value is required"); + } + + if (Family != null && ProductName != null && SKUNumber != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId1(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (Family != null && ProductName != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId2(Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (ProductName != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId3(Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (Family != null && ProductName != null && SKUNumber != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId4(Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct)); + } + + if (Family != null && ProductName != null && SKUNumber != null) + { + HardwareIds.Add(GenerateHardwareId5(Manufacturer, Family, ProductName, SKUNumber)); + } + + if (Family != null && ProductName != null) + { + HardwareIds.Add(GenerateHardwareId6(Manufacturer, Family, ProductName)); + } + + if (SKUNumber != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId7(Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct)); + } + + if (SKUNumber != null) + { + HardwareIds.Add(GenerateHardwareId8(Manufacturer, SKUNumber)); + } + + if (ProductName != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId9(Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct)); + } + + if (ProductName != null) + { + HardwareIds.Add(GenerateHardwareId10(Manufacturer, ProductName)); + } + + if (Family != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId11(Manufacturer, Family, BaseboardManufacturer, BaseboardProduct)); + } + + if (Family != null) + { + HardwareIds.Add(GenerateHardwareId12(Manufacturer, Family)); + } + + if (EnclosureType != null) + { + HardwareIds.Add(GenerateHardwareId13(Manufacturer, EnclosureType)); + } + + if (BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId14(Manufacturer, BaseboardManufacturer, BaseboardProduct)); + } + + HardwareIds.Add(GenerateHardwareId15(Manufacturer)); + + return [.. HardwareIds]; + } + + public static string GenerateHardwareId(string[] BIOSFields) + { + string inputString = string.Join('&', BIOSFields); Guid guidFromString = ComputerHardwareIDProvider.Class5GuidFromString(inputString); string guidString = $"{{{guidFromString}}}"; return guidString; From b837c01c5c0a1101cd319b897ab0b05b3c289200 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 15:51:45 +0200 Subject: [PATCH 10/26] Add program to fetch CHIDs --- UUPMediaCreator.sln | 25 +++++- .../ComputerHardwareIds.Windows.csproj | 18 ++++ .../ComputerHardwareIds.Windows/Program.cs | 85 +++++++++++++++++++ 3 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj create mode 100644 src/Applications/ComputerHardwareIds.Windows/Program.cs diff --git a/UUPMediaCreator.sln b/UUPMediaCreator.sln index 502f572e..553bc695 100644 --- a/UUPMediaCreator.sln +++ b/UUPMediaCreator.sln @@ -49,7 +49,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Servi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Models", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Models\UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj", "{D78B2286-F75B-4FE6-990B-84117E722CD4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj", "{95007D84-20A1-4711-9CBC-DEE3B1798E74}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj", "{95007D84-20A1-4711-9CBC-DEE3B1798E74}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareIds.Windows", "src\Applications\ComputerHardwareIds.Windows\ComputerHardwareIds.Windows.csproj", "{7955FADE-628E-4E41-B48B-350EFB5418E7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -505,6 +507,26 @@ Global {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x64.Build.0 = Release|Any CPU {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.ActiveCfg = Release|Any CPU {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|ARM.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|arm64.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x64.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x64.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x86.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|Any CPU.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|ARM.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|ARM.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|arm64.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|arm64.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x64.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x64.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x86.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -532,6 +554,7 @@ Global {E5A8D8A2-6219-4632-84EC-8F8BF625A596} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {D78B2286-F75B-4FE6-990B-84117E722CD4} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {95007D84-20A1-4711-9CBC-DEE3B1798E74} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {7955FADE-628E-4E41-B48B-350EFB5418E7} = {C4A7DBD6-6FB5-410A-9252-922C7909C82C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FEE89471-4FE8-4620-991F-4EBAD0F4CFEA} diff --git a/src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj b/src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj new file mode 100644 index 00000000..b8202d58 --- /dev/null +++ b/src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0-windows10.0.22621 + enable + enable + + + + + + + + + + + diff --git a/src/Applications/ComputerHardwareIds.Windows/Program.cs b/src/Applications/ComputerHardwareIds.Windows/Program.cs new file mode 100644 index 00000000..356735b7 --- /dev/null +++ b/src/Applications/ComputerHardwareIds.Windows/Program.cs @@ -0,0 +1,85 @@ +using Microsoft.Management.Infrastructure.Options; +using Microsoft.Management.Infrastructure; +using System.Diagnostics; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace Playground +{ + internal class Program + { + public static async Task Main(string[] args) + { + Process currentProcess = Process.GetCurrentProcess(); + ProcessModule MainModule = currentProcess.MainModule!; + + using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); + using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + + CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); + + string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; + byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; + byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); + + string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; + string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; + string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); + + ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); + + string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + + Console.WriteLine("Using the BIOS to gather information"); + Console.WriteLine(); + Console.WriteLine("Tool Information"); + Console.WriteLine("----------------"); + Console.WriteLine($"{Path.GetFileName(MainModule.FileName)} version: {MainModule.FileVersionInfo.FileVersion}"); + Console.WriteLine(); + Console.WriteLine(); + Console.WriteLine("Computer Information"); + Console.WriteLine("--------------------"); + Console.WriteLine($"BIOS Vendor: {BIOSVendor}"); + Console.WriteLine($"BIOS Version String: {BIOSVersionString}"); + Console.WriteLine($"System BIOS Major Release: {SystemBIOSMajorRelease}"); + Console.WriteLine($"System BIOS Minor Release: {SystemBIOSMinorRelease}"); + Console.WriteLine(); + Console.WriteLine($"System Manufacturer: {SystemManufacturer}"); + Console.WriteLine($"System Family: {SystemFamily}"); + Console.WriteLine($"System Product Name: {SystemProductName}"); + Console.WriteLine($"SKU Number: {SKUNumber}"); + Console.WriteLine(); + Console.WriteLine($"System Enclosure or Chassis Type: {SystemEnclosureorChassisType:X2}h"); + Console.WriteLine(); + Console.WriteLine($"Baseboard Manufacturer: {BaseboardManufacturer}"); + Console.WriteLine($"Baseboard Product Name: {BaseboardProductName}"); + Console.WriteLine(); + Console.WriteLine(); + Console.WriteLine("Hardware IDs"); + Console.WriteLine("------------"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId1(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + Family + ProductName + SKUNumber + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId2(SystemManufacturer, SystemFamily, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + Family + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId3(SystemManufacturer, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId4(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Family + ProductName + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId5(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber)} <- Manufacturer + Family + ProductName + SKUNumber"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId6(SystemManufacturer, SystemFamily, SystemProductName)} <- Manufacturer + Family + ProductName"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId7(SystemManufacturer, SKUNumber, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId8(SystemManufacturer, SKUNumber)} <- Manufacturer + SKUNumber"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId9(SystemManufacturer, SystemProductName, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + ProductName + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId10(SystemManufacturer, SystemProductName)} <- Manufacturer + ProductName"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId11(SystemManufacturer, SystemFamily, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Family + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId12(SystemManufacturer, SystemFamily)} <- Manufacturer + Family"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId13(SystemManufacturer, SystemEnclosureorChassisType.ToString())} <- Manufacturer + Enclosure Type"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId14(SystemManufacturer, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId15(SystemManufacturer)} <- Manufacturer"); + } + } +} \ No newline at end of file From 53a76856eea59dc78241e5b9ec7d7ca9b010d25f Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 15:54:07 +0200 Subject: [PATCH 11/26] Cleanup CHID Program main class --- src/Applications/ComputerHardwareIds.Windows/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Applications/ComputerHardwareIds.Windows/Program.cs b/src/Applications/ComputerHardwareIds.Windows/Program.cs index 356735b7..e2913308 100644 --- a/src/Applications/ComputerHardwareIds.Windows/Program.cs +++ b/src/Applications/ComputerHardwareIds.Windows/Program.cs @@ -3,11 +3,11 @@ using System.Diagnostics; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -namespace Playground +namespace ComputerHardwareIds { internal class Program { - public static async Task Main(string[] args) + public static void Main(string[] _) { Process currentProcess = Process.GetCurrentProcess(); ProcessModule MainModule = currentProcess.MainModule!; From 5bc3ae07ba73e9cfb6e5e8865a7c401ec38eb00a Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 16:20:57 +0200 Subject: [PATCH 12/26] Move option classes to a specific namespace --- src/Applications/UUPDownload/DownloadRequest/Process.cs | 1 + .../UUPDownload/{ => Options}/DownloadReplayOptions.cs | 2 +- .../UUPDownload/{ => Options}/DownloadRequestOptions.cs | 2 +- src/Applications/UUPDownload/{ => Options}/GetBuildsOptions.cs | 2 +- src/Applications/UUPDownload/Program.cs | 1 + src/Applications/UUPDownload/RingCheck.cs | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) rename src/Applications/UUPDownload/{ => Options}/DownloadReplayOptions.cs (99%) rename src/Applications/UUPDownload/{ => Options}/DownloadRequestOptions.cs (99%) rename src/Applications/UUPDownload/{ => Options}/GetBuildsOptions.cs (98%) diff --git a/src/Applications/UUPDownload/DownloadRequest/Process.cs b/src/Applications/UUPDownload/DownloadRequest/Process.cs index 7ffb001e..593df6f8 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Process.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Process.cs @@ -31,6 +31,7 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; using UUPDownload.Downloading; namespace UUPDownload.DownloadRequest diff --git a/src/Applications/UUPDownload/DownloadReplayOptions.cs b/src/Applications/UUPDownload/Options/DownloadReplayOptions.cs similarity index 99% rename from src/Applications/UUPDownload/DownloadReplayOptions.cs rename to src/Applications/UUPDownload/Options/DownloadReplayOptions.cs index a059f5d1..9ab4ef33 100644 --- a/src/Applications/UUPDownload/DownloadReplayOptions.cs +++ b/src/Applications/UUPDownload/Options/DownloadReplayOptions.cs @@ -22,7 +22,7 @@ using CommandLine; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -namespace UUPDownload +namespace UUPDownload.Options { [Verb("replay-download", isDefault: false, HelpText = "Replay a download from zero using a *.uupmcreplay file.")] internal class DownloadReplayOptions diff --git a/src/Applications/UUPDownload/DownloadRequestOptions.cs b/src/Applications/UUPDownload/Options/DownloadRequestOptions.cs similarity index 99% rename from src/Applications/UUPDownload/DownloadRequestOptions.cs rename to src/Applications/UUPDownload/Options/DownloadRequestOptions.cs index 636e71f9..390a93b4 100644 --- a/src/Applications/UUPDownload/DownloadRequestOptions.cs +++ b/src/Applications/UUPDownload/Options/DownloadRequestOptions.cs @@ -22,7 +22,7 @@ using CommandLine; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -namespace UUPDownload +namespace UUPDownload.Options { [Verb("request-download", isDefault: true, HelpText = "Request a download from zero using a number of different request parameters.")] internal class DownloadRequestOptions diff --git a/src/Applications/UUPDownload/GetBuildsOptions.cs b/src/Applications/UUPDownload/Options/GetBuildsOptions.cs similarity index 98% rename from src/Applications/UUPDownload/GetBuildsOptions.cs rename to src/Applications/UUPDownload/Options/GetBuildsOptions.cs index 7bfc2e69..d35f25c3 100644 --- a/src/Applications/UUPDownload/GetBuildsOptions.cs +++ b/src/Applications/UUPDownload/Options/GetBuildsOptions.cs @@ -22,7 +22,7 @@ using CommandLine; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -namespace UUPDownload +namespace UUPDownload.Options { [Verb("get-builds", isDefault: false, HelpText = "Get builds in all rings matching the request type")] internal class GetBuildsOptions diff --git a/src/Applications/UUPDownload/Program.cs b/src/Applications/UUPDownload/Program.cs index 898daa8f..3aee7952 100644 --- a/src/Applications/UUPDownload/Program.cs +++ b/src/Applications/UUPDownload/Program.cs @@ -24,6 +24,7 @@ using System.Diagnostics; using System.Net; using System.Reflection; +using UUPDownload.Options; namespace UUPDownload { diff --git a/src/Applications/UUPDownload/RingCheck.cs b/src/Applications/UUPDownload/RingCheck.cs index c9f1e611..975c06b5 100644 --- a/src/Applications/UUPDownload/RingCheck.cs +++ b/src/Applications/UUPDownload/RingCheck.cs @@ -25,6 +25,7 @@ using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; namespace UUPDownload { From 19c376c5bad2a9373909f68dbfbec5b9c5329145 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 17:11:38 +0200 Subject: [PATCH 13/26] Enable file names for driver packages --- .../UUPDownload/Downloading/ReportProgress.cs | 2 +- .../Constants.cs | 6 +- .../DownloadHelpers.cs | 93 +++++++++++++------ .../FE3/SOAP/Common/Security.cs | 5 +- .../SOAP/Common/WindowsUpdateTicketsToken.cs | 5 +- .../ComputerHardwareIDProvider.cs | 2 +- .../Microsoft.Dism/DismApi.AddCapability.cs | 2 +- .../DismApi.AddProvisionedAppxPackage.cs | 6 +- .../Microsoft.Dism/DismApi.EnableFeature.cs | 2 +- .../DismApi.RestoreImageHealth.cs | 2 +- 10 files changed, 79 insertions(+), 46 deletions(-) diff --git a/src/Applications/UUPDownload/Downloading/ReportProgress.cs b/src/Applications/UUPDownload/Downloading/ReportProgress.cs index 76dedb4c..3a8a5f43 100644 --- a/src/Applications/UUPDownload/Downloading/ReportProgress.cs +++ b/src/Applications/UUPDownload/Downloading/ReportProgress.cs @@ -34,7 +34,7 @@ public class ReportProgress : IProgress, IDisposable private static string FormatBytes(double bytes) { - string[] suffix = { "B", "KB", "MB", "GB", "TB" }; + string[] suffix = ["B", "KB", "MB", "GB", "TB"]; int i; double dblSByte = bytes; for (i = 0; i < suffix.Length && bytes >= 1024; i++, bytes /= 1024) diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs b/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs index 20f62bd5..f17bfabc 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs @@ -28,8 +28,8 @@ public static class Constants { internal static readonly IImaging imagingInterface = new WimLibImaging(); - internal static byte[] winpejpg = new byte[] - { + internal static byte[] winpejpg = + [ 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, @@ -111,7 +111,7 @@ public static class Constants 0xBE, 0x8A, 0x28, 0xAF, 0xEB, 0x03, 0xF8, 0xAC, 0x28, 0xA2, 0x8A, 0x00, 0x28, 0xA2, 0x8A, 0x00, 0x28, 0xA2, 0x8A, 0x00, 0xFF, 0xD9 - }; + ]; internal static string SOFTWARE_Hive_Location = Path.Combine("Windows", "System32", "config", "SOFTWARE"); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index 88518b3c..a23a2d55 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -35,20 +35,72 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { public static partial class UpdateUtils { - public static string[] GetFilenameForCEUIFile(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) + public static string[] GetFilenameForCEUIFile(Models.FE3.XML.ExtendedUpdateInfo.File extendedUpdateInfoFile, IEnumerable payloadItems) { - string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); - if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) + string filename = extendedUpdateInfoFile.FileName.Replace('\\', Path.DirectorySeparatorChar); + + if (payloadItems.Any(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest)) { - IEnumerable payloads = payloadItems.Where(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); + IEnumerable payloads = payloadItems.Where(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest); return payloads.Select(p => p.Path.Replace('\\', Path.DirectorySeparatorChar)).ToArray(); } else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith("_") && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) { filename = filename[..filename.IndexOf('_')] + Path.DirectorySeparatorChar + filename[(filename.IndexOf('_') + 1)..]; - return new string[] { filename.TrimStart(Path.DirectorySeparatorChar) }; + return [filename.TrimStart(Path.DirectorySeparatorChar)]; } - return new string[] { filename }; + + return [filename]; + } + + public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile, HashSet pathList, HashSet compDBs, string path) + { + string newPath = path; + + try + { + foreach (BaseManifest compDb in compDBs) + { + foreach (Package pkg in compDb.Packages.Package) + { + string payloadHash = pkg.Payload.PayloadItem[0].PayloadHash; + if (payloadHash == boundFile.Item1.AdditionalDigest.Text || payloadHash == boundFile.Item1.Digest) + { + if (pkg.ID.Contains('-') && pkg.ID.Contains(".inf", StringComparison.InvariantCultureIgnoreCase)) + { + newPath = pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase); + } + break; + } + } + } + } + catch { } + + if (!pathList.Add(newPath.ToLower())) + { + string basePath, suffix; + + if (Path.HasExtension(newPath)) + { + basePath = Path.Combine(Path.GetDirectoryName(newPath), Path.GetFileNameWithoutExtension(newPath)); + suffix = Path.GetExtension(newPath); + } + else + { + basePath = Path.Combine(Path.GetDirectoryName(newPath), Path.GetFileName(newPath)); + suffix = ""; + } + + uint i = 1; + + while (!pathList.Add(newPath.ToLower())) + { + newPath = $"{basePath} ({i++}){suffix}"; + } + } + + return newPath; } public static bool ShouldFileGetDownloaded(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) @@ -540,33 +592,16 @@ await Task.WhenAll( //.Where(x => UpdateUtils.ShouldFileGetDownloaded(x.x, payloadItems)) .OrderBy(x => x.Item2.ExpirationDate); - IEnumerable fileList = boundList.SelectMany(boundFile => + List fileList = []; + HashSet pathList = []; + + foreach ((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile in boundList) { return GetFilenameForCEUIFile(boundFile.Item1, payloadItems).Select(path => { - /*try - { - foreach (BaseManifest compDb in compDBs) - { - foreach (Package pkg in compDb.Packages.Package) - { - string payloadHash = pkg.Payload.PayloadItem[0].PayloadHash; - if (payloadHash == boundFile.Item1.AdditionalDigest.Text || payloadHash == boundFile.Item1.Digest) - { - if (pkg.ID.Contains('-') && pkg.ID.Contains(".inf", StringComparison.InvariantCultureIgnoreCase)) - { - path = pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase); - } - break; - } - } - } - } - catch { }*/ - - return new UUPFile( + fileList.Add(new UUPFile( boundFile.Item2, - path, + FixFilePath(boundFile, pathList, compDBs, path), long.Parse(boundFile.Item1.Size), boundFile.Item1.AdditionalDigest.Text, boundFile.Item1.AdditionalDigest.Algorithm); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs index f39813b5..559e7603 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs @@ -29,10 +29,9 @@ public class Security { [XmlNamespaceDeclarations] public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { + [ new("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") - } + ] ); [XmlElement(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs index 81c2c801..07f09c9e 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs @@ -29,11 +29,10 @@ public class WindowsUpdateTicketsToken { [XmlNamespaceDeclarations] public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { + [ new("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"), new("wuws", Constants.WindowsUpdateAuthorizationSchema) - } + ] ); [XmlElement(ElementName = "TicketType", Namespace = "")] diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs index 9662696b..0a0f3f83 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs @@ -6,7 +6,7 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { public static class ComputerHardwareIDProvider { - private static readonly byte[] hardwareIDIv = { 0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + private static readonly byte[] hardwareIDIv = [0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; public static Guid Class5GuidFromString(string input) { diff --git a/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs b/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs index c86a8f00..4593151f 100644 --- a/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs +++ b/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs @@ -53,7 +53,7 @@ public static void AddCapability(DismSession session, string capabilityName, boo public static void AddCapability(DismSession session, string capabilityName, bool limitAccess, List? sourcePaths, Microsoft.Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); diff --git a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs index 98ca7a52..d2f46276 100644 --- a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs +++ b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs @@ -94,11 +94,11 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath int hresult = NativeMethods._DismAddProvisionedAppxPackage( session, appPath, - dependencyPackages?.ToArray() ?? new string[0], + dependencyPackages?.ToArray() ?? [], (uint)(dependencyPackages?.Count ?? 0), - optionalPackages?.ToArray() ?? new string[0], + optionalPackages?.ToArray() ?? [], (uint)(optionalPackages?.Count ?? 0), - licensePaths?.ToArray() ?? new string[0], + licensePaths?.ToArray() ?? [], (uint)(licensePaths?.Count ?? 0), SkipLicense: licensePaths == null || licensePaths.Count == 0, customDataPath, diff --git a/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs b/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs index ca76d46e..95dbf49d 100644 --- a/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs +++ b/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs @@ -221,7 +221,7 @@ public static void EnableFeature(DismSession session, string featureName, bool l private static void EnableFeature(DismSession session, string featureName, string? identifier, DismPackageIdentifier packageIdentifier, bool limitAccess, bool enableAll, List? sourcePaths, Microsoft.Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); diff --git a/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs b/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs index a9514806..57c06021 100644 --- a/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs +++ b/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs @@ -65,7 +65,7 @@ public static void RestoreImageHealth(DismSession session, bool limitAccess, Lis public static void RestoreImageHealth(DismSession session, bool limitAccess, List? sourcePaths, Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); From 0ae4dddf111ecc1be5a52001baa0ffa41b5803b3 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 17:14:57 +0200 Subject: [PATCH 14/26] fixes --- .../DownloadHelpers.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index a23a2d55..23e6db54 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -592,21 +592,22 @@ await Task.WhenAll( //.Where(x => UpdateUtils.ShouldFileGetDownloaded(x.x, payloadItems)) .OrderBy(x => x.Item2.ExpirationDate); - List fileList = []; - HashSet pathList = []; + List fileList = new(); + HashSet pathList = new(); foreach ((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile in boundList) { - return GetFilenameForCEUIFile(boundFile.Item1, payloadItems).Select(path => + string[] paths = GetFilenameForCEUIFile(boundFile.Item1, payloadItems); + foreach (string path in paths) { fileList.Add(new UUPFile( boundFile.Item2, FixFilePath(boundFile, pathList, compDBs, path), long.Parse(boundFile.Item1.Size), boundFile.Item1.AdditionalDigest.Text, - boundFile.Item1.AdditionalDigest.Algorithm); - }); - }); + boundFile.Item1.AdditionalDigest.Algorithm)); + } + } returnCode = await helperDl.DownloadAsync(fileList.ToList(), generalDownloadProgress) ? 0 : -1; From dca3d0d086f00749dae2bc38f4070d55f13d929b Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 17:31:52 +0200 Subject: [PATCH 15/26] fix: file duplication issue with osupdates --- .../Applications/AppxSelectionEngine.cs | 4 ++-- .../ConversionPlanBuilder.cs | 6 ++--- .../DownloadHelpers.cs | 22 ++++++++++++------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/CompDB/Applications/AppxSelectionEngine.cs b/src/CompDB/Applications/AppxSelectionEngine.cs index 6d10a151..0956856a 100644 --- a/src/CompDB/Applications/AppxSelectionEngine.cs +++ b/src/CompDB/Applications/AppxSelectionEngine.cs @@ -223,7 +223,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(BaseManifest ed DeploymentProperties dependProps = preinstalledApps[dependency]; dependencies.Add(packageHashDict[dependProps.MainPackageID].Path); } - workload.DependenciesPath = dependencies.ToArray(); + workload.DependenciesPath = [.. dependencies]; } if (deployProps.HasLicense) @@ -239,7 +239,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(BaseManifest ed workloads.Add(workload); } - return workloads.ToArray(); + return [.. workloads]; } private static readonly Dictionary languageMap = new() diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs index 7b98653b..7390de10 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs @@ -155,7 +155,7 @@ ref List editionsAdded // // Sort editions by name // - target.NonDestructiveTargets = target.NonDestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName).ToList(); + target.NonDestructiveTargets = [.. target.NonDestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName)]; // // Handle editions that we can upgrade to using a full upgrade process @@ -269,7 +269,7 @@ ref List editionsAdded } } - target.DestructiveTargets = target.DestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName).ToList(); + target.DestructiveTargets = [.. target.DestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName)]; return target; } @@ -576,7 +576,7 @@ public static bool GetTargetedPlan( !string.IsNullOrEmpty(x.Virtual) && x.Virtual.Equals("true", StringComparison.InvariantCultureIgnoreCase)).OrderBy(x => x.ParentEdition); - virtualWindowsEditions = virtualeditions.ToList(); + virtualWindowsEditions = [.. virtualeditions]; } catch { } } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index 23e6db54..e15df716 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -42,7 +42,7 @@ public static string[] GetFilenameForCEUIFile(Models.FE3.XML.ExtendedUpdateInfo. if (payloadItems.Any(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest)) { IEnumerable payloads = payloadItems.Where(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest); - return payloads.Select(p => p.Path.Replace('\\', Path.DirectorySeparatorChar)).ToArray(); + return payloads.Select(p => p.Path.Replace('\\', Path.DirectorySeparatorChar)).DistinctBy(x => x.ToLower()).ToArray(); } else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith("_") && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) { @@ -79,6 +79,8 @@ public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileEx if (!pathList.Add(newPath.ToLower())) { + throw new Exception("WHAT"); + string basePath, suffix; if (Path.HasExtension(newPath)) @@ -94,10 +96,11 @@ public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileEx uint i = 1; - while (!pathList.Add(newPath.ToLower())) + do { newPath = $"{basePath} ({i++}){suffix}"; } + while (!pathList.Add(newPath.ToLower())); } return newPath; @@ -563,6 +566,8 @@ await Task.WhenAll( (HashSet payloadItems, HashSet bannedPayloadItems) = BuildListOfPayloads(compDBs, Edition, Language); + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions() { WriteIndented = true, IncludeFields = true }; + do { IEnumerable fileUrls = await FE3Handler.GetFileUrls(update) ?? throw new Exception("Getting file urls failed."); @@ -571,18 +576,19 @@ await Task.WhenAll( _ = Directory.CreateDirectory(OutputFolder); } - string tmpname = update.Xml.LocalizedProperties.Title + " (" + MachineType.ToString() + ").uupmcreplay"; + string tmpname = $"{update.Xml.LocalizedProperties.Title} ({MachineType}).uupmcreplay"; illegalCharacters = invalidCharactersRegex(); tmpname = illegalCharacters.Replace(tmpname, ""); string filename = Path.Combine(OutputFolder, tmpname); if (WriteMetadata && !File.Exists(filename)) { - File.WriteAllText(filename, JsonSerializer.Serialize(update, new JsonSerializerOptions() { WriteIndented = true, IncludeFields = true })); + File.WriteAllText(filename, JsonSerializer.Serialize(update, jsonSerializerOptions)); } using HttpDownloader helperDl = new(OutputFolder, downloadThreads); - filesToDownload = update.Xml.Files.File.AsParallel().Where(x => !IsFileBanned(x, bannedPayloadItems)); + + filesToDownload = update.Xml.Files.File.DistinctBy(x => $"{x.Digest}|{x.DigestAlgorithm}|{x.AdditionalDigest.Algorithm}|{x.AdditionalDigest.Text}").AsParallel().Where(x => !IsFileBanned(x, bannedPayloadItems)); returnCode = 0; @@ -592,8 +598,8 @@ await Task.WhenAll( //.Where(x => UpdateUtils.ShouldFileGetDownloaded(x.x, payloadItems)) .OrderBy(x => x.Item2.ExpirationDate); - List fileList = new(); - HashSet pathList = new(); + List fileList = []; + HashSet pathList = []; foreach ((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile in boundList) { @@ -609,7 +615,7 @@ await Task.WhenAll( } } - returnCode = await helperDl.DownloadAsync(fileList.ToList(), generalDownloadProgress) ? 0 : -1; + returnCode = await helperDl.DownloadAsync([.. fileList], generalDownloadProgress) ? 0 : -1; if (returnCode != 0) { From eb30ac0b502199c1083356a62c0b246eb92e8e2b Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 17:33:49 +0200 Subject: [PATCH 16/26] Split off separate files in download lib --- .../FileDownloadStatus.cs | 36 ++++++++++ .../FileStatus.cs | 33 +++++++++ .../GeneralDownloadProgress.cs | 35 ++++++++++ .../HttpDownloader.cs | 67 +------------------ .../UUPFile.cs | 57 ++++++++++++++++ 5 files changed, 162 insertions(+), 66 deletions(-) create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs create mode 100644 src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs new file mode 100644 index 00000000..4d9eb288 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class FileDownloadStatus + { + public FileStatus FileStatus; + public long DownloadedBytes; + public long HashedBytes; + public UUPFile File; + public FileDownloadStatus(UUPFile file) + { + File = file; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs new file mode 100644 index 00000000..e9660d7b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs @@ -0,0 +1,33 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public enum FileStatus + { + Downloading, + Verifying, + Completed, + Expired, + Failed + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs new file mode 100644 index 00000000..76ed6d55 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs @@ -0,0 +1,35 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class GeneralDownloadProgress + { + public long EstimatedTotalBytes; + public long DownloadedTotalBytes; + public int NumFilesDownloadedSuccessfully; + public int NumFilesDownloadedUnsuccessfully; + public int NumFiles; + + public FileDownloadStatus[] DownloadedStatus; + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs index 7ae340f8..c2d8072c 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs @@ -35,71 +35,6 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { - public class GeneralDownloadProgress - { - public long EstimatedTotalBytes; - public long DownloadedTotalBytes; - public int NumFilesDownloadedSuccessfully; - public int NumFilesDownloadedUnsuccessfully; - public int NumFiles; - - public FileDownloadStatus[] DownloadedStatus; - } - - public enum FileStatus - { - Downloading, - Verifying, - Completed, - Expired, - Failed - } - - public class FileDownloadStatus - { - public FileStatus FileStatus; - public long DownloadedBytes; - public long HashedBytes; - public UUPFile File; - public FileDownloadStatus(UUPFile file) - { - File = file; - } - } - - public class UUPFile - { - public FileExchangeV3FileDownloadInformation WUFile - { - get; set; - } - public string FileName - { - get; set; - } - public long FileSize - { - get; set; - } - public string Hash - { - get; set; - } - public string HashAlgorithm - { - get; set; - } - - public UUPFile(FileExchangeV3FileDownloadInformation WUFile, string FileName, long FileSize, string Hash, string HashAlgorithm) - { - this.WUFile = WUFile; - this.FileName = FileName; - this.FileSize = FileSize; - this.Hash = Hash; - this.HashAlgorithm = HashAlgorithm; - } - } - public class HttpDownloader : IDisposable { private const long CHUNK_SIZE = 8_388_608 + 65_536; //Slice 8MB+64KB @@ -706,4 +641,4 @@ public void Dispose() GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs new file mode 100644 index 00000000..5e3cb4c7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs @@ -0,0 +1,57 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class UUPFile + { + public FileExchangeV3FileDownloadInformation WUFile + { + get; set; + } + public string FileName + { + get; set; + } + public long FileSize + { + get; set; + } + public string Hash + { + get; set; + } + public string HashAlgorithm + { + get; set; + } + + public UUPFile(FileExchangeV3FileDownloadInformation WUFile, string FileName, long FileSize, string Hash, string HashAlgorithm) + { + this.WUFile = WUFile; + this.FileName = FileName; + this.FileSize = FileSize; + this.Hash = Hash; + this.HashAlgorithm = HashAlgorithm; + } + } +} From 5035e9465b97ebe773102b7f3939d5b2352eadd6 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 18:30:12 +0200 Subject: [PATCH 17/26] Enable BSP downloads --- .../DownloadRequest/Drivers/DriverPlan.cs | 59 +++++ .../ProcessDrivers.GenerateChangelog.cs | 127 +++++++++ .../DownloadRequest/Drivers/ProcessDrivers.cs | 245 +++++++++++++++++ .../UUPDownload/DriverConfig.json | 176 +++++++++++++ .../Options/BSPDownloadRequestOptions.cs | 120 +++++++++ src/Applications/UUPDownload/Program.cs | 7 +- .../UUPDownload/UUPDownload.csproj | 8 + .../DownloadHelpers.cs | 19 +- .../CTAC.cs | 248 +++++++++++------- 9 files changed, 910 insertions(+), 99 deletions(-) create mode 100644 src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs create mode 100644 src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs create mode 100644 src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs create mode 100644 src/Applications/UUPDownload/DriverConfig.json create mode 100644 src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs new file mode 100644 index 00000000..b249c1a0 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs @@ -0,0 +1,59 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UUPDownload.DownloadRequest.Drivers +{ + public class DriverPlan + { + public string outputFolder + { + get; set; + } + public string guid + { + get; set; + } + public int[] filteredIds + { + get; set; + } + public int[] excludedIds + { + get; set; + } + public string Manufacturer + { + get; set; + } + public string Family + { + get; set; + } + public string Product + { + get; set; + } + public string Sku + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs new file mode 100644 index 00000000..d0a80f38 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; + +namespace UUPDownload.DownloadRequest +{ + public partial class ProcessDrivers + { + private static async Task GenerateChangelog(UpdateData update, string changelogOutput, int i, BaseManifest pevCompDB) + { + File.AppendAllLines(changelogOutput, ["", $"## {update.Xml.LocalizedProperties.Title} - 200.0.{i}.0"]); + + HashSet compDBs = await update.GetCompDBsAsync(); + BaseManifest curCompDB = compDBs.First(); + + List added = []; + List updated = []; + List removed = []; + List modified = []; + + if (pevCompDB != null) + { + IEnumerable prevPackageList = pevCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + IEnumerable curPackageList = curCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + + foreach (string pkg in prevPackageList) + { + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInNewer = curPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!existsInNewer) + { + removed.Add(pkg); + } + } + + foreach (Package package in curCompDB.Packages.Package) + { + string pkg = $"| {package.Version} | {package.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"; + + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInOlder = prevPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (existsInOlder) + { + bool hasSameVersion = prevPackageList.Any(x => version.Equals(x.Split("|")[1], StringComparison.InvariantCultureIgnoreCase) && id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!hasSameVersion) + { + updated.Add(pkg); + } + else + { + bool hasSameHash = pevCompDB.Packages.Package.Any(x => x.Payload.PayloadItem[0].PayloadHash == package.Payload.PayloadItem[0].PayloadHash); + if (!hasSameHash) + { + modified.Add(pkg); + } + } + } + else + { + added.Add(pkg); + } + } + } + else + { + foreach (Package pkg in curCompDB.Packages.Package) + { + added.Add($"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.CurrentCultureIgnoreCase)} |"); + } + } + + added.Sort(); + updated.Sort(); + modified.Sort(); + removed.Sort(); + + if (added.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Added", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, added); + } + + + if (updated.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Updated", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, updated); + } + + + if (modified.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Modified", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, modified); + } + + + if (removed.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Removed", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, removed); + } + + return curCompDB; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs new file mode 100644 index 00000000..4211f877 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -0,0 +1,245 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; +using UUPDownload.Downloading; +using UUPDownload.DownloadRequest.Drivers; + +namespace UUPDownload.DownloadRequest +{ + public partial class ProcessDrivers + { + internal static void ParseDownloadOptions(BSPDownloadRequestOptions opts) + { + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.Language, + opts.Edition).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string Language, + string Edition) + { + if (!File.Exists("DriverConfig.json")) + { + Logging.Log("Driver Configuration file (DriverConfig.json) could not be found in the current working directory.", Logging.LoggingLevel.Error); + return; + } + + DriverPlan[] plans = System.Text.Json.JsonSerializer.Deserialize(File.ReadAllText("DriverConfig.json")); + + foreach (DriverPlan plan in plans) + { + Logging.Log(plan.outputFolder); + await ProcessDriverPlan(plan, ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType, Mail, Password, Language, Edition, OutputFolder); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + + private static async Task ProcessDriverPlan(DriverPlan DriverPlan, + OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string Language, + string Edition, + string RepoLocation) + { + BaseManifest previousCompositionDatabase = null; + + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, false, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string ProductGUID = DriverPlan.guid; + if (string.IsNullOrEmpty(ProductGUID)) + { + ProductGUID = ComputerHardwareID.GenerateHardwareId5(DriverPlan.Manufacturer, DriverPlan.Family, DriverPlan.Product, DriverPlan.Sku); + } + + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=0.0.0.0&Source=SMBIOS;"; + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = (RepoLocation + DriverPlan.outputFolder).Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + string newestDriverVersion = "0.0.0.0"; + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + newestDriverVersion = compDBs.First().UUPProductVersion; + } + + if (SyncCurrentVersionOnly) + { + foreach (UpdateData update in NewestDriverProductUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress(), Language: Language, Edition: Edition); + } + } + else + { + string newestDriverOutput = $"{outputFolder}{Path.DirectorySeparatorChar}{newestDriverVersion}"; + if (Directory.Exists(newestDriverOutput) && Directory.EnumerateFiles(newestDriverOutput).Any()) + { + return; + } + + string changelogOutput = $"{outputFolder}{Path.DirectorySeparatorChar}CHANGELOG.md"; + + if (File.Exists(changelogOutput)) + { + File.Delete(changelogOutput); + } + + int newestDriverBuildNumber = int.Parse(newestDriverVersion.Split(".")[2]); + + for (int driverBuildNumber = 0; driverBuildNumber <= newestDriverBuildNumber; driverBuildNumber++) + { + if (DriverPlan.filteredIds.Length != 0 && !DriverPlan.filteredIds.Contains(driverBuildNumber)) + { + continue; + } + + if (DriverPlan.excludedIds.Length != 0 && DriverPlan.excludedIds.Contains(driverBuildNumber)) + { + continue; + } + + CTAC PreciseDriverProductVersionCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + + PreciseDriverProductVersionCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=200.0.{driverBuildNumber}.0&Source=SMBIOS;"; + PreciseDriverProductVersionCTAC.SyncCurrentVersionOnly = true; + + Logging.Log($"Checking for updates... 200.0.{driverBuildNumber}.0 / {newestDriverVersion}"); + IEnumerable PreciseDriverProductVersionUpdateData = await FE3Handler.GetUpdates(null, PreciseDriverProductVersionCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + if (!PreciseDriverProductVersionUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + } + else + { + foreach (UpdateData update in PreciseDriverProductVersionUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + string fwOutput = $"{outputFolder}{Path.DirectorySeparatorChar}200.0.{driverBuildNumber}.0"; + if (!Directory.Exists(fwOutput) || !Directory.EnumerateFiles(fwOutput).Any()) + { + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, fwOutput, MachineType, new ReportProgress(), Language, Edition, false, false); + } + + previousCompositionDatabase = await GenerateChangelog(update, changelogOutput, driverBuildNumber, previousCompositionDatabase); + } + } + } + } + } + } +} diff --git a/src/Applications/UUPDownload/DriverConfig.json b/src/Applications/UUPDownload/DriverConfig.json new file mode 100644 index 00000000..bbf7a786 --- /dev/null +++ b/src/Applications/UUPDownload/DriverConfig.json @@ -0,0 +1,176 @@ +[ + { + "outputFolder": "\\1000_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SDM1000", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7180_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [ + 1, + 9, + 10 + ], + "Manufacturer": "Qualcomm", + "Family": "SC7180", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7280_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC_KODIAK", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7280_WINDOWS_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC_KODIAK_WINDOWS", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\8180_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC8180X", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\8280_QRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_MAKENA", + "Product": "QRD", + "Sku": "6" + }, + { + "outputFolder": "\\8380_CRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_HAMOA", + "Product": "CRD", + "Sku": "6" + }, + { + "outputFolder": "\\8380PA_CRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_PURWA", + "Product": "CRD", + "Sku": "6" + }, + { + "outputFolder": "\\Surface\\8180_CAM", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_1876" + }, + { + "outputFolder": "\\Surface\\8180_CAR", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_H_1876" + }, + { + "outputFolder": "\\Surface\\8180_CAS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_2010" + }, + { + "outputFolder": "\\Surface\\8280_ARC_1996", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro 9", + "Sku": "Surface_Pro_9_With_5G_1996" + }, + { + "outputFolder": "\\Surface\\8280_ARC_1997", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro 9", + "Sku": "Surface_Pro_9_With_5G_1997" + }, + { + "outputFolder": "\\Surface\\8280_BLK", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Windows Dev Kit 2023", + "Sku": "2043" + }, + { + "outputFolder": "\\Surface\\8380_ROM_2036", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Laptop, 7th Edition", + "Sku": "Surface_Laptop_7th_Edition_2036" + }, + { + "outputFolder": "\\Surface\\8380_ROM_2037", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Laptop, 7th Edition", + "Sku": "Surface_Laptop_7th_Edition_2037" + }, + { + "outputFolder": "\\Surface\\8380_DEN", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Pro, 11th Edition", + "Sku": "Surface_Pro_11th_Edition_2076" + } +] \ No newline at end of file diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs new file mode 100644 index 00000000..861405e6 --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs @@ -0,0 +1,120 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] + public string Edition + { + get; set; + } + + [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] + public string Language + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Program.cs b/src/Applications/UUPDownload/Program.cs index 3aee7952..ce48080c 100644 --- a/src/Applications/UUPDownload/Program.cs +++ b/src/Applications/UUPDownload/Program.cs @@ -75,12 +75,17 @@ private static int Main(string[] args) { ServicePointManager.DefaultConnectionLimit = int.MaxValue; - return Parser.Default.ParseArguments(args).MapResult( + return Parser.Default.ParseArguments(args).MapResult( (DownloadRequestOptions opts) => { PrintLogo(); return WrapAction(() => DownloadRequest.Process.ParseDownloadOptions(opts)); }, + (BSPDownloadRequestOptions opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.ProcessDrivers.ParseDownloadOptions(opts)); + }, (DownloadReplayOptions opts) => { PrintLogo(); diff --git a/src/Applications/UUPDownload/UUPDownload.csproj b/src/Applications/UUPDownload/UUPDownload.csproj index 4af18b76..b40157d1 100644 --- a/src/Applications/UUPDownload/UUPDownload.csproj +++ b/src/Applications/UUPDownload/UUPDownload.csproj @@ -9,6 +9,14 @@ MinimumRecommendedRules.ruleset AnyCPU;x64;x86;arm64 + + + + + + Always + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index e15df716..e81a2423 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -57,6 +57,20 @@ public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileEx { string newPath = path; + MatchCollection guidMatches = guidRegex().Matches(newPath); + + // Some file packages (especially for device manifests) contain guids as part of their name and often the actual name of the file after, so trim that right away + foreach (Match match in guidMatches.OrderByDescending(x => x.Index + x.Length)) + { + newPath = string.Concat(newPath.AsSpan(0, match.Index), newPath.AsSpan(match.Index + match.Length)); + } + + // It is possible that above operation caused the file to go empty, check for that and if thats the case, revert now. + if (newPath != path && (string.IsNullOrEmpty(newPath) || newPath.StartsWith('.'))) + { + newPath = path; + } + try { foreach (BaseManifest compDb in compDBs) @@ -79,8 +93,6 @@ public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileEx if (!pathList.Add(newPath.ToLower())) { - throw new Exception("WHAT"); - string basePath, suffix; if (Path.HasExtension(newPath)) @@ -629,5 +641,8 @@ await Task.WhenAll( [GeneratedRegex("[\\\\/:*?\"<>|]")] private static partial Regex invalidCharactersRegex(); + + [GeneratedRegex("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")] + private static partial Regex guidRegex(); } } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs index 87407b96..0257b024 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs @@ -59,9 +59,11 @@ public CTAC(OSSkuId ReportingSku, bool SyncCurrentVersionOnly, bool IsStore = false, string ContentType = "Mainline", - bool IsVbsEnabled = true) : base() + bool IsVbsEnabled = true, + bool IsDriverCheck = false, + string DriverPartnerRing = "Drivers") : base() { - BuildCTAC(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, IsStore, ContentType, IsVbsEnabled); + BuildCTAC(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, IsStore, ContentType, IsVbsEnabled, IsDriverCheck, DriverPartnerRing); } private void BuildCTAC( @@ -76,7 +78,9 @@ private void BuildCTAC( bool SyncCurrentVersionOnly, bool IsStore = false, string content = "Mainline", - bool IsVbsEnabled = true + bool IsVbsEnabled = true, + bool IsDriverCheck = false, + string DriverPartnerRing = "Drivers" ) { int flightEnabled = FlightRing == "Retail" ? 0 : 1; @@ -141,99 +145,151 @@ private void BuildCTAC( Dictionary deviceAttributeDictionary = []; - deviceAttributeDictionary.Add("IsContainerMgrInstalled", "1"); - deviceAttributeDictionary.Add("FlightRing", FlightRing); - deviceAttributeDictionary.Add("TelemetryLevel", "3"); - deviceAttributeDictionary.Add("HidOverGattReg", "C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll"); - deviceAttributeDictionary.Add("AppVer", "0.0.0.0"); - deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); - deviceAttributeDictionary.Add("ProcessorIdentifier", "Intel64 Family 6 Model 151 Stepping 2"); - deviceAttributeDictionary.Add("OEMModel", "RM-1085_1045"); - deviceAttributeDictionary.Add("ProcessorManufacturer", "GenuineIntel"); - deviceAttributeDictionary.Add("InstallDate", "1577722757"); - deviceAttributeDictionary.Add("OEMModelBaseBoard", "OEM Board Name"); - deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); - deviceAttributeDictionary.Add("DataExpDateEpoch_20H1", "1593425114"); - deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); - deviceAttributeDictionary.Add("Bios", "2019"); - deviceAttributeDictionary.Add("DchuAmdGrfxVen", "4098"); - deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); - deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); - deviceAttributeDictionary.Add("OSUILocale", "en-US"); - deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); - deviceAttributeDictionary.Add("UpgEx_20H1", "Green"); - deviceAttributeDictionary.Add("WuClientVer", ReportingVersion); - deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); - deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); - deviceAttributeDictionary.Add("GStatus_20H1", "2"); - deviceAttributeDictionary.Add("App", App); - deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); - deviceAttributeDictionary.Add("InstallLanguage", "en-US"); - deviceAttributeDictionary.Add("OEMName_Uncleaned", "MICROSOFTMDG"); - deviceAttributeDictionary.Add("InstallationType", InstallType); - deviceAttributeDictionary.Add("AttrDataVer", "264"); - deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); - deviceAttributeDictionary.Add("TimestampEpochString_20H1", "1593425114"); - deviceAttributeDictionary.Add("OSVersion", ReportingVersion); - deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); - deviceAttributeDictionary.Add("TencentType", "1"); - deviceAttributeDictionary.Add("FlightContent", content); - deviceAttributeDictionary.Add("ActivationChannel", "Retail"); - deviceAttributeDictionary.Add("Steam", "URL:steam protocol"); - deviceAttributeDictionary.Add("Free", "gt64"); - deviceAttributeDictionary.Add("TencentReg", "79 d0 01 d7 9f 54 d5 01"); - deviceAttributeDictionary.Add("FirmwareVersion", "7704"); - deviceAttributeDictionary.Add("DchuAmdGrfxExists", "1"); - deviceAttributeDictionary.Add("SdbVer_20H1", "2000000000"); - deviceAttributeDictionary.Add("UpgEx_CO21H2", "Green"); - //deviceAttributeDictionary.Add("OSArchitecture", MachineType.ToString().ToUpper()); - deviceAttributeDictionary.Add("OSArchitecture", "AMD64"); - deviceAttributeDictionary.Add("DefaultUserRegion", "244"); - deviceAttributeDictionary.Add("ReleaseType", ReleaseType); - deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); - deviceAttributeDictionary.Add("MobileOperatorCommercialized", "000-88"); - deviceAttributeDictionary.Add("PhoneTargetingName", "Lumia 950 XL"); - deviceAttributeDictionary.Add("AllowInPlaceUpgrade", "1"); - deviceAttributeDictionary.Add("AllowUpgradesWithUnsupportedTPMOrCPU", "1"); - deviceAttributeDictionary.Add("CloudPBR", "1"); - deviceAttributeDictionary.Add("DataExpDateEpoch_19H1", "1593425114"); - deviceAttributeDictionary.Add("DataExpDateEpoch_21H1", "1593425114"); - deviceAttributeDictionary.Add("DataExpDateEpoch_21H2", "1593425114"); - deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2", "1593425114"); - deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2Setup", "1593425114"); - deviceAttributeDictionary.Add("DataVer_RS5", "2000000000"); - deviceAttributeDictionary.Add("DUScan", "1"); - deviceAttributeDictionary.Add("EKB19H2InstallCount", "1"); - deviceAttributeDictionary.Add("EKB19H2InstallTimeEpoch", "1255000000"); - deviceAttributeDictionary.Add("GenTelRunTimestamp_19H1", "1593425114"); - deviceAttributeDictionary.Add("GStatus_19H1", "2"); - deviceAttributeDictionary.Add("GStatus_19H1Setup", "2"); - deviceAttributeDictionary.Add("GStatus_20H1Setup", "2"); - deviceAttributeDictionary.Add("GStatus_21H2", "2"); - deviceAttributeDictionary.Add("GStatus_CO21H2", "2"); - deviceAttributeDictionary.Add("GStatus_CO21H2Setup", "2"); - deviceAttributeDictionary.Add("GStatus_RS5", "2"); - deviceAttributeDictionary.Add("MediaBranch", ""); - deviceAttributeDictionary.Add("ProcessorModel", "12th Gen Intel(R) Core(TM) i9-12900K"); - deviceAttributeDictionary.Add("SdbVer_19H1", "2000000000"); - deviceAttributeDictionary.Add("SecureBootCapable", "1"); - deviceAttributeDictionary.Add("TimestampEpochString_19H1", "1593425114"); - deviceAttributeDictionary.Add("TimestampEpochString_21H1", "1593425114"); - deviceAttributeDictionary.Add("TimestampEpochString_21H2", "1593425114"); - deviceAttributeDictionary.Add("TimestampEpochString_CO21H2", "1593425114"); - deviceAttributeDictionary.Add("TimestampEpochString_CO21H2Setup", "1593425114"); - deviceAttributeDictionary.Add("TPMVersion", "2"); - deviceAttributeDictionary.Add("UpdateOfferedDays", "0"); - deviceAttributeDictionary.Add("UpgEx_19H1", "Green"); - deviceAttributeDictionary.Add("UpgEx_21H1", "Green"); - deviceAttributeDictionary.Add("UpgEx_21H2", "Green"); - deviceAttributeDictionary.Add("UpgEx_NI22H2", "Green"); - deviceAttributeDictionary.Add("UpgEx_RS5", "Green"); - deviceAttributeDictionary.Add("UpgradeEligible", "1"); - deviceAttributeDictionary.Add("Version_RS5", "2000000000"); - deviceAttributeDictionary.Add("IsRetailOS", (FlightRing == "Retail").ToString()); - deviceAttributeDictionary.Add("MediaVersion", ReportingVersion); - deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + if (IsDriverCheck) + { + deviceAttributeDictionary.Add("ActivationChannel", "OEM:DM"); + deviceAttributeDictionary.Add("App", App); + deviceAttributeDictionary.Add("AppVer", ReportingVersion); + deviceAttributeDictionary.Add("AttrDataVer", "264"); + deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); + deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); + deviceAttributeDictionary.Add("DefaultUserRegion", "244"); + deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); + if (!string.IsNullOrEmpty(DriverPartnerRing)) + { + deviceAttributeDictionary.Add("DriverPartnerRing", DriverPartnerRing); + } + deviceAttributeDictionary.Add("FirmwareVersion", "7.31.139"); + deviceAttributeDictionary.Add("FlightContent", content); + deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); + deviceAttributeDictionary.Add("FlightRing", FlightRing); + deviceAttributeDictionary.Add("HidparseDriversVer", ReportingVersion); + deviceAttributeDictionary.Add("InstallationType", InstallType); + deviceAttributeDictionary.Add("InstallDate", "1677314327"); + deviceAttributeDictionary.Add("InstallLanguage", "en-US"); + deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); + deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); + deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); + deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); + deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); + deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); + deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + deviceAttributeDictionary.Add("OEMModel", "Windows Dev Kit 2023"); + deviceAttributeDictionary.Add("OEMModelBaseBoard", "Windows Dev Kit 2023"); + deviceAttributeDictionary.Add("OEMName_Uncleaned", "Microsoft Corporation"); + deviceAttributeDictionary.Add("OEMSubModel", "2043"); + deviceAttributeDictionary.Add("OSArchitecture", "ARM64"); + deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); + deviceAttributeDictionary.Add("OSUILocale", "en-US"); + deviceAttributeDictionary.Add("OSVersion", ReportingVersion); + deviceAttributeDictionary.Add("ProcessorClockSpeed", "1440"); + deviceAttributeDictionary.Add("ProcessorCores", "8"); + deviceAttributeDictionary.Add("ProcessorIdentifier", "ARMv8 (64-bit) Family 8 Model D4B Revision 0"); + deviceAttributeDictionary.Add("ProcessorManufacturer", "Qualcomm Technologies Inc"); + deviceAttributeDictionary.Add("ProcessorModel", "Snapdragon Compute Platform"); + deviceAttributeDictionary.Add("SecureBootCapable", "1"); + deviceAttributeDictionary.Add("TelemetryLevel", "3"); + deviceAttributeDictionary.Add("TotalPhysicalRAM", "32768"); + deviceAttributeDictionary.Add("TPMVersion", "2"); + deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); + deviceAttributeDictionary.Add("WuClientVer", "1101.2301.31021.0"); + } + else + { + deviceAttributeDictionary.Add("IsContainerMgrInstalled", "1"); + deviceAttributeDictionary.Add("FlightRing", FlightRing); + deviceAttributeDictionary.Add("TelemetryLevel", "3"); + deviceAttributeDictionary.Add("HidOverGattReg", "C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll"); + deviceAttributeDictionary.Add("AppVer", "0.0.0.0"); + deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); + deviceAttributeDictionary.Add("ProcessorIdentifier", "Intel64 Family 6 Model 151 Stepping 2"); + deviceAttributeDictionary.Add("OEMModel", "RM-1085_1045"); + deviceAttributeDictionary.Add("ProcessorManufacturer", "GenuineIntel"); + deviceAttributeDictionary.Add("InstallDate", "1577722757"); + deviceAttributeDictionary.Add("OEMModelBaseBoard", "OEM Board Name"); + deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); + deviceAttributeDictionary.Add("DataExpDateEpoch_20H1", "1593425114"); + deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); + deviceAttributeDictionary.Add("Bios", "2019"); + deviceAttributeDictionary.Add("DchuAmdGrfxVen", "4098"); + deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); + deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); + deviceAttributeDictionary.Add("OSUILocale", "en-US"); + deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); + deviceAttributeDictionary.Add("UpgEx_20H1", "Green"); + deviceAttributeDictionary.Add("WuClientVer", ReportingVersion); + deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); + deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); + deviceAttributeDictionary.Add("GStatus_20H1", "2"); + deviceAttributeDictionary.Add("App", App); + deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); + deviceAttributeDictionary.Add("InstallLanguage", "en-US"); + deviceAttributeDictionary.Add("OEMName_Uncleaned", "MICROSOFTMDG"); + deviceAttributeDictionary.Add("InstallationType", InstallType); + deviceAttributeDictionary.Add("AttrDataVer", "264"); + deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_20H1", "1593425114"); + deviceAttributeDictionary.Add("OSVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); + deviceAttributeDictionary.Add("TencentType", "1"); + deviceAttributeDictionary.Add("FlightContent", content); + deviceAttributeDictionary.Add("ActivationChannel", "Retail"); + deviceAttributeDictionary.Add("Steam", "URL:steam protocol"); + deviceAttributeDictionary.Add("Free", "gt64"); + deviceAttributeDictionary.Add("TencentReg", "79 d0 01 d7 9f 54 d5 01"); + deviceAttributeDictionary.Add("FirmwareVersion", "7704"); + deviceAttributeDictionary.Add("DchuAmdGrfxExists", "1"); + deviceAttributeDictionary.Add("SdbVer_20H1", "2000000000"); + deviceAttributeDictionary.Add("UpgEx_CO21H2", "Green"); + //deviceAttributeDictionary.Add("OSArchitecture", MachineType.ToString().ToUpper()); + deviceAttributeDictionary.Add("OSArchitecture", "AMD64"); + deviceAttributeDictionary.Add("DefaultUserRegion", "244"); + deviceAttributeDictionary.Add("ReleaseType", ReleaseType); + deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); + deviceAttributeDictionary.Add("MobileOperatorCommercialized", "000-88"); + deviceAttributeDictionary.Add("PhoneTargetingName", "Lumia 950 XL"); + deviceAttributeDictionary.Add("AllowInPlaceUpgrade", "1"); + deviceAttributeDictionary.Add("AllowUpgradesWithUnsupportedTPMOrCPU", "1"); + deviceAttributeDictionary.Add("CloudPBR", "1"); + deviceAttributeDictionary.Add("DataExpDateEpoch_19H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("DataVer_RS5", "2000000000"); + deviceAttributeDictionary.Add("DUScan", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallCount", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallTimeEpoch", "1255000000"); + deviceAttributeDictionary.Add("GenTelRunTimestamp_19H1", "1593425114"); + deviceAttributeDictionary.Add("GStatus_19H1", "2"); + deviceAttributeDictionary.Add("GStatus_19H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_20H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2Setup", "2"); + deviceAttributeDictionary.Add("GStatus_RS5", "2"); + deviceAttributeDictionary.Add("MediaBranch", ""); + deviceAttributeDictionary.Add("ProcessorModel", "12th Gen Intel(R) Core(TM) i9-12900K"); + deviceAttributeDictionary.Add("SdbVer_19H1", "2000000000"); + deviceAttributeDictionary.Add("SecureBootCapable", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_19H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("TPMVersion", "2"); + deviceAttributeDictionary.Add("UpdateOfferedDays", "0"); + deviceAttributeDictionary.Add("UpgEx_19H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_NI22H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_RS5", "Green"); + deviceAttributeDictionary.Add("UpgradeEligible", "1"); + deviceAttributeDictionary.Add("Version_RS5", "2000000000"); + deviceAttributeDictionary.Add("IsRetailOS", (FlightRing == "Retail").ToString()); + deviceAttributeDictionary.Add("MediaVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + } DeviceAttributes = $"E:{string.Join("&", deviceAttributeDictionary.Select(x => $"{x.Key}={x.Value}"))}"; From c987935bd582fd1e35ec3d53aa970742758d442b Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 18:35:39 +0200 Subject: [PATCH 18/26] Split off the reference drivers repo implementation --- .../ProcessDrivers.GenerateChangelog.cs | 2 +- .../DownloadRequest/Drivers/ProcessDrivers.cs | 2 +- .../ReferenceDriversRepo/DriverPlan.cs | 59 +++++ .../ProcessDrivers.GenerateChangelog.cs | 127 +++++++++ .../ReferenceDriversRepo/ProcessDrivers.cs | 245 ++++++++++++++++++ 5 files changed, 433 insertions(+), 2 deletions(-) create mode 100644 src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs create mode 100644 src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs create mode 100644 src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs index d0a80f38..f25d88c6 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs @@ -7,7 +7,7 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; -namespace UUPDownload.DownloadRequest +namespace UUPDownload.DownloadRequest.Drivers { public partial class ProcessDrivers { diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs index 4211f877..e0eb29e9 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -32,7 +32,7 @@ using UUPDownload.Downloading; using UUPDownload.DownloadRequest.Drivers; -namespace UUPDownload.DownloadRequest +namespace UUPDownload.DownloadRequest.Drivers { public partial class ProcessDrivers { diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs new file mode 100644 index 00000000..310e4952 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs @@ -0,0 +1,59 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public class DriverPlan + { + public string outputFolder + { + get; set; + } + public string guid + { + get; set; + } + public int[] filteredIds + { + get; set; + } + public int[] excludedIds + { + get; set; + } + public string Manufacturer + { + get; set; + } + public string Family + { + get; set; + } + public string Product + { + get; set; + } + public string Sku + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs new file mode 100644 index 00000000..0ac07bee --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; + +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public partial class ProcessDrivers + { + private static async Task GenerateChangelog(UpdateData update, string changelogOutput, int i, BaseManifest pevCompDB) + { + File.AppendAllLines(changelogOutput, ["", $"## {update.Xml.LocalizedProperties.Title} - 200.0.{i}.0"]); + + HashSet compDBs = await update.GetCompDBsAsync(); + BaseManifest curCompDB = compDBs.First(); + + List added = []; + List updated = []; + List removed = []; + List modified = []; + + if (pevCompDB != null) + { + IEnumerable prevPackageList = pevCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + IEnumerable curPackageList = curCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + + foreach (string pkg in prevPackageList) + { + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInNewer = curPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!existsInNewer) + { + removed.Add(pkg); + } + } + + foreach (Package package in curCompDB.Packages.Package) + { + string pkg = $"| {package.Version} | {package.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"; + + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInOlder = prevPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (existsInOlder) + { + bool hasSameVersion = prevPackageList.Any(x => version.Equals(x.Split("|")[1], StringComparison.InvariantCultureIgnoreCase) && id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!hasSameVersion) + { + updated.Add(pkg); + } + else + { + bool hasSameHash = pevCompDB.Packages.Package.Any(x => x.Payload.PayloadItem[0].PayloadHash == package.Payload.PayloadItem[0].PayloadHash); + if (!hasSameHash) + { + modified.Add(pkg); + } + } + } + else + { + added.Add(pkg); + } + } + } + else + { + foreach (Package pkg in curCompDB.Packages.Package) + { + added.Add($"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.CurrentCultureIgnoreCase)} |"); + } + } + + added.Sort(); + updated.Sort(); + modified.Sort(); + removed.Sort(); + + if (added.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Added", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, added); + } + + + if (updated.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Updated", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, updated); + } + + + if (modified.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Modified", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, modified); + } + + + if (removed.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Removed", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, removed); + } + + return curCompDB; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs new file mode 100644 index 00000000..be2b8ebf --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs @@ -0,0 +1,245 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; +using UUPDownload.Downloading; +using UUPDownload.DownloadRequest.Drivers; + +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public partial class ProcessDrivers + { + internal static void ParseDownloadOptions(BSPDownloadRequestOptions opts) + { + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.Language, + opts.Edition).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string Language, + string Edition) + { + if (!File.Exists("DriverConfig.json")) + { + Logging.Log("Driver Configuration file (DriverConfig.json) could not be found in the current working directory.", Logging.LoggingLevel.Error); + return; + } + + DriverPlan[] plans = System.Text.Json.JsonSerializer.Deserialize(File.ReadAllText("DriverConfig.json")); + + foreach (DriverPlan plan in plans) + { + Logging.Log(plan.outputFolder); + await ProcessDriverPlan(plan, ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType, Mail, Password, Language, Edition, OutputFolder); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + + private static async Task ProcessDriverPlan(DriverPlan DriverPlan, + OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string Language, + string Edition, + string RepoLocation) + { + BaseManifest previousCompositionDatabase = null; + + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, false, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string ProductGUID = DriverPlan.guid; + if (string.IsNullOrEmpty(ProductGUID)) + { + ProductGUID = ComputerHardwareID.GenerateHardwareId5(DriverPlan.Manufacturer, DriverPlan.Family, DriverPlan.Product, DriverPlan.Sku); + } + + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=0.0.0.0&Source=SMBIOS;"; + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = (RepoLocation + DriverPlan.outputFolder).Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + string newestDriverVersion = "0.0.0.0"; + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + newestDriverVersion = compDBs.First().UUPProductVersion; + } + + if (SyncCurrentVersionOnly) + { + foreach (UpdateData update in NewestDriverProductUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress(), Language: Language, Edition: Edition); + } + } + else + { + string newestDriverOutput = $"{outputFolder}{Path.DirectorySeparatorChar}{newestDriverVersion}"; + if (Directory.Exists(newestDriverOutput) && Directory.EnumerateFiles(newestDriverOutput).Any()) + { + return; + } + + string changelogOutput = $"{outputFolder}{Path.DirectorySeparatorChar}CHANGELOG.md"; + + if (File.Exists(changelogOutput)) + { + File.Delete(changelogOutput); + } + + int newestDriverBuildNumber = int.Parse(newestDriverVersion.Split(".")[2]); + + for (int driverBuildNumber = 0; driverBuildNumber <= newestDriverBuildNumber; driverBuildNumber++) + { + if (DriverPlan.filteredIds.Length != 0 && !DriverPlan.filteredIds.Contains(driverBuildNumber)) + { + continue; + } + + if (DriverPlan.excludedIds.Length != 0 && DriverPlan.excludedIds.Contains(driverBuildNumber)) + { + continue; + } + + CTAC PreciseDriverProductVersionCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + + PreciseDriverProductVersionCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=200.0.{driverBuildNumber}.0&Source=SMBIOS;"; + PreciseDriverProductVersionCTAC.SyncCurrentVersionOnly = true; + + Logging.Log($"Checking for updates... 200.0.{driverBuildNumber}.0 / {newestDriverVersion}"); + IEnumerable PreciseDriverProductVersionUpdateData = await FE3Handler.GetUpdates(null, PreciseDriverProductVersionCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + if (!PreciseDriverProductVersionUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + } + else + { + foreach (UpdateData update in PreciseDriverProductVersionUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + string fwOutput = $"{outputFolder}{Path.DirectorySeparatorChar}200.0.{driverBuildNumber}.0"; + if (!Directory.Exists(fwOutput) || !Directory.EnumerateFiles(fwOutput).Any()) + { + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, fwOutput, MachineType, new ReportProgress(), Language, Edition, false, false); + } + + previousCompositionDatabase = await GenerateChangelog(update, changelogOutput, driverBuildNumber, previousCompositionDatabase); + } + } + } + } + } + } +} From 5c2bf92666588f50f5d2dd44ad5b3f431c229058 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 19:01:34 +0200 Subject: [PATCH 19/26] Implement the ability to fetch specific drivers via CLI --- .../DownloadRequest/Drivers/DriverPlan.cs | 59 ------ .../ProcessDrivers.GenerateChangelog.cs | 127 ------------- .../DownloadRequest/Drivers/ProcessDrivers.cs | 169 ++++-------------- .../ReferenceDriversRepo/ProcessDrivers.cs | 3 +- .../Options/BSPDownloadRequestOptions.cs | 103 +++++++++-- .../Options/BSPDownloadRequestOptions2.cs | 120 +++++++++++++ src/Applications/UUPDownload/Program.cs | 9 +- .../Properties/launchSettings.json | 2 +- 8 files changed, 257 insertions(+), 335 deletions(-) delete mode 100644 src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs delete mode 100644 src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs create mode 100644 src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs deleted file mode 100644 index b249c1a0..00000000 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/DriverPlan.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Gustave Monce and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -namespace UUPDownload.DownloadRequest.Drivers -{ - public class DriverPlan - { - public string outputFolder - { - get; set; - } - public string guid - { - get; set; - } - public int[] filteredIds - { - get; set; - } - public int[] excludedIds - { - get; set; - } - public string Manufacturer - { - get; set; - } - public string Family - { - get; set; - } - public string Product - { - get; set; - } - public string Sku - { - get; set; - } - } -} diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs deleted file mode 100644 index f25d88c6..00000000 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.GenerateChangelog.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnifiedUpdatePlatform.Services.Composition.Database; -using UnifiedUpdatePlatform.Services.WindowsUpdate; - -namespace UUPDownload.DownloadRequest.Drivers -{ - public partial class ProcessDrivers - { - private static async Task GenerateChangelog(UpdateData update, string changelogOutput, int i, BaseManifest pevCompDB) - { - File.AppendAllLines(changelogOutput, ["", $"## {update.Xml.LocalizedProperties.Title} - 200.0.{i}.0"]); - - HashSet compDBs = await update.GetCompDBsAsync(); - BaseManifest curCompDB = compDBs.First(); - - List added = []; - List updated = []; - List removed = []; - List modified = []; - - if (pevCompDB != null) - { - IEnumerable prevPackageList = pevCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); - IEnumerable curPackageList = curCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); - - foreach (string pkg in prevPackageList) - { - string version = pkg.Split("|")[1]; - string id = pkg.Split("|")[2]; - - bool existsInNewer = curPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); - - if (!existsInNewer) - { - removed.Add(pkg); - } - } - - foreach (Package package in curCompDB.Packages.Package) - { - string pkg = $"| {package.Version} | {package.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"; - - string version = pkg.Split("|")[1]; - string id = pkg.Split("|")[2]; - - bool existsInOlder = prevPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); - - if (existsInOlder) - { - bool hasSameVersion = prevPackageList.Any(x => version.Equals(x.Split("|")[1], StringComparison.InvariantCultureIgnoreCase) && id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); - - if (!hasSameVersion) - { - updated.Add(pkg); - } - else - { - bool hasSameHash = pevCompDB.Packages.Package.Any(x => x.Payload.PayloadItem[0].PayloadHash == package.Payload.PayloadItem[0].PayloadHash); - if (!hasSameHash) - { - modified.Add(pkg); - } - } - } - else - { - added.Add(pkg); - } - } - } - else - { - foreach (Package pkg in curCompDB.Packages.Package) - { - added.Add($"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.CurrentCultureIgnoreCase)} |"); - } - } - - added.Sort(); - updated.Sort(); - modified.Sort(); - removed.Sort(); - - if (added.Count > 0) - { - File.AppendAllLines(changelogOutput, ["", $"### Added", ""]); - File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); - File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); - File.AppendAllLines(changelogOutput, added); - } - - - if (updated.Count > 0) - { - File.AppendAllLines(changelogOutput, ["", $"### Updated", ""]); - File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); - File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); - File.AppendAllLines(changelogOutput, updated); - } - - - if (modified.Count > 0) - { - File.AppendAllLines(changelogOutput, ["", $"### Modified", ""]); - File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); - File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); - File.AppendAllLines(changelogOutput, modified); - } - - - if (removed.Count > 0) - { - File.AppendAllLines(changelogOutput, ["", $"### Removed", ""]); - File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); - File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); - File.AppendAllLines(changelogOutput, removed); - } - - return curCompDB; - } - } -} diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs index e0eb29e9..980c00e7 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -30,7 +30,6 @@ using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; using UUPDownload.Options; using UUPDownload.Downloading; -using UUPDownload.DownloadRequest.Drivers; namespace UUPDownload.DownloadRequest.Drivers { @@ -52,8 +51,18 @@ internal static void ParseDownloadOptions(BSPDownloadRequestOptions opts) opts.Mail, opts.Password, opts.OutputFolder, - opts.Language, - opts.Edition).Wait(); + opts.BSPProductVersion, + opts.Manufacturer, + opts.Family, + opts.ProductName, + opts.SKUNumber, + opts.BIOSVendor, + opts.BaseboardManufacturer, + opts.BaseboardProduct, + opts.EnclosureType, + opts.BIOSVersion, + opts.BIOSMajorRelease, + opts.BIOSMinorRelease).Wait(); } private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, @@ -69,70 +78,38 @@ private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, string Mail, string Password, string OutputFolder, - string Language, - string Edition) + string BSPProductVersion, + string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) { - if (!File.Exists("DriverConfig.json")) - { - Logging.Log("Driver Configuration file (DriverConfig.json) could not be found in the current working directory.", Logging.LoggingLevel.Error); - return; - } - - DriverPlan[] plans = System.Text.Json.JsonSerializer.Deserialize(File.ReadAllText("DriverConfig.json")); - - foreach (DriverPlan plan in plans) - { - Logging.Log(plan.outputFolder); - await ProcessDriverPlan(plan, ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType, Mail, Password, Language, Edition, OutputFolder); - } - - if (Debugger.IsAttached) - { - _ = Console.ReadLine(); - } - - Logging.Log("Completed."); - } - - private static async Task ProcessDriverPlan(DriverPlan DriverPlan, - OSSkuId ReportingSku, - string ReportingVersion, - MachineType MachineType, - string FlightRing, - string FlightingBranchName, - string BranchReadinessLevel, - string CurrentBranch, - string ReleaseType, - bool SyncCurrentVersionOnly, - string ContentType, - string Mail, - string Password, - string Language, - string Edition, - string RepoLocation) - { - BaseManifest previousCompositionDatabase = null; - Logging.Log("Checking for updates..."); - CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, false, ContentType: ContentType, IsDriverCheck: true); + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); string token = string.Empty; if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) { token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); } - string ProductGUID = DriverPlan.guid; - if (string.IsNullOrEmpty(ProductGUID)) + string[] ProductGUIDs = ComputerHardwareID.GenerateHardwareIds(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BaseboardManufacturer, BaseboardProduct, EnclosureType, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease); + + foreach (string ProductGUID in ProductGUIDs) { - ProductGUID = ComputerHardwareID.GenerateHardwareId5(DriverPlan.Manufacturer, DriverPlan.Family, DriverPlan.Product, DriverPlan.Sku); + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V={BSPProductVersion}&Source=SMBIOS;"; } - NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=0.0.0.0&Source=SMBIOS;"; - IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); - string outputFolder = (RepoLocation + DriverPlan.outputFolder).Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + string outputFolder = OutputFolder.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); if (!NewestDriverProductUpdateData.Any()) { @@ -140,8 +117,6 @@ private static async Task ProcessDriverPlan(DriverPlan DriverPlan, return; } - string newestDriverVersion = "0.0.0.0"; - for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) { UpdateData update = NewestDriverProductUpdateData.ElementAt(i); @@ -158,88 +133,18 @@ private static async Task ProcessDriverPlan(DriverPlan DriverPlan, HashSet compDBs = await update.GetCompDBsAsync(); - newestDriverVersion = compDBs.First().UUPProductVersion; + Logging.Log("BSP Product Name: " + compDBs.First().UUPProduct); + Logging.Log("BSP Product Version: " + compDBs.First().UUPProductVersion); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress()); } - if (SyncCurrentVersionOnly) + if (Debugger.IsAttached) { - foreach (UpdateData update in NewestDriverProductUpdateData) - { - if (update.Xml.LocalizedProperties.Title.Contains("Windows")) - { - continue; - } - - Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); - Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); - - _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress(), Language: Language, Edition: Edition); - } + _ = Console.ReadLine(); } - else - { - string newestDriverOutput = $"{outputFolder}{Path.DirectorySeparatorChar}{newestDriverVersion}"; - if (Directory.Exists(newestDriverOutput) && Directory.EnumerateFiles(newestDriverOutput).Any()) - { - return; - } - - string changelogOutput = $"{outputFolder}{Path.DirectorySeparatorChar}CHANGELOG.md"; - - if (File.Exists(changelogOutput)) - { - File.Delete(changelogOutput); - } - - int newestDriverBuildNumber = int.Parse(newestDriverVersion.Split(".")[2]); - for (int driverBuildNumber = 0; driverBuildNumber <= newestDriverBuildNumber; driverBuildNumber++) - { - if (DriverPlan.filteredIds.Length != 0 && !DriverPlan.filteredIds.Contains(driverBuildNumber)) - { - continue; - } - - if (DriverPlan.excludedIds.Length != 0 && DriverPlan.excludedIds.Contains(driverBuildNumber)) - { - continue; - } - - CTAC PreciseDriverProductVersionCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); - - PreciseDriverProductVersionCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=200.0.{driverBuildNumber}.0&Source=SMBIOS;"; - PreciseDriverProductVersionCTAC.SyncCurrentVersionOnly = true; - - Logging.Log($"Checking for updates... 200.0.{driverBuildNumber}.0 / {newestDriverVersion}"); - IEnumerable PreciseDriverProductVersionUpdateData = await FE3Handler.GetUpdates(null, PreciseDriverProductVersionCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); - - if (!PreciseDriverProductVersionUpdateData.Any()) - { - Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); - } - else - { - foreach (UpdateData update in PreciseDriverProductVersionUpdateData) - { - if (update.Xml.LocalizedProperties.Title.Contains("Windows")) - { - continue; - } - - Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); - Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); - - string fwOutput = $"{outputFolder}{Path.DirectorySeparatorChar}200.0.{driverBuildNumber}.0"; - if (!Directory.Exists(fwOutput) || !Directory.EnumerateFiles(fwOutput).Any()) - { - _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, fwOutput, MachineType, new ReportProgress(), Language, Edition, false, false); - } - - previousCompositionDatabase = await GenerateChangelog(update, changelogOutput, driverBuildNumber, previousCompositionDatabase); - } - } - } - } + Logging.Log("Completed."); } } } diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs index be2b8ebf..9e62c931 100644 --- a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs @@ -30,13 +30,12 @@ using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; using UUPDownload.Options; using UUPDownload.Downloading; -using UUPDownload.DownloadRequest.Drivers; namespace UUPDownload.DownloadRequest.ReferenceDriversRepo { public partial class ProcessDrivers { - internal static void ParseDownloadOptions(BSPDownloadRequestOptions opts) + internal static void ParseDownloadOptions(BSPDownloadRequestOptions2 opts) { CheckAndDownloadUpdates( opts.ReportingSku, diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs index 861405e6..782bf302 100644 --- a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs @@ -81,18 +81,6 @@ public string OutputFolder get; set; } - [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] - public string Edition - { - get; set; - } - - [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] - public string Language - { - get; set; - } - [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] public string ReleaseType { @@ -116,5 +104,96 @@ public string Password { get; set; } + + // Used above: + // a + // b + // c + // m + // n + // o + // p + // r + // s + // t + // v + // y + // z + + [Option('d', "bsp-product-version", HelpText = "", Required = false, Default = "0.0.0.0")] + public string BSPProductVersion + { + get; set; + } + + // + // Targeting for the BSP Product, see the ComputerHardwareIds.Windows project for knowing what these map to, programmatically + // + + [Option('e', "targeting-manufacturer", HelpText = "", Required = true)] + public string Manufacturer + { + get; set; + } + + [Option('f', "targeting-family", HelpText = "", Required = false, Default = null)] + public string Family + { + get; set; + } + + [Option('g', "targeting-productname", HelpText = "", Required = false, Default = null)] + public string ProductName + { + get; set; + } + + [Option('h', "targeting-skunumber", HelpText = "", Required = false, Default = null)] + public string SKUNumber + { + get; set; + } + + [Option('i', "targeting-biosvendor", HelpText = "", Required = false, Default = null)] + public string BIOSVendor + { + get; set; + } + + [Option('j', "targeting-baseboardmanufacturer", HelpText = "", Required = false, Default = null)] + public string BaseboardManufacturer + { + get; set; + } + + [Option('k', "targeting-baseboardproduct", HelpText = "", Required = false, Default = null)] + public string BaseboardProduct + { + get; set; + } + + [Option('l', "targeting-enclosuretype", HelpText = "", Required = false, Default = null)] + public string EnclosureType + { + get; set; + } + + [Option('q', "targeting-biosversion", HelpText = "", Required = false, Default = null)] + public string BIOSVersion + { + get; set; + } + + [Option('u', "targeting-biosmajorrelease", HelpText = "", Required = false, Default = null)] + public string BIOSMajorRelease + { + get; set; + } + + [Option('w', "targeting-biosminorrelease", HelpText = "", Required = false, Default = null)] + public string BIOSMinorRelease + { + get; set; + } } } diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs new file mode 100644 index 00000000..c7dc10ba --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs @@ -0,0 +1,120 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download2", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions2 + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] + public string Edition + { + get; set; + } + + [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] + public string Language + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Program.cs b/src/Applications/UUPDownload/Program.cs index ce48080c..82652c8e 100644 --- a/src/Applications/UUPDownload/Program.cs +++ b/src/Applications/UUPDownload/Program.cs @@ -75,7 +75,7 @@ private static int Main(string[] args) { ServicePointManager.DefaultConnectionLimit = int.MaxValue; - return Parser.Default.ParseArguments(args).MapResult( + return Parser.Default.ParseArguments(args).MapResult( (DownloadRequestOptions opts) => { PrintLogo(); @@ -84,7 +84,12 @@ private static int Main(string[] args) (BSPDownloadRequestOptions opts) => { PrintLogo(); - return WrapAction(() => DownloadRequest.ProcessDrivers.ParseDownloadOptions(opts)); + return WrapAction(() => DownloadRequest.Drivers.ProcessDrivers.ParseDownloadOptions(opts)); + }, + (BSPDownloadRequestOptions2 opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.ReferenceDriversRepo.ProcessDrivers.ParseDownloadOptions(opts)); }, (DownloadReplayOptions opts) => { diff --git a/src/Applications/UUPDownload/Properties/launchSettings.json b/src/Applications/UUPDownload/Properties/launchSettings.json index 1c8bc178..f8570037 100644 --- a/src/Applications/UUPDownload/Properties/launchSettings.json +++ b/src/Applications/UUPDownload/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "UnifiedUpdatePlatform.Media.Download": { "commandName": "Project", - "commandLineArgs": "-s Professional -v 10.0.22635.2483 -t amd64 -r External -b Dev -a CB -c ni_release -y" + "commandLineArgs": "request-bsp-download -s Professional -v 10.0.26200.2483 -t arm64 -r Retail -b Retail -a CB -c ge_release -o C:\\Users\\gus33\\Documents\\GitHub\\WOA-Project\\Reference\\Qualcomm-Reference-Drivers\\TESTING --targeting-manufacturer \"Microsoft Corporation\" --targeting-family \"Surface\" --targeting-productname \"Microsoft Surface Pro, 11th Edition\" --targeting-skunumber \"Surface_Pro_11th_Edition_2076\" --targeting-biosvendor \"Microsoft Corporation\" --targeting-baseboardmanufacturer \"Microsoft Corporation\" --targeting-baseboardproduct \"Microsoft Surface Pro, 11th Edition\" --targeting-enclosuretype \"9\" --targeting-biosversion \"160.2002.235\" --targeting-biosmajorrelease \"ff\" --targeting-biosminorrelease \"ff\" -y --bsp-product-version 200.0.9.0" } } } \ No newline at end of file From bca87f0f42e2ccecd02bcb07dc0c18e5cbbc4ec2 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 19:12:07 +0200 Subject: [PATCH 20/26] Add auto fetch of current computer information --- src/Applications/Playground/Playground.csproj | 1 + .../DriversAuto/ComputerInformationFetcher.cs | 60 ++++++ .../DriversAuto/ProcessDrivers.cs | 182 ++++++++++++++++++ .../Options/BSPDownloadRequestOptions3.cs | 129 +++++++++++++ src/Applications/UUPDownload/Program.cs | 7 +- .../Properties/launchSettings.json | 2 +- .../UUPDownload/UUPDownload.csproj | 1 + 7 files changed, 380 insertions(+), 2 deletions(-) create mode 100644 src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs create mode 100644 src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs create mode 100644 src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs diff --git a/src/Applications/Playground/Playground.csproj b/src/Applications/Playground/Playground.csproj index 4e095025..40c7bdae 100644 --- a/src/Applications/Playground/Playground.csproj +++ b/src/Applications/Playground/Playground.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs new file mode 100644 index 00000000..b6909c77 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs @@ -0,0 +1,60 @@ +using System.Linq; +using Microsoft.Management.Infrastructure.Options; +using Microsoft.Management.Infrastructure; + +namespace UUPDownload.DownloadRequest.DriversAuto +{ + public static class ComputerInformationFetcher + { + public static (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) FetchComputerInformation() + { + using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); + using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + + CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); + + string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; + byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; + byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); + + string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; + string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; + string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); + + ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); + + string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + + return (SystemManufacturer, + SystemFamily, + SystemProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProductName, + SystemEnclosureorChassisType.ToString(), + BIOSVersionString, + SystemBIOSMajorRelease.ToString("X").ToLower(), + SystemBIOSMinorRelease.ToString("X").ToLower()); + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs new file mode 100644 index 00000000..c41cae7e --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs @@ -0,0 +1,182 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; +using UUPDownload.Downloading; +using System.Runtime.InteropServices; + +namespace UUPDownload.DownloadRequest.DriversAuto +{ + public partial class ProcessDrivers + { + public static OSPlatform GetOperatingSystem() + { + return RuntimeInformation.IsOSPlatform(OSPlatform.OSX) + ? OSPlatform.OSX + : RuntimeInformation.IsOSPlatform(OSPlatform.Linux) + ? OSPlatform.Linux + : RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? OSPlatform.Windows + : RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) + ? OSPlatform.FreeBSD + : throw new Exception("Cannot determine operating system!"); + } + + internal static void ParseDownloadOptions(BSPDownloadRequestOptions3 opts) + { + // APIs are only avalable in windows right now. + if (GetOperatingSystem() != OSPlatform.Windows) + { + throw new PlatformNotSupportedException(); + } + + (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); + + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.BSPProductVersion, + Manufacturer, + Family, + ProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProduct, + EnclosureType, + BIOSVersion, + BIOSMajorRelease, + BIOSMinorRelease).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string BSPProductVersion, + string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) + { + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string[] ProductGUIDs = ComputerHardwareID.GenerateHardwareIds(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BaseboardManufacturer, BaseboardProduct, EnclosureType, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease); + + foreach (string ProductGUID in ProductGUIDs) + { + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V={BSPProductVersion}&Source=SMBIOS;"; + } + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = OutputFolder.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + Logging.Log("BSP Product Name: " + compDBs.First().UUPProduct); + Logging.Log("BSP Product Version: " + compDBs.First().UUPProductVersion); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress()); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + } +} diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs new file mode 100644 index 00000000..f889b8e6 --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs @@ -0,0 +1,129 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download3", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions3 + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + + // Used above: + // a + // b + // c + // m + // n + // o + // p + // r + // s + // t + // v + // y + // z + + [Option('d', "bsp-product-version", HelpText = "", Required = false, Default = "0.0.0.0")] + public string BSPProductVersion + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Program.cs b/src/Applications/UUPDownload/Program.cs index 82652c8e..8764418a 100644 --- a/src/Applications/UUPDownload/Program.cs +++ b/src/Applications/UUPDownload/Program.cs @@ -75,7 +75,7 @@ private static int Main(string[] args) { ServicePointManager.DefaultConnectionLimit = int.MaxValue; - return Parser.Default.ParseArguments(args).MapResult( + return Parser.Default.ParseArguments(args).MapResult( (DownloadRequestOptions opts) => { PrintLogo(); @@ -91,6 +91,11 @@ private static int Main(string[] args) PrintLogo(); return WrapAction(() => DownloadRequest.ReferenceDriversRepo.ProcessDrivers.ParseDownloadOptions(opts)); }, + (BSPDownloadRequestOptions3 opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.DriversAuto.ProcessDrivers.ParseDownloadOptions(opts)); + }, (DownloadReplayOptions opts) => { PrintLogo(); diff --git a/src/Applications/UUPDownload/Properties/launchSettings.json b/src/Applications/UUPDownload/Properties/launchSettings.json index f8570037..aba8c7d5 100644 --- a/src/Applications/UUPDownload/Properties/launchSettings.json +++ b/src/Applications/UUPDownload/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "UnifiedUpdatePlatform.Media.Download": { "commandName": "Project", - "commandLineArgs": "request-bsp-download -s Professional -v 10.0.26200.2483 -t arm64 -r Retail -b Retail -a CB -c ge_release -o C:\\Users\\gus33\\Documents\\GitHub\\WOA-Project\\Reference\\Qualcomm-Reference-Drivers\\TESTING --targeting-manufacturer \"Microsoft Corporation\" --targeting-family \"Surface\" --targeting-productname \"Microsoft Surface Pro, 11th Edition\" --targeting-skunumber \"Surface_Pro_11th_Edition_2076\" --targeting-biosvendor \"Microsoft Corporation\" --targeting-baseboardmanufacturer \"Microsoft Corporation\" --targeting-baseboardproduct \"Microsoft Surface Pro, 11th Edition\" --targeting-enclosuretype \"9\" --targeting-biosversion \"160.2002.235\" --targeting-biosmajorrelease \"ff\" --targeting-biosminorrelease \"ff\" -y --bsp-product-version 200.0.9.0" + "commandLineArgs": "request-bsp-download3 -s Professional -v 10.0.26200.2483 -t arm64 -r Retail -b Retail -a CB -c ge_release -o C:\\Users\\gus33\\Documents\\GitHub\\WOA-Project\\Reference\\Qualcomm-Reference-Drivers\\TESTING -y --bsp-product-version 200.0.9.0" } } } \ No newline at end of file diff --git a/src/Applications/UUPDownload/UUPDownload.csproj b/src/Applications/UUPDownload/UUPDownload.csproj index b40157d1..892d52c9 100644 --- a/src/Applications/UUPDownload/UUPDownload.csproj +++ b/src/Applications/UUPDownload/UUPDownload.csproj @@ -27,5 +27,6 @@ + \ No newline at end of file From b4738e47ea1c2e406b335f4888f8e2639e810e71 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 20:34:49 +0200 Subject: [PATCH 21/26] Update folder names used for driver product updates --- UUPMediaCreator.sln | 2 +- publish_win_arm64.cmd | 2 +- .../ComputerHardwareIds.csproj} | 0 .../Program.cs | 0 .../DownloadRequest/Drivers/ProcessDrivers.cs | 12 +++++++++--- .../DownloadRequest/DriversAuto/ProcessDrivers.cs | 13 ++++++++++--- 6 files changed, 21 insertions(+), 8 deletions(-) rename src/Applications/{ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj => ComputerHardwareIds/ComputerHardwareIds.csproj} (100%) rename src/Applications/{ComputerHardwareIds.Windows => ComputerHardwareIds}/Program.cs (100%) diff --git a/UUPMediaCreator.sln b/UUPMediaCreator.sln index 553bc695..bd5a7829 100644 --- a/UUPMediaCreator.sln +++ b/UUPMediaCreator.sln @@ -51,7 +51,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Servi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj", "{95007D84-20A1-4711-9CBC-DEE3B1798E74}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareIds.Windows", "src\Applications\ComputerHardwareIds.Windows\ComputerHardwareIds.Windows.csproj", "{7955FADE-628E-4E41-B48B-350EFB5418E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareIds", "src\Applications\ComputerHardwareIds\ComputerHardwareIds.csproj", "{7955FADE-628E-4E41-B48B-350EFB5418E7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/publish_win_arm64.cmd b/publish_win_arm64.cmd index ed1d257f..afc4f0cc 100644 --- a/publish_win_arm64.cmd +++ b/publish_win_arm64.cmd @@ -1,3 +1,3 @@ @echo off -msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=arm64 /p:RuntimeIdentifier=win-arm64 /p:PublishDir=%CD%\publish\artifacts\win-arm64\CLI /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln \ No newline at end of file +msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish,cli\computerhardwareids:publish /p:Platform=arm64 /p:RuntimeIdentifier=win-arm64 /p:PublishDir=%CD%\publish\artifacts\win-arm64\CLI /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln \ No newline at end of file diff --git a/src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj b/src/Applications/ComputerHardwareIds/ComputerHardwareIds.csproj similarity index 100% rename from src/Applications/ComputerHardwareIds.Windows/ComputerHardwareIds.Windows.csproj rename to src/Applications/ComputerHardwareIds/ComputerHardwareIds.csproj diff --git a/src/Applications/ComputerHardwareIds.Windows/Program.cs b/src/Applications/ComputerHardwareIds/Program.cs similarity index 100% rename from src/Applications/ComputerHardwareIds.Windows/Program.cs rename to src/Applications/ComputerHardwareIds/Program.cs diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs index 980c00e7..ede5d9ea 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -133,10 +133,16 @@ private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, HashSet compDBs = await update.GetCompDBsAsync(); - Logging.Log("BSP Product Name: " + compDBs.First().UUPProduct); - Logging.Log("BSP Product Version: " + compDBs.First().UUPProductVersion); + BaseManifest firstCompDB = compDBs.First(); + string UUPProduct = firstCompDB.UUPProduct; + string UUPProductVersion = firstCompDB.UUPProductVersion; - _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress()); + Logging.Log("BSP Product Name: " + UUPProduct); + Logging.Log("BSP Product Version: " + UUPProductVersion); + + string outputName = Path.Combine(outputFolder, $"{UUPProductVersion}_{UUPProduct}_{update.Xml.UpdateIdentity.UpdateID.Split("-").Last()}"); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputName, MachineType, new ReportProgress(), UseAutomaticDownloadFolder: false); } if (Debugger.IsAttached) diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs index c41cae7e..1fe91236 100644 --- a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs @@ -31,6 +31,7 @@ using UUPDownload.Options; using UUPDownload.Downloading; using System.Runtime.InteropServices; +using System.Text.RegularExpressions; namespace UUPDownload.DownloadRequest.DriversAuto { @@ -165,10 +166,16 @@ private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, HashSet compDBs = await update.GetCompDBsAsync(); - Logging.Log("BSP Product Name: " + compDBs.First().UUPProduct); - Logging.Log("BSP Product Version: " + compDBs.First().UUPProductVersion); + BaseManifest firstCompDB = compDBs.First(); + string UUPProduct = firstCompDB.UUPProduct; + string UUPProductVersion = firstCompDB.UUPProductVersion; - _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress()); + Logging.Log("BSP Product Name: " + UUPProduct); + Logging.Log("BSP Product Version: " + UUPProductVersion); + + string outputName = Path.Combine(outputFolder, $"{UUPProductVersion}_{UUPProduct}_{update.Xml.UpdateIdentity.UpdateID.Split("-").Last()}"); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputName, MachineType, new ReportProgress(), UseAutomaticDownloadFolder: false); } if (Debugger.IsAttached) From 36b2e34b4d166aab8167b5a3d79caf06db3b4d9b Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 20:42:40 +0200 Subject: [PATCH 22/26] Cleanup CHID tool code --- .../ComputerInformationFetcher.cs | 59 +++++++++++ .../ComputerHardwareIds/Program.cs | 100 +++++++++--------- 2 files changed, 109 insertions(+), 50 deletions(-) create mode 100644 src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs diff --git a/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs new file mode 100644 index 00000000..03800975 --- /dev/null +++ b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs @@ -0,0 +1,59 @@ +using Microsoft.Management.Infrastructure.Options; +using Microsoft.Management.Infrastructure; + +namespace ComputerHardwareIds +{ + public static class ComputerInformationFetcher + { + public static (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) FetchComputerInformation() + { + using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); + using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + + CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); + + string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; + byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; + byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); + + string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; + string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; + string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); + + ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); + + string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + + return (SystemManufacturer, + SystemFamily, + SystemProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProductName, + SystemEnclosureorChassisType, + BIOSVersionString, + SystemBIOSMajorRelease, + SystemBIOSMinorRelease); + } + } +} diff --git a/src/Applications/ComputerHardwareIds/Program.cs b/src/Applications/ComputerHardwareIds/Program.cs index e2913308..e1d5fd50 100644 --- a/src/Applications/ComputerHardwareIds/Program.cs +++ b/src/Applications/ComputerHardwareIds/Program.cs @@ -1,6 +1,4 @@ -using Microsoft.Management.Infrastructure.Options; -using Microsoft.Management.Infrastructure; -using System.Diagnostics; +using System.Diagnostics; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace ComputerHardwareIds @@ -12,31 +10,33 @@ public static void Main(string[] _) Process currentProcess = Process.GetCurrentProcess(); ProcessModule MainModule = currentProcess.MainModule!; - using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); - using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); - CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); - - string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; - string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; - byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; - byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; - - result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); - - string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; - string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; - string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; - string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; - - result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); - - ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; - - result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); - - string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; - string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + string HardwareId1 = ComputerHardwareID.GenerateHardwareId1(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId2 = ComputerHardwareID.GenerateHardwareId2(Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId3 = ComputerHardwareID.GenerateHardwareId3(Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId4 = ComputerHardwareID.GenerateHardwareId4(Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct); + string HardwareId5 = ComputerHardwareID.GenerateHardwareId5(Manufacturer, Family, ProductName, SKUNumber); + string HardwareId6 = ComputerHardwareID.GenerateHardwareId6(Manufacturer, Family, ProductName); + string HardwareId7 = ComputerHardwareID.GenerateHardwareId7(Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct); + string HardwareId8 = ComputerHardwareID.GenerateHardwareId8(Manufacturer, SKUNumber); + string HardwareId9 = ComputerHardwareID.GenerateHardwareId9(Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct); + string HardwareId10 = ComputerHardwareID.GenerateHardwareId10(Manufacturer, ProductName); + string HardwareId11 = ComputerHardwareID.GenerateHardwareId11(Manufacturer, Family, BaseboardManufacturer, BaseboardProduct); + string HardwareId12 = ComputerHardwareID.GenerateHardwareId12(Manufacturer, Family); + string HardwareId13 = ComputerHardwareID.GenerateHardwareId13(Manufacturer, EnclosureType.ToString()); + string HardwareId14 = ComputerHardwareID.GenerateHardwareId14(Manufacturer, BaseboardManufacturer, BaseboardProduct); + string HardwareId15 = ComputerHardwareID.GenerateHardwareId15(Manufacturer); Console.WriteLine("Using the BIOS to gather information"); Console.WriteLine(); @@ -48,38 +48,38 @@ public static void Main(string[] _) Console.WriteLine("Computer Information"); Console.WriteLine("--------------------"); Console.WriteLine($"BIOS Vendor: {BIOSVendor}"); - Console.WriteLine($"BIOS Version String: {BIOSVersionString}"); - Console.WriteLine($"System BIOS Major Release: {SystemBIOSMajorRelease}"); - Console.WriteLine($"System BIOS Minor Release: {SystemBIOSMinorRelease}"); + Console.WriteLine($"BIOS Version String: {BIOSVersion}"); + Console.WriteLine($"System BIOS Major Release: {BIOSMajorRelease}"); + Console.WriteLine($"System BIOS Minor Release: {BIOSMinorRelease}"); Console.WriteLine(); - Console.WriteLine($"System Manufacturer: {SystemManufacturer}"); - Console.WriteLine($"System Family: {SystemFamily}"); - Console.WriteLine($"System Product Name: {SystemProductName}"); + Console.WriteLine($"System Manufacturer: {Manufacturer}"); + Console.WriteLine($"System Family: {Family}"); + Console.WriteLine($"System Product Name: {ProductName}"); Console.WriteLine($"SKU Number: {SKUNumber}"); Console.WriteLine(); - Console.WriteLine($"System Enclosure or Chassis Type: {SystemEnclosureorChassisType:X2}h"); + Console.WriteLine($"System Enclosure or Chassis Type: {EnclosureType:X2}h"); Console.WriteLine(); Console.WriteLine($"Baseboard Manufacturer: {BaseboardManufacturer}"); - Console.WriteLine($"Baseboard Product Name: {BaseboardProductName}"); + Console.WriteLine($"Baseboard Product Name: {BaseboardProduct}"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Hardware IDs"); Console.WriteLine("------------"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId1(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + Family + ProductName + SKUNumber + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId2(SystemManufacturer, SystemFamily, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + Family + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId3(SystemManufacturer, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease.ToString("X").ToLower(), SystemBIOSMinorRelease.ToString("X").ToLower())} <- Manufacturer + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId4(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Family + ProductName + SKUNumber + Baseboard Manufacturer + Baseboard Product"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId5(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber)} <- Manufacturer + Family + ProductName + SKUNumber"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId6(SystemManufacturer, SystemFamily, SystemProductName)} <- Manufacturer + Family + ProductName"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId7(SystemManufacturer, SKUNumber, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + SKUNumber + Baseboard Manufacturer + Baseboard Product"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId8(SystemManufacturer, SKUNumber)} <- Manufacturer + SKUNumber"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId9(SystemManufacturer, SystemProductName, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + ProductName + Baseboard Manufacturer + Baseboard Product"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId10(SystemManufacturer, SystemProductName)} <- Manufacturer + ProductName"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId11(SystemManufacturer, SystemFamily, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Family + Baseboard Manufacturer + Baseboard Product"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId12(SystemManufacturer, SystemFamily)} <- Manufacturer + Family"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId13(SystemManufacturer, SystemEnclosureorChassisType.ToString())} <- Manufacturer + Enclosure Type"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId14(SystemManufacturer, BaseboardManufacturer, BaseboardProductName)} <- Manufacturer + Baseboard Manufacturer + Baseboard Product"); - Console.WriteLine($"{ComputerHardwareID.GenerateHardwareId15(SystemManufacturer)} <- Manufacturer"); + Console.WriteLine($"{HardwareId1} <- Manufacturer + Family + ProductName + SKUNumber + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId2} <- Manufacturer + Family + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId3} <- Manufacturer + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId4} <- Manufacturer + Family + ProductName + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId5} <- Manufacturer + Family + ProductName + SKUNumber"); + Console.WriteLine($"{HardwareId6} <- Manufacturer + Family + ProductName"); + Console.WriteLine($"{HardwareId7} <- Manufacturer + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId8} <- Manufacturer + SKUNumber"); + Console.WriteLine($"{HardwareId9} <- Manufacturer + ProductName + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId10} <- Manufacturer + ProductName"); + Console.WriteLine($"{HardwareId11} <- Manufacturer + Family + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId12} <- Manufacturer + Family"); + Console.WriteLine($"{HardwareId13} <- Manufacturer + Enclosure Type"); + Console.WriteLine($"{HardwareId14} <- Manufacturer + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId15} <- Manufacturer"); } } } \ No newline at end of file From 57350a261e48eefb79439bb850f5b05cdf534480 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 20:44:15 +0200 Subject: [PATCH 23/26] Sync CHID auto fetch code --- .../DriversAuto/ComputerInformationFetcher.cs | 12 ++++++------ .../DownloadRequest/DriversAuto/ProcessDrivers.cs | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs index b6909c77..2dac58f2 100644 --- a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs @@ -13,10 +13,10 @@ public static (string Manufacturer, string BIOSVendor, string BaseboardManufacturer, string BaseboardProduct, - string EnclosureType, + ushort EnclosureType, string BIOSVersion, - string BIOSMajorRelease, - string BIOSMinorRelease) FetchComputerInformation() + byte BIOSMajorRelease, + byte BIOSMinorRelease) FetchComputerInformation() { using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); @@ -51,10 +51,10 @@ public static (string Manufacturer, BIOSVendor, BaseboardManufacturer, BaseboardProductName, - SystemEnclosureorChassisType.ToString(), + SystemEnclosureorChassisType, BIOSVersionString, - SystemBIOSMajorRelease.ToString("X").ToLower(), - SystemBIOSMinorRelease.ToString("X").ToLower()); + SystemBIOSMajorRelease, + SystemBIOSMinorRelease); } } } diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs index 1fe91236..a1075aea 100644 --- a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs @@ -31,7 +31,6 @@ using UUPDownload.Options; using UUPDownload.Downloading; using System.Runtime.InteropServices; -using System.Text.RegularExpressions; namespace UUPDownload.DownloadRequest.DriversAuto { @@ -65,10 +64,10 @@ internal static void ParseDownloadOptions(BSPDownloadRequestOptions3 opts) string BIOSVendor, string BaseboardManufacturer, string BaseboardProduct, - string EnclosureType, + ushort EnclosureType, string BIOSVersion, - string BIOSMajorRelease, - string BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); + byte BIOSMajorRelease, + byte BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); CheckAndDownloadUpdates( opts.ReportingSku, @@ -92,10 +91,10 @@ internal static void ParseDownloadOptions(BSPDownloadRequestOptions3 opts) BIOSVendor, BaseboardManufacturer, BaseboardProduct, - EnclosureType, + EnclosureType.ToString(), BIOSVersion, - BIOSMajorRelease, - BIOSMinorRelease).Wait(); + BIOSMajorRelease.ToString("X").ToLower(), + BIOSMinorRelease.ToString("X").ToLower()).Wait(); } private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, From b051b7a9787f51235a8163f703eea7b8b859f4b7 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sat, 7 Sep 2024 21:10:31 +0200 Subject: [PATCH 24/26] Cleanup --- .../ComputerHardwareIds/ComputerInformationFetcher.cs | 6 +++--- .../UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs | 2 +- .../DriversAuto/ComputerInformationFetcher.cs | 6 +++--- .../DownloadRequest/DriversAuto/ProcessDrivers.cs | 4 ++-- src/Applications/UUPDownload/DownloadRequest/Process.cs | 2 +- .../ProcessDrivers.GenerateChangelog.cs | 1 - .../DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs | 2 +- .../DownloadHelpers.cs | 6 +++++- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs index 03800975..02221d92 100644 --- a/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs +++ b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs @@ -1,5 +1,5 @@ -using Microsoft.Management.Infrastructure.Options; -using Microsoft.Management.Infrastructure; +using Microsoft.Management.Infrastructure; +using Microsoft.Management.Infrastructure.Options; namespace ComputerHardwareIds { @@ -17,7 +17,7 @@ public static (string Manufacturer, byte BIOSMajorRelease, byte BIOSMinorRelease) FetchComputerInformation() { - using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); + using DComSessionOptions dcomSessionOptions = new(); using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs index ede5d9ea..9c7e9303 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -28,8 +28,8 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -using UUPDownload.Options; using UUPDownload.Downloading; +using UUPDownload.Options; namespace UUPDownload.DownloadRequest.Drivers { diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs index 2dac58f2..eab37a13 100644 --- a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs @@ -1,6 +1,6 @@ -using System.Linq; +using Microsoft.Management.Infrastructure; using Microsoft.Management.Infrastructure.Options; -using Microsoft.Management.Infrastructure; +using System.Linq; namespace UUPDownload.DownloadRequest.DriversAuto { @@ -18,7 +18,7 @@ public static (string Manufacturer, byte BIOSMajorRelease, byte BIOSMinorRelease) FetchComputerInformation() { - using DComSessionOptions dcomSessionOptions = new DComSessionOptions(); + using DComSessionOptions dcomSessionOptions = new(); using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs index a1075aea..a1c6e8af 100644 --- a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs @@ -24,13 +24,13 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -using UUPDownload.Options; using UUPDownload.Downloading; -using System.Runtime.InteropServices; +using UUPDownload.Options; namespace UUPDownload.DownloadRequest.DriversAuto { diff --git a/src/Applications/UUPDownload/DownloadRequest/Process.cs b/src/Applications/UUPDownload/DownloadRequest/Process.cs index 593df6f8..c7695f23 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Process.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Process.cs @@ -31,8 +31,8 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -using UUPDownload.Options; using UUPDownload.Downloading; +using UUPDownload.Options; namespace UUPDownload.DownloadRequest { diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs index 0ac07bee..0ea2e6d0 100644 --- a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs index 9e62c931..ebfb3bf2 100644 --- a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs @@ -28,8 +28,8 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -using UUPDownload.Options; using UUPDownload.Downloading; +using UUPDownload.Options; namespace UUPDownload.DownloadRequest.ReferenceDriversRepo { diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index e81a2423..f051e80b 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -578,7 +578,11 @@ await Task.WhenAll( (HashSet payloadItems, HashSet bannedPayloadItems) = BuildListOfPayloads(compDBs, Edition, Language); - JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions() { WriteIndented = true, IncludeFields = true }; + JsonSerializerOptions jsonSerializerOptions = new() + { + WriteIndented = true, + IncludeFields = true + }; do { From 05ae0a205512a5aab1cf9ff44c46808a87f38e28 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Tue, 17 Sep 2024 19:31:32 +0200 Subject: [PATCH 25/26] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ada8939..53a5c1d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Build CLI utilities shell: pwsh run: | - msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=${{ matrix.architecture }} /p:RuntimeIdentifier=${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishDir=${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }}/CLIs /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln + msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=${{ matrix.architecture }} /p:RuntimeIdentifier=${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishDir=${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }}/CLIs /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release /p:IncludeNativeLibrariesForSelfExtract=true UUPMediaCreator.sln - name: Create PDB Output Directory shell: pwsh From 8c91b0afd77660081e77308ab1e1e3895c6ba904 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Fri, 11 Oct 2024 12:55:41 +0200 Subject: [PATCH 26/26] Add configuration for RUN --- src/Applications/UUPDownload/DriverConfig.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Applications/UUPDownload/DriverConfig.json b/src/Applications/UUPDownload/DriverConfig.json index bbf7a786..848d94d2 100644 --- a/src/Applications/UUPDownload/DriverConfig.json +++ b/src/Applications/UUPDownload/DriverConfig.json @@ -73,6 +73,16 @@ "Product": "CRD", "Sku": "6" }, + { + "outputFolder": "\\8380_RUN", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_HAMOA", + "Product": "Snapdragon-Devkit", + "Sku": "6" + }, { "outputFolder": "\\8380PA_CRD", "guid": null,