From 6294a96aea038fb93eb305ca6ec5edd38d31ae98 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Mon, 2 Dec 2019 01:22:12 +0100 Subject: [PATCH] fix update routine --- Changelog.md | 4 ++++ README.md | 6 +++--- mpv.net/Misc/UpdateCheck.cs | 4 +++- mpv.net/mpv/libmpv.cs | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9351d3e..335f7d9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,8 @@ +### + +- fix: update routine did only work when mpv.net was located in 'Program Files' + ### 5.4.4.0 - new: forecolors in the dark theme are slightly darker now diff --git a/README.md b/README.md index e43b78e..4d9227f 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ with libmpv. The player does not contain any feature that was more work than 1-2 days or was difficult to build, the hard parts are totally covered by libmpv. -mpv.net is written in C# 7 and runs on .NET 4.7, I've not yet decided +mpv.net is written in C# 7 and runs on .NET 4.8, I've not yet decided if I will port it to C# 8 and .NET 5 once available. The Extension implementation is based on the [Managed Extensibility Framework](https://docs.microsoft.com/en-us/dotnet/framework/mef/). @@ -224,13 +224,13 @@ this decision was made to keep the code simple and lightweight. Python scripting is implemented with IronPython which uses Python 2.7. -The main window is WinForms based and uses less than 750 lines of code, +The main window is WinForms based and uses less than 800 lines of code, all other windows are WPF based and use even less code. The config editor adds it's controls dynamically and uses [TOML](https://en.wikipedia.org/wiki/TOML) to define it's content, there are only two simple types, StringSetting and OptionSetting. -mpv.net was started 2017 and consists of about 6000 lines of code and markup. +mpv.net was started 2017 and consists of about 7000 lines of code and markup. IDE, Editor: Visual Studio, Visual Studio Code. diff --git a/mpv.net/Misc/UpdateCheck.cs b/mpv.net/Misc/UpdateCheck.cs index 710efd8..23523b9 100644 --- a/mpv.net/Misc/UpdateCheck.cs +++ b/mpv.net/Misc/UpdateCheck.cs @@ -49,8 +49,10 @@ namespace mpvnet using (Process proc = new Process()) { + proc.StartInfo.UseShellExecute = true; + proc.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); proc.StartInfo.FileName = "PowerShell"; - proc.StartInfo.Arguments = $"-NoLogo -NoExit -File \"{Folder.Startup + "Update.ps1"}\" \"{url}\" \"{Application.StartupPath}\""; + proc.StartInfo.Arguments = $"-NoLogo -NoExit -File \"{Folder.Startup + "Update.ps1"}\" \"{url}\" \"{Application.StartupPath.TrimEnd('\\')}\""; if (Folder.Startup.Contains("Program Files")) proc.StartInfo.Verb = "runas"; diff --git a/mpv.net/mpv/libmpv.cs b/mpv.net/mpv/libmpv.cs index 4369148..1cf42db 100644 --- a/mpv.net/mpv/libmpv.cs +++ b/mpv.net/mpv/libmpv.cs @@ -1,4 +1,5 @@ -using System; + +using System; using System.Runtime.InteropServices; namespace mpvnet