Coder Social home page Coder Social logo

mpv-packaging's Introduction

mpv-packaging

Used to package mpv build before publish

mpv-packaging's People

Contributors

andrew-boyarshin avatar dnmtx avatar guihkx avatar hill-98 avatar hooke007 avatar iamcristye avatar parkel42 avatar shinchiro avatar smithy3 avatar tobbez avatar xd003 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mpv-packaging's Issues

Using 7-Zip from Program Files does not allow the update to go though

When running the update script for mpv while having 7-Zip 22.00 x64 installed at "C:\Program Files\7-Zip" the extraction of the new version fails with "ERROR: Cannot delete output file : The process cannot access the file because it is being used by another process. : .\mpv.exe":

image

This happens on a machine with Windows 10 21H2. The location of the mpv folder does not seem to matter (same problem on C:, C:\Program Files and on another partition). The script is run with administrator privileges on an administrator account. Mpv is definitely not running when the update is done, so the file being in use is quite strange.

Commenting out the if instruction in method Extract-Archive of updater.ps1 (lines 77 and 78) and allowing the usage of the downloaded 7za.exe extracts the archive without issues.

Perhaps it would be nice to have an option to toggle on/off the usage of the system installed 7-Zip.

[request] please add docs for the tools at "installer"

I think it would be useful to have some documentation for the tools at the installer/ dir.

Explain what each tool does (a line or two would probably enough for each tool), whether there are gotchas to be aware of, etc.

For instance, I think mpv-install.bat only does file associations, but users could think that it installs mpv to some place, and that they can delete the extracted dir after installation. Or maybe it does some other things other than file associations, etc - it's hard to tell because the script is not small, and not all users can read and understand scripts.

The other tools would also benefit from a short description.

Thanks.

updater.bat -ArgumentList ?

is it possible to run updater.bat with argument?
example: update.bat -installmpv -install yt-dlp -installffmpeg

[Bug] 7z location detection fails when more than one 7z.exe exists

I have two available 7z binaries in my environment.

$Get-Command -CommandType Application -ErrorAction Ignore 7z.exe

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     7z.exe                                             0.0.0.0    C:\Users\...
Application     7z.exe                                             19.0.0.0   C:\Users\...
$(Get-Command -CommandType Application -ErrorAction Ignore 7z.exe).Source
C:\Users\foo\bar\7z.exe
C:\Users\hoge\huga\7z.exe

This causes updater.ps1 to try and execute the combined two paths("C:\Users\foo\bar\7z.exe C:\Users\hoge\huga\7z.exe") and fail.

[Windows 10] Update error: "The request was aborted: Could not create SSL/TLS secure channel."

Windows 10 Pro 1709 16299.248

When I try to update the player, I get the following error:

Running script with administrator privileges
Checking Windows PowerShell version -- 5
Fetching RSS feed for mpv
The request was aborted: Could not create SSL/TLS secure channel.

A possible temporary solution is to add the following line to the beginning of the updater.ps1 file:

[Net.ServicePointManager]::SecurityProtocol = [System.Security.Authentication.SslProtocols] "tls, tls11, tls12"

Perhaps there is a more correct solution.

Updater.ps1 script is creating empty channel element in settings.xml file

Hi!

Updater.ps1 script is creating empty channel element in settings.xml file when the timer runs out or if the user choses a value different from D1 or D2 and it is causing the Cannot index into a null array. error when the timer runs out.

function Check-ChannelRelease is suggesting on the output that the user should choose daily or weekly updates frequency and then it's checking users input as D1 for weekly and D2 for daily and it's also accepting any other value the user types.

My suggestion is to force either daily or week update channel as the default update channel.

By replacing the test on the line 223

