Skip to content

Commit

Permalink
v7.1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Jul 20, 2024
1 parent 7c38e82 commit e52de1d
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 111 deletions.
11 changes: 7 additions & 4 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@

# v7.1.1.1 Beta (????-??-??)
# v7.1.1.1 Beta (2024-07-20)

- Korean, Russian and Turkish translation added, Japanese translation fixed. Thanks to the translation team!
- Action/Workflow/Auto build fix and update.
- New default bindings and menu items for select.lua which is a new simple mpv built-in command palette script.
In the context menu select.lua features can be found under `View > On Screen Menu`.
https://github.com/mpv-player/mpv/blob/master/player/lua/select.lua
- The helper script 'Tools\update-mpv-and-libmpv.ps1' no longer uses command line arguments,
it uses now the Path environment variable to find mpv and mpv.net.
- Fix loading of DVD ISO files.
- New PowerShell script 'Tools\release-mpv.net.ps1' used to releases mpv.net on GitHub.
- Fix DVD ISO file support.
- MediaInfo updated to version v24.6.
- New ARM64 support.
- New zhongfly libmpv x64 build.
- New Andarwinux libmpv ARM64 build.


# v7.1.1.0 (2024-02-03)
Expand Down
6 changes: 3 additions & 3 deletions src/MpvNet.Windows/MpvNet.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
<Product>mpv.net</Product>
<FileVersion>7.1.1.0</FileVersion>
<AssemblyVersion>7.1.1.0</AssemblyVersion>
<InformationalVersion>7.1.1.0</InformationalVersion>
<FileVersion>7.1.1.1</FileVersion>
<AssemblyVersion>7.1.1.1</AssemblyVersion>
<InformationalVersion>7.1.1.1</InformationalVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
16 changes: 5 additions & 11 deletions src/MpvNet/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,13 @@ public void Init()
}

public static string About => "Copyright (C) 2000-2024 mpv.net/mpv/mplayer\n" +
$"{AppInfo.Product} {AppInfo.Version}" + GetLastWriteTime(Environment.ProcessPath!) + "\n" +
$"{AppInfo.Product} v{AppInfo.Version}" + GetLastWriteTime(Environment.ProcessPath!) + "\n" +
$"{Player.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "libmpv-2.dll") + "\n" +
$"ffmpeg {Player.GetPropertyString("ffmpeg-version")}\n" + "GPL v2 License";
$"ffmpeg {Player.GetPropertyString("ffmpeg-version")}\n" +
$"MediaInfo v{FileVersionInfo.GetVersionInfo(Folder.Startup + "MediaInfo.dll").FileVersion}" +
$"{GetLastWriteTime(Folder.Startup + "MediaInfo.dll")}" + "\n" + "GPL v2 License";

static string GetLastWriteTime(string path)
{
if (IsStoreVersion)
return "";

return $" ({File.GetLastWriteTime(path).ToShortDateString()})";
}

static bool IsStoreVersion => Folder.Startup.Contains("FrankSkare.mpvnet");
static string GetLastWriteTime(string path) => $" ({File.GetLastWriteTime(path).ToShortDateString()})";

