From 9a63b660de5832ba0eba74dc560876b848a0f815 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Fri, 11 Dec 2020 17:49:51 +0100 Subject: [PATCH] 5.4.8.5 Beta --- Changelog.md | 14 ++++-- Manual.md | 2 +- mpv.net/Misc/UpdateCheck.cs | 8 ++-- mpv.net/Properties/AssemblyInfo.cs | 4 +- mpv.net/Update.ps1 | 70 ------------------------------ mpv.net/mpv.net.csproj | 3 -- 6 files changed, 18 insertions(+), 83 deletions(-) delete mode 100644 mpv.net/Update.ps1 diff --git a/Changelog.md b/Changelog.md index 64674d3..f0093aa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,13 +1,21 @@ -5.4.8.5 Beta (not yet released) +5.4.8.6 Beta (not yet released) +============ + +5.4.8.5 Beta ============ - Load AviSynth DLL from environment variable AviSynthDLL in order to support AviSynth portable mode. - New option global-media-keys (next, previous, play/pause, stop). -- Redesigned PowerShell based setup and setup dialog. +- Redesigned PowerShell based setup and setup dialog, it was done + because of a bug and upcoming chocolately and winget integration. +- Redesigned auto update using different file name, using zip instead + of 7zip format now, 7zip distribution will shortly get dropped. - Whenever there is a new startup location, the setup dialog is shown. -- libmpv updated to shinshiro 2020-11-22. +- libmpv updated to shinshiro 2020-12-06 +- youtube-dl is no longer included, users have to install it + on their own (put it in the startup or a PATH folder). 5.4.8.4 Beta diff --git a/Manual.md b/Manual.md index 27c0c15..437b5bf 100644 --- a/Manual.md +++ b/Manual.md @@ -135,7 +135,7 @@ Installation mpv.net requires the .NET Framework 4.8 and Windows 7 or 10 and a modern graphics card. -There is a setup and a portable download in the 7zip and Zip archive format. +There is a setup exe and a portable zip file download. x64 editions have the advantage of being typically better optimized and tested. diff --git a/mpv.net/Misc/UpdateCheck.cs b/mpv.net/Misc/UpdateCheck.cs index fdd5ddf..6db31c1 100644 --- a/mpv.net/Misc/UpdateCheck.cs +++ b/mpv.net/Misc/UpdateCheck.cs @@ -32,7 +32,7 @@ namespace mpvnet var response = await client.GetAsync("https://api.github.com/repos/stax76/mpv.net/releases/latest"); response.EnsureSuccessStatusCode(); string content = await response.Content.ReadAsStringAsync(); - Match match = Regex.Match(content, @"""mpv\.net-portable-x64-([\d\.]+)\.7z"""); + Match match = Regex.Match(content, @"""mpv\.net-([\d\.]+)-portable-x64\.zip"""); Version onlineVersion = Version.Parse(match.Groups[1].Value); Version currentVersion = Assembly.GetEntryAssembly().GetName().Version; @@ -49,14 +49,14 @@ namespace mpvnet $"New version {onlineVersion} is available, update now?") == MsgResult.OK) { string arch = IntPtr.Size == 8 ? "64" : "86"; - string url = $"https://github.com/stax76/mpv.net/releases/download/{onlineVersion}/mpv.net-portable-x{arch}-{onlineVersion}.7z"; + string url = $"https://github.com/stax76/mpv.net/releases/download/{onlineVersion}/mpv.net-{onlineVersion}-portable-x{arch}.zip"; 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}\" \"{Folder.Startup.TrimEnd(Path.DirectorySeparatorChar)}\""; + proc.StartInfo.FileName = "powershell.exe"; + proc.StartInfo.Arguments = $"-NoLogo -NoExit -File \"{Folder.Startup + "Setup\\update.ps1"}\" \"{url}\" \"{Folder.Startup.TrimEnd(Path.DirectorySeparatorChar)}\""; if (Folder.Startup.Contains("Program Files")) proc.StartInfo.Verb = "runas"; diff --git a/mpv.net/Properties/AssemblyInfo.cs b/mpv.net/Properties/AssemblyInfo.cs index eb37ddd..8293ee9 100644 --- a/mpv.net/Properties/AssemblyInfo.cs +++ b/mpv.net/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.4.8.4")] -[assembly: AssemblyFileVersion("5.4.8.4")] +[assembly: AssemblyVersion("5.4.8.5")] +[assembly: AssemblyFileVersion("5.4.8.5")] diff --git a/mpv.net/Update.ps1 b/mpv.net/Update.ps1 deleted file mode 100644 index 8d475fe..0000000 --- a/mpv.net/Update.ps1 +++ /dev/null @@ -1,70 +0,0 @@ - -$ErrorActionPreference = 'Stop' - -if ($args.Length -ne 2) { - Write-Host 'Invalid arguments' -ForegroundColor Red - pause - exit -} - -if (-not (Get-Command curl.exe)) { - Write-Host 'Error using curl.exe' -ForegroundColor Red - pause - exit -} - -if ($PSVersionTable.PSVersion.Major -lt 5) { - Write-Host 'PowerShell 5.1 not found' -ForegroundColor Red - pause - exit -} - -Add-Type -AssemblyName Microsoft.VisualBasic - -# Delete directory using recycle bin -function Remove-Directory($directory) { - if (Test-Path $directory) { - [Microsoft.VisualBasic.FileIO.FileSystem]:: - DeleteDirectory($directory, 'OnlyErrorDialogs', 'SendToRecycleBin') - } -} - -$currentDir = $args[1]; - -$targetDir = (Split-Path $currentDir) + "\new version" -Remove-Directory $targetDir -$targetFile = $targetDir + '.7z' -Remove-Item $targetFile -Force -ErrorAction Ignore - -Write-Host 'Download new version' -ForegroundColor Green -curl.exe $args[0] --location --output $targetFile -if ($LastExitCode) { throw $LastExitCode } - -Write-Host 'Unpack new version' -ForegroundColor Green -& ($currentDir + '\7z\7za.exe') x -y $targetFile -o"$targetDir" -if ($LastExitCode) { throw $LastExitCode } - -Write-Host 'Delete downloaded file' -ForegroundColor Green -Remove-Item $targetFile -Force -Recurse - -$portableConfigDir = $currentDir + '\portable_config' -$portableConfigTempDir = (Split-Path $currentDir) + '\portable config dir temp' -Remove-Item $portableConfigTempDir -Force -ErrorAction Ignore - -if (Test-Path $portableConfigDir) { - Write-Host 'Backup portable config' -ForegroundColor Green - Copy-Item $portableConfigDir $portableConfigTempDir -Recurse -Force -} - -Write-Host 'Delete current version' -ForegroundColor Green -Remove-Directory $currentDir - -Write-Host 'Rename directory' -ForegroundColor Green -Rename-Item $targetDir (Split-Path $currentDir -Leaf) - -if (Test-Path $portableConfigTempDir) { - Write-Host 'Restore portable config' -ForegroundColor Green - Move-Item $portableConfigTempDir $portableConfigDir -Force -} - -Write-Host 'Update is complete' -ForegroundColor Green diff --git a/mpv.net/mpv.net.csproj b/mpv.net/mpv.net.csproj index b8bc0e4..c00e6c5 100644 --- a/mpv.net/mpv.net.csproj +++ b/mpv.net/mpv.net.csproj @@ -102,9 +102,6 @@ PreserveNewest - - PreserveNewest - MSBuild:Compile Designer