elseif ($result -eq 'D2') {

with

else {

we would be forcing daily update channel.

Lastly, I understand that by forcing the default update channel to daily may increase the number of requests on the server. But then you ought to change the default channel to weekly.

Auto-Update FFmpeg

The latest commit shinchiro/mpv-winbuild-cmake@1e2c139 adds FFmpeg to https://github.com/shinchiro/mpv-winbuild-cmake/releases

Will it be possible to add FFmpeg as Auto-Update the same way it's updating mpv and yt-dlp?
(Here: https://github.com/shinchiro/mpv-packaging/blob/master/mpv-root/installer/updater.ps1)

Also - Since FFmpeg is named ffmpeg_x64.exe, I would love to have to option that it will auto-rename it to ffmpeg.exe since Windows, or other applications that use FFmpeg won't be able to find it unless it's named ffmpeg.exe

mpv-install.bat: add mpv to `%PATH%`

Current behavior:
Open cmd and type mpv:

'mpv' is not recognized as an internal or external command,
operable program or batch file.

Suggested behavior:
add mpv to %PATH% so that if I type mpv in cmd it will open mpv.

updater.ps1 "Cannot index into a null array" error when no match in function ExtractGitFromFile

In
function ExtractGitFromFile {
$stripped = .\mpv --no-config | select-string "mpv" | select-object -First 1
$pattern = "-g([a-z0-9-]{7})"
$bool = $stripped -match $pattern
return $matches[1]
}

if there is no match, script will terminate with error "Cannot index into a null array"

suggest using a check like:
if($bool) { return $matches[1] } else { return "" }

Probably will get same error from ExtractGitFromURL and ExtractDateFromURL

Hide Invoke-WebRequest Progress Bars

As per the below PowerShell issue, I believe the progress for Invoke-WebRequests should be disabled in the update script.
PowerShell/PowerShell#2138

I have noticed that it takes about a second or two to download updates with the script without the progress displayed, versus ~20 seconds with it. It's fast enough that the progress needn't be displayed.

Perhaps, that could be an option to enable/disable since people with slow internet connections might have a different experience.

Updater keeps telling me there is a newer nightly yt-dlp build even though I already have it

Just to show this in action, here's the text I get from the .bat when updating.

You are already using latest mpv build -- mpv-x86_64-20230409-git-9a8b317.7z
Fetching RSS feed for ytp-dlp
Newer yt-dlp build available
Available version: [email protected], Current version: [email protected]
Current Build Hash: ead313a35820b021b3ee16c9b803e82e503ffc598b4d790e85ea14f5ba491058
yt-dlp is up to date ([email protected])
Operation completed

mpv-install doesn't escape paths properly

E.g. HKEY_CLASSES_ROOT\io.mpv.m4a\shell\open\command: "C:\ProgramData\Export\mpv.exe" -- "%L, the path argument is missing the end quote. Doesn't cause issues that I know of, but might still be worth a fix.

yt-dlp + ffmpeg update check skipped

image

Now it doesn't check for yt-dlp updates (not even rss feed) + doesn't check for ffmpeg updates.

So if yt-dlp exists = don't update it? what's the reason behind it? I want to update mpv + yt-dlp + ffmpeg.

#33

Add updates checking for ffmpeg

I don't know how many people are like me: tend to put ffmpeg and youtube-dl in the same folder as sometimes ffmpeg can help correct the downloaded files. So it might be a good idea to include that in the update powershell file

updater.bat uses taken down youtube-dl RSS

Due to certain "polite request" from RIAA youtube-dl was taken off github into DMCA repo, making the RSS feed dead.
This results in the following when using updater.bat:

Fetching RSS feed for youtube-dl
The remote server returned an error: (451) Unavailable for Legal Reasons.
Press any key to continue . . .

A few suggestions

  • The updater script should also delete the downloaded .7z file.
  • Installer should create a start menu link to the mpv executable so it functions like a normal install. I've tried doing thing myself, but it would probably have to rely on PowerShell to create an actual shortcut file, as in an .lnk file.
  • This is probably beyond the scope of the install.bat script, but it would be nice if there was a registry entry for mpv under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall so the installer functions like an actual installer, with an UninstallString referencing the uninstall.bat file.

On a side note, I really appreciate your mpv builds and I thank you for making them.

Error when running updater.bat

Recently I am getting an error message when running updater.bat on Windows 11. In Poweshell I get the following:

Running script with administrator privileges
Checking Windows PowerShell version -- 5
Fetching RSS feed for mpv
The path is not of a legal form.

Waiting for 3 seconds, press a key to continue ...

In Event Viewer Windows Powershell log I get this every time I try to run the script:

Event 403, Powershell(Powershell)

Engine state is changed from Available to Stopped. 

Details: 
	NewEngineState=Stopped
	PreviousEngineState=Available

	SequenceNumber=15

	HostName=ConsoleHost
	HostVersion=5.1.22621.436
	HostId=a31be240-85f0-4e4c-b1d6-9d89697aa43f
	HostApplication=powershell -noprofile -nologo -executionpolicy bypass -File C:\Users\chris\mpv\\installer\updater.ps1
	EngineVersion=5.1.22621.436
	RunspaceId=80109a90-d4d6-4f3b-b907-9488b3be9010
	PipelineId=
	CommandName=
	CommandType=
	ScriptName=
	CommandPath=
	CommandLine=

I'm not a developer so it may be obvious what's going on here, but I would like to know anyway. It has worked fine for months.

[suggestion] updater.bat

Just a small "lazy" suggestion for consideration.Removing the "-noexit" argument and adding pause at the end will keep the window open unless "any key" is pressed,right now ,user either have to type exit after update is finished or close the window manually.It's just more convenient this way.Thank you.

Updater not working with error "The path is not of a legal form."

The script was exiting with the above error when reaching the

$result = [xml](New-Object System.Net.WebClient).DownloadString($rss_link)

After a lot debugging I realized the the reason for exiting with an error was because I had an older settings.xml at my folder where the x86_64-v3 was missing (there wasn't that option when it was created) resulting the script to crash.

A quick solution for anyone else with same problem is to delete the settings.xml and then running again the updater.bat

I have two suggestions to avoid those kind of cases in the future:

  1. If something is missing from the xml, then run the function to get the user's preference
  2. Add as an option at the beginning of the script for the user to reset his selection (delete the settings.xml)
    "Do you want to reset your update preferences? (Try this if the script doesn't work for you)"

Also as a feedback, it would be better if we had a lot more time to read the error message.

Thank you for your work and time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.