private void RelaunchInTemp() { if (WatchedFile.IsBlank()) { return; } var exeNow = CurrentExe.GetFullPath(); var cfgNow = exeNow + ".config"; var tmpExe = WatchedFile.MakeTempCopy(".exe"); var tmpCfg = tmpExe + ".config"; if (File.Exists(cfgNow)) { File.Copy(cfgNow, tmpCfg, true); } Process.Start(tmpExe, GetCommandLineArgs()); Application.Current.Shutdown(); }
private void RelaunchInTemp() { if (WatchedFile.IsBlank()) { return; } var tmpExe = ""; try { tmpExe = WatchedFile.MakeTempCopy(".exe"); } catch (Exception ex) { Alert.Show(ex, $"Creating temp copy of {WatchedFile}"); return; } CopyCfgToTemp(tmpExe); Process.Start(tmpExe, GetCommandLineArgs()); Application.Current.Shutdown(); }