5.4.6.0
This commit is contained in:
@@ -5,6 +5,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
5.4.6.0
|
||||||
|
=======
|
||||||
|
|
||||||
|
- youtube-dl update
|
||||||
|
- auto update routine fix
|
||||||
|
|
||||||
|
|
||||||
5.4.5.1 Beta
|
5.4.5.1 Beta
|
||||||
============
|
============
|
||||||
|
|
||||||
|
|||||||
@@ -229,4 +229,4 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
public static string Startup { get; } = Application.StartupPath + @"\";
|
public static string Startup { get; } = Application.StartupPath + @"\";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("5.4.5.1")]
|
[assembly: AssemblyVersion("5.4.6.0")]
|
||||||
[assembly: AssemblyFileVersion("5.4.5.1")]
|
[assembly: AssemblyFileVersion("5.4.6.0")]
|
||||||
|
|||||||
@@ -1,23 +1,67 @@
|
|||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
$targetDir = (Split-Path $args[1]) + "\new version"
|
|
||||||
|
if ($args.Length -ne 2) {
|
||||||
|
Write-Host 'Invalid arguments' -ForegroundColor Red
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Get-Command curl.exe)) {
|
||||||
|
Write-Host 'Error using curl.exe' -ForegroundColor Red
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($PSVersionTable.PSVersion.Major -lt 5) {
|
||||||
|
Write-Host 'PowerShell 5.1 not found' -ForegroundColor Red
|
||||||
|
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'
|
$targetFile = $targetDir + '.7z'
|
||||||
|
Remove-Item $targetFile -Force -ErrorAction Ignore
|
||||||
|
|
||||||
Write-Host 'Download new version' -ForegroundColor Green
|
Write-Host 'Download new version' -ForegroundColor Green
|
||||||
curl.exe $args[0] --location --output $targetFile
|
curl.exe $args[0] --location --output $targetFile
|
||||||
if ($LastExitCode) { throw $LastExitCode }
|
if ($LastExitCode) { throw $LastExitCode }
|
||||||
|
|
||||||
Write-Host 'Unpack new version' -ForegroundColor Green
|
Write-Host 'Unpack new version' -ForegroundColor Green
|
||||||
& ($args[1] + '\7z\7za.exe') x -y $targetFile -o"$targetDir"
|
& ($currentDir + '\7z\7za.exe') x -y $targetFile -o"$targetDir"
|
||||||
if ($LastExitCode) { throw $LastExitCode }
|
if ($LastExitCode) { throw $LastExitCode }
|
||||||
|
|
||||||
Write-Host 'Delete downloaded file' -ForegroundColor Green
|
Write-Host 'Delete downloaded file' -ForegroundColor Green
|
||||||
Remove-Item $targetFile -Force -Recurse
|
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
|
Write-Host 'Delete current version' -ForegroundColor Green
|
||||||
Remove-Item $args[1] -Force -Recurse
|
Remove-Directory $currentDir
|
||||||
|
|
||||||
Write-Host 'Rename directory' -ForegroundColor Green
|
Write-Host 'Rename directory' -ForegroundColor Green
|
||||||
Rename-Item $targetDir (Split-Path $args[1] -Leaf)
|
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
|
Write-Host 'Update is complete' -ForegroundColor Green
|
||||||
|
|||||||
Reference in New Issue
Block a user