void Player_Initialized()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Setup/Inno/inno-setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AppPublisher=Frank Skare (stax76)
ArchitecturesInstallIn64BitMode=x64
Compression=lzma2
DefaultDirName={autopf}\{#MyAppName}
OutputBaseFilename=mpv.net-v{#MyAppVersion}-setup
OutputBaseFilename=mpv.net-v{#MyAppVersion}-setup-x64
OutputDir=E:\Desktop
DefaultGroupName={#MyAppName}
SetupIconFile=..\..\MpvNet.Windows\mpv-icon.ico
Expand All @@ -25,4 +25,4 @@ Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

[Files]
Source: "{#MyAppSourceDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\*"; DestDir: "{app}"; Excludes: "win-x64"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "{#MyAppSourceDir}\*"; DestDir: "{app}"; Excludes: "win-x64,win-arm64"; Flags: ignoreversion recursesubdirs createallsubdirs;
114 changes: 114 additions & 0 deletions src/Tools/release-mpv.net.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

<#
Script that releases mpv.net on GitHub.
Needs 2 positional CLI arguments:
1. Directory where the mpv.net source code is located.
2. Directory of the output files, for instance the desktop dir.
Dependencies:
7zip installation found at: 'C:\Program Files\7-Zip\7z.exe'.
Inno Setup compiler installation found at: 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'.
GitHub CLI https://cli.github.com
#>

# Stop when the first error occurs
$ErrorActionPreference = 'Stop'

function DeleteDir($path) {
if (Test-Path $path) {
Remove-Item $path -Recurse
}
}

# Throw error if the file/dir don't exist
function Test($path) {
if (-not (Test-Path $path)) {
throw $path
}
return $path
}

# Variables
$SourceDir = Test $args[0]
$OutputRootDir = Test $args[1]

Test (Join-Path $SourceDir 'MpvNet.sln')

$7zFile = Test 'C:\Program Files\7-Zip\7z.exe'
$InnoSetupCompiler = Test 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'

$ReleaseNotes = "- [.NET Desktop Runtime 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)`n- [Changelog](https://github.com/mpvnet-player/mpv.net/blob/main/docs/changelog.md)"
$Repo = 'github.com/mpvnet-player/mpv.net'

# Dotnet Publish
$PublishDir64 = Join-Path $SourceDir 'MpvNet.Windows\bin\Debug\win-x64\publish\'
$PublishDirARM64 = Join-Path $SourceDir 'MpvNet.Windows\bin\Debug\win-arm64\publish\'
$ProjectFile = Test (Join-Path $SourceDir 'MpvNet.Windows\MpvNet.Windows.csproj')
dotnet publish $ProjectFile --self-contained false --configuration Debug --runtime win-x64
dotnet publish $ProjectFile --self-contained false --configuration Debug --runtime win-arm64
$PublishedExeFile64 = Test ($PublishDir64 + 'mpvnet.exe')

# Create OutputName
$VersionInfo = [Diagnostics.FileVersionInfo]::GetVersionInfo($PublishedExeFile64)
$IsBeta = $VersionInfo.FilePrivatePart -ne 0
$BetaString = if ($IsBeta) { '-beta' } else { '' }
$VersionName = $VersionInfo.FileVersion
$OutputName64 = 'mpv.net-v' + $VersionName + $BetaString + '-portable-x64'
$OutputNameARM64 = 'mpv.net-v' + $VersionName + $BetaString + '-portable-ARM64'

# Create OutputFolder
$OutputDir64 = Join-Path $OutputRootDir ($OutputName64 + '\')
$OutputDirARM64 = Join-Path $OutputRootDir ($OutputNameARM64 + '\')
DeleteDir $OutputDir64
DeleteDir $OutputDirARM64
mkdir $OutputDir64
mkdir $OutputDirARM64

# Copy Files
Copy-Item ($PublishDir64 + '*') $OutputDir64
Copy-Item ($PublishDirARM64 + '*') $OutputDirARM64
$BinDirX64 = Test (Join-Path $SourceDir 'MpvNet.Windows\bin\Debug\')
$BinDirARM64 = Test (Join-Path $SourceDir 'MpvNet.Windows\bin\Debug\win-arm64\')
$ExtraFiles = 'mpvnet.com', 'libmpv-2.dll', 'MediaInfo.dll'
$ExtraFiles | ForEach-Object { Copy-Item ($BinDirX64 + $_) ($OutputDir64 + $_) }
$ExtraFiles | ForEach-Object { Copy-Item ($BinDirARM64 + $_) ($OutputDirARM64 + $_) }
$LocaleDir = Test (Join-Path $SourceDir 'MpvNet.Windows\bin\Debug\Locale\')
Copy-Item $LocaleDir ($OutputDir64 + 'Locale') -Recurse
Copy-Item $LocaleDir ($OutputDirARM64 + 'Locale') -Recurse

# Pack
$ZipOutputFile64 = Join-Path $OutputRootDir ($OutputName64 + '.zip')
$ZipOutputFileARM64 = Join-Path $OutputRootDir ($OutputNameARM64 + '.zip')
& $7zFile a -tzip -mx9 $ZipOutputFile64 -r ($OutputDir64 + '*')
if ($LastExitCode) { throw $LastExitCode }
& $7zFile a -tzip -mx9 $ZipOutputFileARM64 -r ($OutputDirARM64 + '*')
if ($LastExitCode) { throw $LastExitCode }
Test $ZipOutputFile64
Test $ZipOutputFileARM64

# Inno Setup
''; ''
$InnoSetupScript = Test (Join-Path $SourceDir 'Setup\Inno\inno-setup.iss')
& $InnoSetupCompiler $InnoSetupScript
if ($LastExitCode) { throw $LastExitCode }
$SetupFile = Test (Join-Path $OutputRootDir "mpv.net-v$VersionName-setup-x64.exe")

if ($IsBeta) {
$NewSetupFile = Join-Path $OutputRootDir "mpv.net-v$VersionName-beta-setup-x64.exe"
Move-Item $SetupFile $NewSetupFile
$SetupFile = $NewSetupFile
}

# Release
$Title = 'v' + $VersionName + $BetaString

if ($BetaString) {
gh release create $Title -t $Title -n $ReleaseNotes --repo $Repo --prerelease $ZipOutputFile64 $ZipOutputFileARM64 $SetupFile
} else {
gh release create $Title -t $Title -n $ReleaseNotes --repo $Repo $ZipOutputFile64 $ZipOutputFileARM64 $SetupFile
}

if ($LastExitCode) { throw $LastExitCode }
91 changes: 0 additions & 91 deletions src/Tools/update-mpv-and-libmpv.ps1

This file was deleted.

104 changes: 104 additions & 0 deletions src/Tools/update-mpv.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

<#
Updates mpv (x64) and libmpv (x64 , ARM64).
Files are downloaded from:
x64: github.com/zhongfly/mpv-winbuild
ARM64: github.com/Andarwinux/mpv-winbuild
Requires 7zip being installed at 'C:\Program Files\7-Zip\7z.exe'.
Needs 3 positional CLI arguments:
1. Directory where mpv x64 is located. To skip pass '-'.
2. Directory where libmpv x64 is located. To skip pass '-'.
3. Directory where libmpv ARM64 is located. To skip pass '-'.
#>

$7ZipPath = 'C:\Program Files\7-Zip\7z.exe'

$MpvDirX64 = $args[0]
$LibmpvDirX64 = $args[1]
$LibmpvDirARM64 = $args[2]

# Stop when the first error occurs
$ErrorActionPreference = 'Stop'

# Throw exception if file or folder does not exist
function Test($path) {
if (-not (Test-Path $path)) {
throw $path
}
return $path
}

# Download file to temp dir and return file path
function Download($apiURL, $pattern) {
$json = Invoke-WebRequest $apiURL -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing | ConvertFrom-Json
$filename = ($json.assets | Where-Object { $_.name -Match $pattern }).name
$path = Join-Path $env:TEMP $filename
$link = ($json.assets | Where-Object { $_.name -Match $pattern }).browser_download_url
Invoke-WebRequest -Uri $link -UserAgent "mpv-win-updater" -OutFile $path
return Test $path
}

# Unpack archive
function Unpack($archieveFile, $outputRootDir) {
$outputDir = Join-Path $outputRootDir $archieveFile.BaseName
if (Test-Path $outputDir) { Remove-Item $outputDir -Recurse }
$process = Start-Process (Test $7ZipPath) @('x', $archieveFile.FullName, "-o$outputDir") -NoNewWindow -Wait
if ($process.ExitCode) { throw $process.ExitCode }
return Test $outputDir
}

# Update mpv x64

if (Test-Path (Join-Path $MpvDirX64 'mpv.exe')) {
$apiURL = "https://api.github.com/repos/zhongfly/mpv-winbuild/releases/latest"
$archiveFile = Get-Item (Download $apiURL "mpv-x86_64-[0-9]{8}")
$archiveDir = Unpack $archiveFile $env:TEMP
Remove-Item "$MpvDirX64\*" -Force -Recurse
Copy-Item "$archiveDir\*" $MpvDirX64 -Force -Recurse
Remove-Item $archiveFile.FullName
Remove-Item $archiveDir -Recurse
} else {
"mpv x64 location not found:`n$MpvDirX64"
}

# Update libmpv x64

if (Test-Path (Join-Path $LibmpvDirX64 'libmpv-2.dll')) {
$apiURL = "https://api.github.com/repos/zhongfly/mpv-winbuild/releases/latest"
$archiveFile = Get-Item (Download $apiURL "mpv-dev-x86_64-[0-9]{8}")
$archiveDir = Unpack $archiveFile $env:TEMP
Copy-Item $archiveDir\libmpv-2.dll $LibmpvDirX64 -Force
Remove-Item $archiveFile.FullName
Remove-Item $archiveDir -Recurse
} else {
"libmpv x64 location not found:`n$LibmpvDirX64"
}

# Update libmpv ARM64

if (Test-Path (Join-Path $LibmpvDirARM64 'libmpv-2.dll')) {
$apiURL = "https://api.github.com/repos/Andarwinux/mpv-winbuild/releases/latest"
$archiveFile = Get-Item (Download $apiURL "mpv-dev-aarch64-[0-9]{8}")
$archiveDir = Unpack $archiveFile $env:TEMP
Copy-Item $archiveDir\libmpv-2.dll $LibmpvDirARM64 -Force
Remove-Item $archiveFile.FullName
Remove-Item $archiveDir -Recurse
} else {
"libmpv ARM64 location not found:`n$LibmpvDirARM64"
}

if (Test-Path (Join-Path $MpvDirX64 'mpv.exe')) {
Get-Item (Join-Path $MpvDirX64 'mpv.exe')
}

if (Test-Path (Join-Path $LibmpvDirX64 'libmpv-2.dll')) {
Get-Item (Join-Path $LibmpvDirX64 'libmpv-2.dll')
}

if (Test-Path (Join-Path $LibmpvDirARM64 'libmpv-2.dll')) {
Get-Item (Join-Path $LibmpvDirARM64 'libmpv-2.dll')
}

0 comments on commit e52de1d

Please sign in to comment.