public void Process() { if (!processManager.IsCurrentProcessElevated()) { Logger.Information("Current process is not elevated which is needed for installation. Starting as elevated process."); processManager.LaunchFileWithAdministrativeRights( processManager.GetCurrentProcessFilePath()); } else { Logger.Information("Current process is elevated."); Logger.Information("Running installation procedure."); Install(); } }
public async Task ProcessAsync(string[] arguments) { var targetDirectory = fileManager.PrepareIsolatedFolder(); await fileManager.DeleteDirectoryIfExistsAsync(targetDirectory); processManager.LaunchFile(processManager.GetCurrentProcessFilePath()); }
void Install() { maintenanceWindow.Show("Installing Shapeshifter ..."); PrepareInstallDirectory(); InstallToInstallDirectory(); ConfigureDefaultSettings(); logger.Information("Default settings have been configured."); LaunchInstalledExecutable( processManager.GetCurrentProcessFilePath()); logger.Information("Launched installed executable."); }
public async Task ProcessAsync(string[] arguments) { var updateIndex = Array.IndexOf(arguments, "postinstall"); var targetDirectory = arguments[updateIndex + 1]; logger.Information("Attempting to delete file {file}.", targetDirectory); await fileManager.DeleteFileIfExistsAsync(targetDirectory); logger.Verbose("Old file has been cleaned up."); processManager.LaunchFileWithAdministrativeRights(processManager.GetCurrentProcessFilePath()); }
void Install() { processManager.LaunchFileWithAdministrativeRights( processManager.GetCurrentProcessFilePath(), "install"); }