winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

InstallOptions.cpp (5815B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #include "pch.h"
      4 #pragma warning( push )
      5 #pragma warning ( disable : 4467 6388)
      6 // 6388 Allow CreateInstance.
      7 #include <wil\cppwinrt_wrl.h>
      8 // 4467 Allow use of uuid attribute for com object creation.
      9 #include "InstallOptions.h"
     10 #pragma warning( pop )
     11 #include "InstallOptions.g.cpp"
     12 #include "Converters.h"
     13 #include "Helpers.h"
     14 
     15 #include <AppInstallerArchitecture.h>
     16 
     17 namespace winrt::Microsoft::Management::Deployment::implementation
     18 {
     19     InstallOptions::InstallOptions()
     20     {
     21         // Populate the allowed architectures with the default values for the machine
     22         for (AppInstaller::Utility::Architecture architecture : AppInstaller::Utility::GetApplicableArchitectures())
     23         {
     24             auto convertedArchitecture = GetWindowsSystemProcessorArchitecture(architecture);
     25             if (convertedArchitecture)
     26             {
     27                 m_allowedArchitectures.Append(convertedArchitecture.value());
     28             }
     29         }
     30     }
     31     winrt::Microsoft::Management::Deployment::PackageVersionId InstallOptions::PackageVersionId()
     32     {
     33         return m_packageVersionId;
     34     }
     35     void InstallOptions::PackageVersionId(winrt::Microsoft::Management::Deployment::PackageVersionId const& value)
     36     {
     37         m_packageVersionId = value;
     38     }
     39     hstring InstallOptions::PreferredInstallLocation()
     40     {
     41         return hstring(m_preferredInstallLocation);
     42     }
     43     void InstallOptions::PreferredInstallLocation(hstring const& value)
     44     {
     45         m_preferredInstallLocation = value;
     46     }
     47     winrt::Microsoft::Management::Deployment::PackageInstallScope InstallOptions::PackageInstallScope()
     48     {
     49         return m_packageInstallScope;
     50     }
     51     void InstallOptions::PackageInstallScope(winrt::Microsoft::Management::Deployment::PackageInstallScope const& value)
     52     {
     53         m_packageInstallScope = value;
     54     }
     55     winrt::Microsoft::Management::Deployment::PackageInstallMode InstallOptions::PackageInstallMode()
     56     {
     57         return m_packageInstallMode;
     58     }
     59     void InstallOptions::PackageInstallMode(winrt::Microsoft::Management::Deployment::PackageInstallMode const& value)
     60     {
     61         m_packageInstallMode = value;
     62     }
     63     winrt::Microsoft::Management::Deployment::PackageInstallerType InstallOptions::InstallerType()
     64     {
     65         return m_installerType;
     66     }
     67     void InstallOptions::InstallerType(winrt::Microsoft::Management::Deployment::PackageInstallerType const& value)
     68     {
     69         m_installerType = value;
     70     }
     71     hstring InstallOptions::LogOutputPath()
     72     {
     73         return hstring(m_logOutputPath);
     74     }
     75     void InstallOptions::LogOutputPath(hstring const& value)
     76     {
     77         m_logOutputPath = value;
     78     }
     79     bool InstallOptions::AllowHashMismatch()
     80     {
     81         return m_allowHashMismatch;
     82     }
     83     void InstallOptions::AllowHashMismatch(bool value)
     84     {
     85         m_allowHashMismatch = value;
     86     }
     87     bool InstallOptions::BypassIsStoreClientBlockedPolicyCheck()
     88     {
     89         return m_bypassIsStoreClientBlockedPolicyCheck;
     90     }
     91     void InstallOptions::BypassIsStoreClientBlockedPolicyCheck(bool value)
     92     {
     93         m_bypassIsStoreClientBlockedPolicyCheck = value;
     94     }
     95     hstring InstallOptions::ReplacementInstallerArguments()
     96     {
     97         return hstring(m_replacementInstallerArguments);
     98     }
     99     void InstallOptions::ReplacementInstallerArguments(hstring const& value)
    100     {
    101         m_replacementInstallerArguments = value;
    102     }
    103     hstring InstallOptions::AdditionalInstallerArguments()
    104     {
    105         return hstring(m_additionalInstallerArguments);
    106     }
    107     void InstallOptions::AdditionalInstallerArguments(hstring const& value)
    108     {
    109         m_additionalInstallerArguments = value;
    110     }
    111     hstring InstallOptions::CorrelationData()
    112     {
    113         return hstring(m_correlationData);
    114     }
    115     void InstallOptions::CorrelationData(hstring const& value)
    116     {
    117         m_correlationData = value;
    118     }
    119     hstring InstallOptions::AdditionalPackageCatalogArguments()
    120     {
    121         return hstring(m_additionalPackageCatalogArguments);
    122     }
    123     void InstallOptions::AdditionalPackageCatalogArguments(hstring const& value)
    124     {
    125         m_additionalPackageCatalogArguments = value;
    126     }
    127     winrt::Windows::Foundation::Collections::IVector<winrt::Windows::System::ProcessorArchitecture> InstallOptions::AllowedArchitectures()
    128     {
    129         return m_allowedArchitectures;
    130     }
    131     bool InstallOptions::AllowUpgradeToUnknownVersion()
    132     {
    133         return m_allowUpgradeToUnknownVersion;
    134     }
    135     void InstallOptions::AllowUpgradeToUnknownVersion(bool value)
    136     {
    137         m_allowUpgradeToUnknownVersion = value;
    138     }
    139     bool InstallOptions::Force()
    140     {
    141         return m_force;
    142     }
    143     void InstallOptions::Force(bool value)
    144     {
    145         m_force = value;
    146     }
    147     void InstallOptions::AcceptPackageAgreements(bool value)
    148     {
    149         m_acceptPackageAgreements = value;
    150     }
    151     bool InstallOptions::AcceptPackageAgreements()
    152     {
    153         return m_acceptPackageAgreements;
    154     }
    155     void InstallOptions::SkipDependencies(bool value)
    156     {
    157         m_skipDependencies = value;
    158     }
    159     bool InstallOptions::SkipDependencies()
    160     {
    161         return m_skipDependencies;
    162     }
    163     winrt::Microsoft::Management::Deployment::AuthenticationArguments InstallOptions::AuthenticationArguments()
    164     {
    165         return m_authenticationArguments;
    166     }
    167     void InstallOptions::AuthenticationArguments(winrt::Microsoft::Management::Deployment::AuthenticationArguments const& value)
    168     {
    169         m_authenticationArguments = value;
    170     }
    171     CoCreatableMicrosoftManagementDeploymentClass(InstallOptions);
    172 }