Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Fixed a bug in the updating process
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Oct 9, 2019
1 parent 9ecfb08 commit 68dcc35
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Docdown/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
ResourceDictionaryLocation.SourceAssembly
)]

[assembly: AssemblyVersion("0.2.1.0")]
[assembly: AssemblyFileVersion("0.2.1.0")]
[assembly: AssemblyVersion("0.2.1.2")]
[assembly: AssemblyFileVersion("0.2.1.2")]
7 changes: 5 additions & 2 deletions Docdown/Util/MessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ public static MessageBoxResult Show(string title, string message, MessageBoxButt
var viewModel = new MessageBoxViewModel(title, message, messageBoxButton);
MessageWindow messageWindow = new MessageWindow
{
DataContext = viewModel,
Owner = Application.Current.MainWindow
DataContext = viewModel
};
if (Application.Current.MainWindow.IsVisible)
{
messageWindow.Owner = Application.Current.MainWindow;
}
if (messageWindow.ShowDialog().HasValue)
{
return viewModel.Result;
Expand Down
19 changes: 10 additions & 9 deletions Docdown/Util/ProgramUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@ public static int Execute(string program, string args = null)

public static void ExecuteNonWaiting(string program, string args = null)
{
using (var process = new Process()
#pragma warning disable IDE0067 // Objekte verwerfen, bevor Bereich verloren geht
var process = new Process()
{
StartInfo = new ProcessStartInfo(program, args)
{
WindowStyle = ProcessWindowStyle.Hidden
}
})
};
#pragma warning restore IDE0067 // Objekte verwerfen, bevor Bereich verloren geht
process.Exited += delegate { process.Dispose(); };
try
{
process.Start();
}
catch
{
try
{
process.Start();
}
catch
{
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion Docdown/Util/UpdateUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public static async Task Update()
sb.AppendLine("@echo off");
sb.AppendLine("timeout 4");
sb.Append("copy /b/y \"").Append(tempFile).Append("\" \"").Append(curFile).AppendLine("\"");
sb.Append("start \"").Append(curFile).AppendLine("\"");
sb.Append("start \"\" \"").Append(curFile).AppendLine("\"");
sb.AppendLine("exit");

var tempBat = Path.GetTempFileName() + ".bat";
File.WriteAllText(tempBat, sb.ToString());
Expand Down

0 comments on commit 68dcc35

Please sign in to comment.