internal static void RepairEnvironmentVariable() { if (!Elevation.IsAdministrator) { using (var process = ProcessEx.Start(PathEx.LocalPath, ActionGuid.RepairVariable, true, false)) if (process?.HasExited == false) { process.WaitForExit(); } return; } if (!SystemIntegration.IsAccurate) { SystemIntegration.Enable(true, true); } }
internal static void RepairEnvironmentVariable() { if (!Elevation.IsAdministrator) { using (var process = ProcessEx.Start(PathEx.LocalPath, ActionGuid.RepairVariable, true, false)) if (process?.HasExited == false) { process.WaitForExit(); } return; } var envDir = EnvironmentEx.GetVariableValue(Settings.EnvironmentVariable); if (!Settings.DeveloperVersion && !string.IsNullOrWhiteSpace(envDir) && !envDir.EqualsEx(PathEx.LocalDir)) { SystemIntegration.Enable(true, true); } }
internal static void VersionValidation() { if (Settings.DeveloperVersion || Settings.LastUpdateCheck == DateTime.MinValue || Settings.VersionValidation == AssemblyInfo.Version) { return; } Settings.VersionValidation = AssemblyInfo.Version; Settings.WriteToFile(); RepairAppsSuiteDirs(); try { var subKeys = new[] { "*", "Folder" }; if (subKeys.Select(x => Path.Combine(x, "shell\\portableapps")).Any(varKey => Reg.SubKeyExists(Registry.ClassesRoot, varKey))) { SystemIntegration.Enable(true, true); } } catch (Exception ex) when(ex.IsCaught()) { Log.Write(ex); } var path = PathEx.Combine(PathEx.LocalDir, "UpdateCompletion.bat"); if (File.Exists(path)) { ProcessEx.Start(path); } Environment.ExitCode = 0; Environment.Exit(Environment.ExitCode); }