ManifestInstaller.h (3703B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <AppInstallerArchitecture.h> 5 #include <AppInstallerStrings.h> 6 #include <winget/Authentication.h> 7 #include <winget/ManifestCommon.h> 8 9 #include <map> 10 #include <string> 11 12 namespace AppInstaller::Manifest 13 { 14 using namespace std::string_view_literals; 15 16 // Token specified in installer args will be replaced by proper value. 17 static constexpr std::string_view ARG_TOKEN_LOGPATH = "<LOGPATH>"sv; 18 static constexpr std::string_view ARG_TOKEN_INSTALLPATH = "<INSTALLPATH>"sv; 19 20 struct ManifestInstaller 21 { 22 using string_t = Utility::NormalizedString; 23 24 AppInstaller::Utility::Architecture Arch = AppInstaller::Utility::Architecture::Unknown; 25 26 string_t Url; 27 28 std::vector<BYTE> Sha256; 29 30 // Optional. Only used by appx/msix type. If provided, Appinstaller will 31 // validate appx/msix signature and perform streaming install. 32 std::vector<BYTE> SignatureSha256; 33 34 // Store Product Id 35 string_t ProductId; 36 37 string_t Locale; 38 39 std::vector<PlatformEnum> Platform; 40 41 string_t MinOSVersion; 42 43 // If present, has more precedence than root 44 InstallerTypeEnum BaseInstallerType = InstallerTypeEnum::Unknown; 45 46 InstallerTypeEnum NestedInstallerType = InstallerTypeEnum::Unknown; 47 48 InstallerTypeEnum EffectiveInstallerType() const 49 { 50 return IsArchiveType(BaseInstallerType) ? NestedInstallerType : BaseInstallerType; 51 } 52 53 std::vector<NestedInstallerFile> NestedInstallerFiles; 54 55 ScopeEnum Scope = ScopeEnum::Unknown; 56 57 std::vector<InstallModeEnum> InstallModes; 58 59 // If present, has more precedence than root 60 std::map<InstallerSwitchType, string_t> Switches; 61 62 std::vector<DWORD> InstallerSuccessCodes; 63 64 struct ExpectedReturnCodeInfo 65 { 66 ExpectedReturnCodeEnum ReturnResponseEnum = ExpectedReturnCodeEnum::Unknown; 67 string_t ReturnResponseUrl; 68 }; 69 70 std::map<DWORD, ExpectedReturnCodeInfo> ExpectedReturnCodes; 71 72 UpdateBehaviorEnum UpdateBehavior = UpdateBehaviorEnum::Install; 73 74 RepairBehaviorEnum RepairBehavior = RepairBehaviorEnum::Unknown; 75 76 std::vector<string_t> Commands; 77 78 std::vector<string_t> Protocols; 79 80 std::vector<string_t> FileExtensions; 81 82 // Package family name for MSIX packaged installers. 83 string_t PackageFamilyName; 84 85 // Product code for ARP (Add/Remove Programs) installers. 86 string_t ProductCode; 87 88 // For msix only 89 std::vector<string_t> Capabilities; 90 91 // For msix only 92 std::vector<string_t> RestrictedCapabilities; 93 94 DependencyList Dependencies; 95 96 bool InstallerAbortsTerminal = false; 97 98 string_t ReleaseDate; 99 100 bool InstallLocationRequired = false; 101 102 bool RequireExplicitUpgrade = false; 103 104 bool DisplayInstallWarnings = false; 105 106 std::vector<UnsupportedArgumentEnum> UnsupportedArguments; 107 108 std::vector<AppInstaller::Utility::Architecture> UnsupportedOSArchitectures; 109 110 std::vector<AppsAndFeaturesEntry> AppsAndFeaturesEntries; 111 112 ElevationRequirementEnum ElevationRequirement = ElevationRequirementEnum::Unknown; 113 114 MarketsInfo Markets; 115 116 InstallationMetadataInfo InstallationMetadata; 117 118 bool DownloadCommandProhibited = false; 119 120 bool ArchiveBinariesDependOnPath = false; 121 122 Authentication::AuthenticationInfo AuthInfo; 123 }; 124 }