コード例 #1
0
        public NetSdkMsiInstallerClient(InstallElevationContextBase elevationContext,
                                        ISetupLogger logger,
                                        IWorkloadResolver workloadResolver,
                                        SdkFeatureBand sdkFeatureBand,
                                        INuGetPackageDownloader nugetPackageDownloader = null,
                                        VerbosityOptions verbosity = VerbosityOptions.normal,
                                        PackageSourceLocation packageSourceLocation = null,
                                        IReporter reporter = null) : base(elevationContext, logger, reporter)
        {
            _packageSourceLocation  = packageSourceLocation;
            _nugetPackageDownloader = nugetPackageDownloader;
            _sdkFeatureBand         = sdkFeatureBand;
            _workloadResolver       = workloadResolver;
            _dependent = $"{DependentPrefix},{sdkFeatureBand},{HostArchitecture}";

            Log?.LogMessage($"Executing: {CurrentProcess.GetCommandLine()}, PID: {CurrentProcess.Id}, PPID: {ParentProcess.Id}");
            Log?.LogMessage($"{nameof(IsElevated)}: {IsElevated}");
            Log?.LogMessage($"{nameof(Is64BitProcess)}: {Is64BitProcess}");
            Log?.LogMessage($"{nameof(RebootPending)}: {RebootPending}");
            Log?.LogMessage($"{nameof(ProcessorArchitecture)}: {ProcessorArchitecture}");
            Log?.LogMessage($"{nameof(HostArchitecture)}: {HostArchitecture}");
            Log?.LogMessage($"{nameof(SdkDirectory)}: {SdkDirectory}");
            Log?.LogMessage($"SDK feature band: {_sdkFeatureBand}");

            if (IsElevated)
            {
                // Turn off automatic updates. We don't want MU to potentially patch the SDK
                // and it also reduces the risk of hitting ERROR_INSTALL_ALREADY_RUNNING.
                UpdateAgent.Stop();
            }
        }
コード例 #2
0
ファイル: MsiPackageCache.cs プロジェクト: VSadov/sdk
 public MsiPackageCache(InstallElevationContextBase elevationContext, ISetupLogger logger,
                        string packageCacheRoot = null) : base(elevationContext, logger)
 {
     PackageCacheRoot = string.IsNullOrWhiteSpace(packageCacheRoot)
         ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads")
         : packageCacheRoot;
 }
コード例 #3
0
 /// <summary>
 /// Creates a new <see cref="MsiInstallerBase"/> instance.
 /// </summary>
 /// <param name="dispatcher">The command dispatcher used for sending and receiving commands.</param>
 /// <param name="logger"></param>
 /// <param name="reporter"></param>
 public MsiInstallerBase(InstallElevationContextBase elevationContext, ISetupLogger logger,
                         IReporter reporter = null) : base(elevationContext, logger)
 {
     Cache            = new MsiPackageCache(elevationContext, logger);
     RecordRepository = new RegistryWorkloadInstallationRecordRepository(elevationContext, logger);
     UpdateAgent      = new WindowsUpdateAgent(logger);
     Reporter         = reporter;
 }
コード例 #4
0
 public BridgeLogger(ISetupLogger setupLogger)
 {
     if (setupLogger == null)
     {
         throw new ArgumentNullException();
     }
     this.logger = setupLogger;
 }
コード例 #5
0
        public SetupCustomActions(ISetupLogger logger)
        {
            var settingsProviderHelper = new SmartShipmentsSettingsHelper();

            _settingsHelper = new SettingsSetupHelper(settingsProviderHelper, logger);
            _upsHelper      = new UpsSetupHelper(settingsProviderHelper, logger);
            _fedexHelper    = new FedexSetupHelper(settingsProviderHelper, logger);
        }
コード例 #6
0
        public UpsSetupHelper(SmartShipmentsSettingsHelper settingsProviderHelper, ISetupLogger logger)
        {
            _settingsProviderHelper = settingsProviderHelper;
            _logger = logger;

            _upsShipmentAppConfigDirectoryLocation = GetUpsRegistryApplicationConfigDirectoryLocation();
            _upsShipmentImpExpFilePath             = Path.Combine(GetUpsRegistryDataDirectoryLocation(), UPS_BASE_DATA_PATH, "UPSOUT.dat");
        }
        static SmartShipmentWiXCustomActions()
        {
            //If debug needed- uncomment bellow line
            //System.Diagnostics.Debugger.Launch();

            _logger = new SetupLogger();
            _customActionsHelper = new SetupCustomActions(_logger);
        }
コード例 #8
0
        public SmartShipmentInstaller()
        {
            #if DEBUG
            System.Diagnostics.Debugger.Launch();
            #endif

            InitializeComponent();
            _logger        = new SetupLogger();
            _customActions = new SetupCustomActions(_logger);
        }
コード例 #9
0
        /// <summary>
        /// Creates a new <see cref="WindowsUpdateAgent"/> instance.
        /// </summary>
        /// <param name="logger">The <see cref="ISetupLogger"/> to write to.</param>
        public WindowsUpdateAgent(ISetupLogger logger)
        {
            _wuauserv = ServiceController.GetServices().Where(s => string.Equals(s.ServiceName, "wuauserv")).FirstOrDefault();
            _log      = logger;

            if (_wuauserv == null)
            {
                _log?.LogMessage("Unable to locate wuaserv.");
            }
        }
 public FedexSetupHelper(ISmartShipmentsSettingsHelper settingsProviderHelper, ISetupLogger logger)
 {
     _settingsProviderHelper = settingsProviderHelper;
     _logger = logger;
 }
コード例 #11
0
 internal RegistryWorkloadInstallationRecordRepository(InstallElevationContextBase elevationContext, ISetupLogger logger,
                                                       RegistryKey baseKey, string basePath)
     : this(elevationContext, logger)
 {
     _baseKey = baseKey;
     BasePath = basePath;
 }
コード例 #12
0
 internal RegistryWorkloadInstallationRecordRepository(InstallElevationContextBase elevationContext, ISetupLogger logger)
     : base(elevationContext, logger)
 {
 }
コード例 #13
0
ファイル: InstallerBase.cs プロジェクト: agocke/sdk
 /// <summary>
 /// Creates a new <see cref="InstallerBase"/> instance using the specified elevation context and logger.
 /// </summary>
 /// <param name="elevationContext"></param>
 /// <param name="logger"></param>
 protected InstallerBase(InstallElevationContextBase elevationContext, ISetupLogger logger)
 {
     ElevationContext = elevationContext;
     Log = logger;
 }
コード例 #14
0
ファイル: InstallerBase.cs プロジェクト: nohwnd/sdk
 /// <summary>
 /// Creates a new <see cref="InstallerBase"/> instance using the specified elevation context and logger.
 /// </summary>
 /// <param name="elevationContext"></param>
 /// <param name="logger"></param>
 /// <param name="verifySignatures"></param>
 protected InstallerBase(InstallElevationContextBase elevationContext, ISetupLogger logger, bool verifySignatures)
 {
     ElevationContext = elevationContext;
     Log = logger;
     VerifySignatures = verifySignatures;
 }