protected void Page_Load(object sender, EventArgs e) { try { iProcessManager = ServiceAgent.getInstance().GetMaintainObjectByName<IProcessManager>(WebConstant.IProcessManager); if (!this.IsPostBack) { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); HttpRuntimeSection section = (HttpRuntimeSection)config.GetSection("system.web/httpRuntime"); double maxFileSize = Math.Round(section.MaxRequestLength / 1024.0, 1); this.hidFileMaxSize.Value = maxFileSize.ToString(); this.Title = this.GetLocalResourceObject(Pre + "_title").ToString(); initLabel(); userName = Request.QueryString["userName"]; userName = StringUtil.decode_URL(userName); this.HiddenUserName.Value = userName; } pmtMessage1 = this.GetLocalResourceObject(Pre + "_pmtMessage1").ToString(); this.hidMsg1.Value = pmtMessage1; } catch (FisException ex) { showErrorMessage(ex.mErrmsg); } catch (Exception ex) { showErrorMessage(ex.Message); } }
public SettingsViewModel( IRegistryManager registryManager, IProcessManager processManager) { this.registryManager = registryManager; this.processManager = processManager; }
public StartupPreparationOperation( IProcessManager processManager, IAggregateArgumentProcessor aggregateArgumentProcessor) { this.processManager = processManager; this.aggregateArgumentProcessor = aggregateArgumentProcessor; }
public void Init() { _processManager = A.Fake<IProcessManager>(); _settings = new XmlConfig.XmlConfig(); _builder = new CommandBuilder(_processManager); }
public ToolsServices(IProcessManager pm, Lazy<IWCFClient> wcfClient, ICompressionUtil compression, IUacHelper uacHelper) { Compression = compression; UacHelper = uacHelper; ProcessManager = pm; WCFClient = wcfClient; }
public IronFrontInstaller(IProcessManager processManager, PboTools pboTools, Func<IMirrorSelector, ExportLifetimeContext<IMultiMirrorFileDownloader>> createMultiMirrorFileDownloader, Func<int, IReadOnlyCollection<Uri>, ExportLifetimeContext<IMirrorSelector>> createMirrorSelectorWithLimit) { _processManager = processManager; _pboTools = pboTools; _createMultiMirrorFileDownloader = createMultiMirrorFileDownloader; _createMirrorSelectorWithLimit = createMirrorSelectorWithLimit; }
public ResponseTF() { processManager = MainDescription.MainFrm.PluginDictionary["模块管理"] as IProcessManager; // var defaultcraw = processManager.CurrentProcessCollections.FirstOrDefault(d => d is SmartCrawler); OneOutput = false; //if (defaultcraw != null) CrawlerSelector = defaultcraw.Name; PropertyChanged += (s, e) => { buffHelper.Clear(); }; }
public ProcessMenu(IProcessManager processManager) : base(processManager.Name) { this.ProcessManager = processManager; this.StartItem = this.DropDownItems.Add("Start", Resources.Start); this.StopItem = this.DropDownItems.Add("Stop", Resources.Stop); this.RestartItem = this.DropDownItems.Add("Restart", Resources.Restart); this.Refresh(); }
public OpenLinkAction( ILinkParser linkParser, IProcessManager processManager, IAsyncFilter asyncFilter) { this.linkParser = linkParser; this.processManager = processManager; this.asyncFilter = asyncFilter; }
public void Init() { _process = A.Fake<IProcessWrapper>(); _processManager = A.Fake<IProcessManager>(); A.CallTo(() => _processManager.GetProcess(Executable, Parameters)).Returns(_process); A.CallTo(() => _process.Start()).Invokes(x => InitStartInternalUpdates()).Returns(true); _command = new Command(_processManager, Name, Executable, Parameters, KillChildren); }
public RsyncLauncher(IProcessManager processManager, IPathConfiguration configuration, RsyncOutputParser parser) { if (processManager == null) throw new ArgumentNullException(nameof(processManager)); if (configuration == null) throw new ArgumentNullException(nameof(configuration)); _processManager = processManager; _parser = parser; _binPath = configuration.ToolCygwinBinPath.GetChildFileWithName("rsync.exe"); _sshBinPath = configuration.ToolCygwinBinPath.GetChildFileWithName("ssh.exe"); }
public ZsyncLauncher(IProcessManager processManager, IPathConfiguration configuration, ZsyncOutputParser parser, IAuthProvider authProvider) { if (processManager == null) throw new ArgumentNullException("processManager"); if (configuration == null) throw new ArgumentNullException("configuration"); _authProvider = authProvider; _processManager = processManager; _parser = parser; _binPath = configuration.ToolCygwinBinPath.GetChildFileWithName("zsync.exe"); }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; }
/// <summary> /// Create a service's command. /// </summary> /// <param name="manager">Process manager</param> /// <param name="name">Descriptive name of the command</param> /// <param name="executable">Fullpath to the _executable/command that is run as service</param> /// <param name="parameters">List of commandline parameters</param> /// <param name="killChildren">All chidren should be killed when the command exited</param> public Command(IProcessManager manager, string name, string executable, string parameters, bool killChildren) { _manager = manager; _name = name; _executable = executable; _parameters = parameters; _killChildren = killChildren; if (Log.IsDebugEnabled) { Log.Debug(string.Format("Create new command {0}", this)); } }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, ILogger logger, IGitHubClientFactory clientFactory) { client = clientFactory.CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.logger = logger; }
public UsageTracker(ITaskManager taskManager, IGitClient gitClient, IProcessManager processManager, ISettings userSettings, IEnvironment environment, IKeychain keychain, string instanceId) : base(userSettings, new UsageLoader(environment.UserCachePath.Combine(Constants.UsageFile)), environment.UnityVersion, instanceId) { TaskManager = taskManager; Environment = environment; GitClient = gitClient; ProcessManager = processManager; Keychain = keychain; }
public ConstArg( IProcessManager processManager, ProcessConstraint constraint, float value, IProcessHandler handler, IProcessSuite suite ) : base( processManager, constraint, value ) { thisHandler = handler; thisSuite = suite; }
public SettingsViewModel( IRegistryManager registryManager, IProcessManager processManager, ISettingsManager settingsManager, IKeyboardManager keyboardManager) { this.registryManager = registryManager; this.processManager = processManager; this.settingsManager = settingsManager; this.keyboardManager = keyboardManager; pasteDurationBeforeUserInterfaceShowsInMilliseconds = settingsManager.LoadSetting( nameof(PasteDurationBeforeUserInterfaceShowsInMilliseconds), 300); }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, IEnvironmentInformation environmentInformation, ILogger logger) { client = CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.environmentInformation = environmentInformation; this.logger = logger; }
public ConstArg( IProcessManager processManager, float expireTime, IPopUpStateEngine engine, bool hides ) : base( processManager, ProcessConstraint.ExpireTime, expireTime ) { thisHides = hides; thisEngine = engine; }
public void Launch(IProcessManager processManager) { Contract.Requires<ArgumentNullException>(Path != null); Contract.Requires<ArgumentException>(!String.IsNullOrWhiteSpace(Path)); //if (!UserSettings.Current.AppOptions.UseElevatedService) { var startInfo = new ProcessStartInfoBuilder(Path, Parameters) { WorkingDirectory = System.IO.Path.GetDirectoryName(Path), AsAdministrator = RunAsAdmin }.Build(); MainLog.Logger.Info("Launching external app: " + startInfo.Format()); processManager.StartAndForget(startInfo); //} else { // _wcfClient.Value.Updater_StartAndForget(Path, Parameters, System.IO.Path.GetDirectoryName(Path), RunAsAdmin); //} }
public MainViewModel(IProcessManager processManager) { this.processManager = processManager; processManager.ErrorErised += (sender, e) => { OnErrorErised(new ErrorEventArgs(e.ErrorMessage)); }; stopCommand = new DelegateCommand(StopProcess, () => CanCloseProcess); refreshCommand = new DelegateCommand(Refresh); startCommand = new DelegateCommand(StartProcess, () => CanStartProcess); Refresh(); }
public ConstArg( IProcessManager processManager, float flashTime, ICriticalFlash flash, AnimationCurve flashCurve ) : base( processManager, ProcessConstraint.ExpireTime, flashTime ) { thisFlash = flash; thisFlashCurve = flashCurve; }
public ConstArg( IProcessManager processManager, float expireT, IUIEActivationStateEngine engine, bool doesActivate ) : base( processManager, ProcessConstraint.None, expireT ) { thisEngine = engine; thisDoesActivate = doesActivate; }
public ApplicationEntrypoint( IStartupPreparationOperation startupPreparationOperation, IPostPreparationOperation postPreparationOperation, IMainWindowPreparationOperation mainWindowPreparationOperation, IProcessManager processManager, ILogger logger) { this.startupPreparationOperation = startupPreparationOperation; this.postPreparationOperation = postPreparationOperation; this.mainWindowPreparationOperation = mainWindowPreparationOperation; this.processManager = processManager; this.logger = logger; logger.Verbose("Application entry point initialized."); }
public ImageSmoothFollowDragPositionProcessConstArg( IProcessManager processManager, ITravelableUIE travelableUIE, IPickUpManager pickUpManager, float dragThreshold, float smoothCoefficient ) : base( processManager, travelableUIE ) { thisPickUpManager = pickUpManager; thisDragThreshold = dragThreshold; thisSmoothCoefficient = smoothCoefficient; }
private Adb() { _processManager = new ProcessManager(); var androidSdkPath = Environment.GetEnvironmentVariable("ANDROID_HOME"); if (androidSdkPath != null) { _adbExecutablePath = Path.Combine(androidSdkPath, "platform-tools"); } if (!File.Exists(_adbExecutablePath)) { throw new AdbException("Adb executable not found", this); } }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, IEnvironmentInformation environmentInformation, ILogger logger) { client = CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.environmentInformation = environmentInformation; this.logger = logger; }
public RunTestTask(BuildToolTask build_task, IProcessManager processManager) { this.BuildTask = build_task; this.ProcessManager = processManager ?? throw new ArgumentNullException(nameof(processManager)); Jenkins = build_task.Jenkins; TestProject = build_task.TestProject; Platform = build_task.Platform; ProjectPlatform = build_task.ProjectPlatform; ProjectConfiguration = build_task.ProjectConfiguration; if (build_task.HasCustomTestName) { TestName = build_task.TestName; } }
/// <summary> /// Runs a dotnet process. On Windows, it just runs the executable. On non-Windows, /// it runs the executable using Unity's mono. /// </summary> /// <remarks>You don't need to call <see cref="ProcessManager.Configure{T}(T, string)"/> on this task, /// it already does it in the constructor. /// </remarks> public DotNetProcessListTask(ITaskManager taskManager, IProcessManager processManager, IProcessEnvironment processEnvironment, IEnvironment environment, string executable, string arguments, Func <IProcessTask <T, List <T> >, string, bool> isMatch, Func <IProcessTask <T, List <T> >, string, T> processor, string workingDirectory = null, CancellationToken token = default) : base(taskManager, processManager.EnsureNotNull(nameof(processManager)), processEnvironment ?? processManager.DefaultProcessEnvironment, environment, executable, arguments, workingDirectory, isMatch, processor, false, false, token) { }
public SettingsViewModel( IDialogManager dialogManager, IWalletController walletController, IProcessManager processManager, ISettingsManager settingsManager, IThemeManager themeManager) { this.dialogManager = dialogManager; this.walletController = walletController; this.processManager = processManager; this.settingsManager = settingsManager; this.themeManager = themeManager; this.LoadSettings(); }
/// <summary> /// Constructor. /// </summary> /// <param name="windowManager">WindowManager used to display dialogs.</param> /// <param name="gitHubClient">GitHub client to check for updates.</param> /// <param name="processManager">ProcessManager for working with processor functions.</param> public GeneralSettingsViewModel(IExtendedWindowManager windowManager, IGitHubClient gitHubClient, IProcessManager processManager) { _windowManager = windowManager ?? throw new ArgumentNullException(nameof(windowManager)); _gitHubClient = gitHubClient ?? throw new ArgumentNullException(nameof(windowManager)); _processManager = processManager ?? throw new ArgumentNullException(nameof(windowManager)); MinimizeToTray = Settings.Default.MinimizeToTray; StartMinimized = Settings.Default.StartMinimized; StartupUpdateCheck = Settings.Default.StartupUpdateCheck; CheckForUpdatesCommand = new DelegateCommand((o) => CheckForUpdates(true).Forget()); if (Settings.Default.StartupUpdateCheck) { CheckForUpdates(false).Forget(); } }
protected static async Task BuildAndRunBatFile(IProcessManager pm, IAbsoluteDirectoryPath tmpFolder, IEnumerable <string> commands, bool asAdministrator = false, bool noisy = false) { var batFile = tmpFolder.GetChildFileWithName("install.bat"); var actualCommands = new[] { "chcp 65001" }.Concat(commands) .Concat(new[] { "echo finished" }) .Select(x => x == "" ? x : x + " >> install.log"); var commandBat = string.Join("\r\n", new[] { "", "echo starting > install.log" }.Concat(actualCommands) .Concat(new[] { "" })); var encoding = Encoding.UTF8; File.WriteAllText(batFile.ToString(), commandBat, encoding); if (Common.Flags.Verbose || noisy) { MainLog.Logger.Info("install.bat content:\n" + commandBat); } try { var pInfo = new ProcessStartInfoBuilder(batFile) { WorkingDirectory = tmpFolder //WindowStyle = ProcessWindowStyle.Minimized }.Build(); pInfo.CreateNoWindow = true; var basicLaunchInfo = new BasicLaunchInfo(pInfo) { StartMinimized = true }; var r = await(asAdministrator ? pm.LaunchElevatedAsync(basicLaunchInfo) : pm.LaunchAsync(basicLaunchInfo)); r.ConfirmSuccess(); } catch (Win32Exception ex) { if (ex.IsElevationCancelled()) { throw ex.HandleUserCancelled(); } throw; } var logFile = tmpFolder.GetChildFileWithName("install.log"); var output = File.ReadAllText(logFile.ToString(), encoding); if (Common.Flags.Verbose || noisy) { MainLog.Logger.Info("install.bat output:\n" + output); } }
public ConstArg( IProcessManager processManager, ProcessConstraint processConstraint, float expireT, IUIAdaptorInputState state, IUIAdaptorInputStateEngine engine ) : base( processManager, processConstraint, expireT ) { thisState = state; thisEngine = engine; }
public SelfUpdater(Func<bool> enableBeta, IEventAggregator eventBus, IProcessManager processManager, IFileDownloader downloader, IMediator mediator, ExportFactory<IWebClient> webClientFactory, IRestarter restarter) { _eventBus = eventBus; _processManager = processManager; _downloader = downloader; _mediator = mediator; _webClientFactory = webClientFactory; _restarter = restarter; _enableBeta = enableBeta; Status = new TransferStatus("Play withSIX update.exe"); Destination = Common.Paths.TempPath.GetChildFileWithName(Exe); _localProductCode = GetLocalProduct(); _entryAssemblyLocation = Common.Paths.EntryLocation; _entryAssemblyLocalVersion = GetLocalVersion(); }
public ProcessWatcherViewModel(IProcessManager processManager) { _buttonEnabled = true; _processManager = processManager; _processManager.ProcessStarted += (sender, args) => { _isProcessRunning = true; InvokePropertyChangeEvents(); }; _processManager.ProcessStopped += (sender, args) => { _isProcessRunning = false; InvokePropertyChangeEvents(); }; _startProcessCommand = new DelegateCommand <object>((param) => ToggleActionAsync(() => _processManager.Start())); _stopProcessCommand = new DelegateCommand <object>((param) => ToggleActionAsync(() => _processManager.Stop())); }
private MainAudioSession(string audioEndPointDeviceID, IProcessManager processManager, IAudioRouter audioRouter) { _processManager = processManager; _spytifyProcessId = _processManager.GetCurrentProcess()?.Id; _audioRouter = audioRouter; _cancellationTokenSource = new CancellationTokenSource(); AudioMMDevices = new MMDeviceEnumerator(); AudioMMDevicesManager = new AudioMMDevicesManager(AudioMMDevices, audioEndPointDeviceID); _audioLoopback = new AudioLoopback(AudioMMDevicesManager.AudioEndPointDevice, AudioMMDevicesManager.AudioMMDevices.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia)); AudioMMDevices.RegisterEndpointNotificationCallback(AudioMMDevicesManager); }
public ImportWindow(IProcessManager processManager, DatabaseDisplayData selectedDatabase) { if (processManager == null) { throw new System.ArgumentNullException("processManager", "processManager == null"); } this.processManager = processManager; if (selectedDatabase == null) { throw new System.ArgumentNullException("selectedDatabase", "selectedDatabase == null"); } this.selectedDatabase = selectedDatabase; this.ImportWindowCtor(); }
public ConstArg( IProcessManager processManager, IMonoBehaviourAdaptor target, ISmoothLooker looker, float smoothCoefficient, int processOrder ) : base( processManager ) { thisTarget = target; thisSmoothLooker = looker; thisSmoothCoefficient = smoothCoefficient; thisProcessOrder = processOrder; }
public ImportWindowViewModel(IProcessManager processManager, DatabaseDisplayData SelectedDatabase) { if (processManager == null) { throw new System.ArgumentNullException("processManager", "processManager == null"); } this.processManager = processManager; if (SelectedDatabase == null) { throw new System.ArgumentNullException("SelectedDatabase", "SelectedDatabase == null"); } this.SelectedDatabase = SelectedDatabase; this.ImportWindowViewModelCtor(); }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, ILogger logger, IGitHubClientFactory clientFactory, IEnvironmentInformation environmentInformation) { client = clientFactory.CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.logger = logger; this.environmentInformation = environmentInformation; }
static OSConfig() { if (isWindows) { ffmpegProcess = "ffmpeg.exe"; youtubeDlProcess = "youtube-dl.exe"; ProcessManager = new WinProcessManager(); } else { ffmpegProcess = "ffmpeg"; youtubeDlProcess = "youtube-dl"; ProcessManager = new LinProcessManager(); } }
public ItemIconEmptificationProcessConstArg( IProcessManager processManager, float expireTime, IItemIconImage itemIconImage, IItemIconEmptinessStateEngine engine ) : base( processManager, ProcessConstraint.ExpireTime, expireTime, false ) { thisItemIconImage = itemIconImage; thisEngine = engine; }
public UISystemProcessFactory( IProcessManager procManager, IUIManager uim ) : base( procManager ) { if (uim != null) { thisUIManager = uim; } else { throw new System.ArgumentNullException("uim", "ProcessFactory does not operate without a uim"); } }
public void ProcessManagerCtorTest() { IProcessManager manager = null; try { manager = new ProcessManager(null, null, null); Assert.True(false, "Should fail on previous statement"); } catch (Exception ex) { Assert.IsType(typeof(ArgumentNullException), ex); Assert.Equal("Value cannot be null.\r\nParameter name: processProxy", ex.Message); } Assert.Null(manager); var proxy = new Mock <IProcessProxy>(); ProcessStartInfo startInfo = null; var process = new Mock <IProcessWrapper>(); bool disposed = false; process.Setup(s => s.Dispose()).Callback(() => disposed = true); proxy.Setup(s => s.Start(It.IsAny <ProcessStartInfo>())) .Callback <ProcessStartInfo>(c => startInfo = c) .Returns(() => process.Object); manager = new ProcessManager(proxy.Object, null, null); Assert.NotNull(manager); manager.Dispose(); Assert.True(disposed); manager = new ProcessManager(proxy.Object, null, null); Assert.NotNull(manager); proxy.Setup(s => s.Start(It.IsAny <ProcessStartInfo>())) .Returns(() => null); try { manager = new ProcessManager(proxy.Object, "too", "args"); Assert.True(false, "Should fail on previous statement"); } catch (Exception ex) { Assert.IsType(typeof(AggregateException), ex); Assert.Equal("Failed to run process 'too' with arguments 'args'", ex.Message); } process.VerifyAll(); proxy.VerifyAll(); }
public RunTest(IRunTestTask testTask, IBuildToolTask buildTask, IProcessManager processManager, IEnvManager envManager, ILog mainLog, bool generateXmlFailures, XmlResultJargon xmlResultJargon, bool dryRun) { this.testTask = testTask ?? throw new ArgumentNullException(nameof(testTask)); this.BuildTask = buildTask ?? throw new ArgumentNullException(nameof(buildTask)); this.ProcessManager = processManager ?? throw new ArgumentNullException(nameof(processManager)); this.envManager = envManager ?? throw new ArgumentNullException(nameof(envManager)); this.mainLog = mainLog ?? throw new ArgumentNullException(nameof(mainLog)); this.generateXmlFailures = generateXmlFailures; this.dryRun = dryRun; this.xmlResultJargon = xmlResultJargon; }
public ConstArg( IFlyingTarget flyingTarget, Vector3 initialVelocity, float distanceThreshold, float speed, IProcessManager processManager ) : base( processManager ) { thisFlyingTarget = flyingTarget; thisInitialVelocity = initialVelocity; thisDistanceThreshold = distanceThreshold; thisSpeed = speed; }
public ApiClient(UriString hostUrl, IKeychain keychain, IProcessManager processManager, ITaskManager taskManager, IEnvironment environment) { Guard.ArgumentNotNull(keychain, nameof(keychain)); var host = String.IsNullOrEmpty(hostUrl) ? UriString.ToUriString(HostAddress.GitHubDotComHostAddress.WebUri) : new UriString(hostUrl.ToRepositoryUri() .GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped)); HostAddress = HostAddress.Create(host); OriginalUrl = host; this.keychain = keychain; this.processManager = processManager; this.taskManager = taskManager; this.environment = environment; loginManager = new LoginManager(keychain, processManager, taskManager, environment); }
public static async Task SetupApiPort(IPEndPoint http, IPEndPoint https, IProcessManager pm) { if ((https == null) && (http == null)) throw new ArgumentException("Both value and valueHttp are unspecified"); var sid = new SecurityIdentifier(WellKnownSidType.WorldSid, null); var acct = sid.Translate(typeof(NTAccount)) as NTAccount; var tmpFolder = Common.Paths.TempPath.GetChildDirectoryWithName("apisetup"); var commands = BuildCommands(http, https, tmpFolder, acct).ToList(); if (!commands.Any()) return; if (!tmpFolder.Exists) Directory.CreateDirectory(tmpFolder.ToString()); try { if (https != null) ExtractFile(tmpFolder, "server.pfx"); await BuildAndRunBatFile(pm, tmpFolder, commands, true, true).ConfigureAwait(false); } finally { if (tmpFolder.Exists) tmpFolder.DirectoryInfo.Delete(true); } }
protected void Page_Load(object sender, EventArgs e) { iProcessManager = ServiceAgent.getInstance().GetMaintainObjectByName<IProcessManager>(WebConstant.IProcessManager); if (!Page.IsPostBack) { pmtMessage1 = this.GetLocalResourceObject(Pre + "_pmtMessage1").ToString(); pmtMessage2 = this.GetLocalResourceObject(Pre + "_pmtMessage2").ToString(); pmtMessage3 = this.GetLocalResourceObject(Pre + "_pmtMessage3").ToString(); string oldProcess = Request.QueryString["Process"]; oldProcess = StringUtil.decode_URL(oldProcess); this.dOldProcess.Value = oldProcess; string oldType = Request.QueryString["Type"]; oldType = StringUtil.decode_URL(oldType); this.dOldType.Value = oldType; initLabel(); userName = Request.QueryString["userName"]; //UserInfo.UserId; userName = StringUtil.decode_URL(userName); this.HiddenUserName.Value = userName; } }
protected static async Task BuildAndRunBatFile(IProcessManager pm, IAbsoluteDirectoryPath tmpFolder, IEnumerable<string> commands, bool asAdministrator = false, bool noisy = false) { var batFile = tmpFolder.GetChildFileWithName("install.bat"); var actualCommands = new[] {"chcp 65001"}.Concat(commands) .Concat(new[] {"echo finished"}) .Select(x => x == "" ? x : x + " >> install.log"); var commandBat = string.Join("\r\n", new[] {"", "echo starting > install.log"}.Concat(actualCommands) .Concat(new[] {""})); var encoding = Encoding.UTF8; File.WriteAllText(batFile.ToString(), commandBat, encoding); if (Common.Flags.Verbose || noisy) MainLog.Logger.Info("install.bat content:\n" + commandBat); try { var pInfo = new ProcessStartInfoBuilder(batFile) { WorkingDirectory = tmpFolder //WindowStyle = ProcessWindowStyle.Minimized }.Build(); pInfo.CreateNoWindow = true; var basicLaunchInfo = new BasicLaunchInfo(pInfo) {StartMinimized = true}; var r = await (asAdministrator ? pm.LaunchElevatedAsync(basicLaunchInfo) : pm.LaunchAsync(basicLaunchInfo)); r.ConfirmSuccess(); } catch (Win32Exception ex) { if (ex.IsElevationCancelled()) throw ex.HandleUserCancelled(); throw; } var logFile = tmpFolder.GetChildFileWithName("install.log"); var output = File.ReadAllText(logFile.ToString(), encoding); if (Common.Flags.Verbose || noisy) MainLog.Logger.Info("install.bat output:\n" + output); }
public ClientProcessMethods( IProcessManager processRepository ) { _processRepository = processRepository; }
public CleanupArgumentProcessor( IProcessManager processManager) { this.processManager = processManager; }
public GameLauncherProcessExternalUpdater(IProcessManager processManager) { _processManager = processManager; }
public ProcessManagerDataNotFoundException(Guid processManagerId, IProcessManager instance) : base(GetMessage(processManagerId, instance)) { }
private static string GetMessage(IProcessManager instance) { return String.Format("Process manager {0} is either complete or has not yet started.", instance.GetType().FullName); }
public ProcessManagerDataNotFoundException(IProcessManager instance) : base(GetMessage(instance)) { }
public UpdateArgumentProcessor( IProcessManager processManager) { this.processManager = processManager; }
public void LaunchWithChecks(IProcessManager processManager, bool mp) { if (!CheckPreRequisites(mp)) return; Launch(processManager); }
public RepoAppsContextMenu(IUpdateManager updateManager, IProcessManager processManager) { _updateManager = updateManager; _processManager = processManager; }