vapoursynth / vsrepo

A simple package repository for VapourSynth
MIT License
106 stars 27 forks source link

bat wrapper #128

Closed stax76 closed 4 years ago

stax76 commented 4 years ago

I think a bat wrapper would be handy since bat is defined in PATHEXT and py is not.

vsrepo.bat

python.exe "%~dp0vsrepo.py" %*

This would allow to call it like so:

vsrepo -h

%~dp0 returns the folder of the bat file so the bat file vsrepo.bat must be in the same folder then vsrepo.py.

I've tested it with portable vapoursynth in a Windows Terminal PowerShell session.

stuxcrystal commented 4 years ago

No. God, Please, No.

Just use vsrepo.exe which, in the vsrepo-setup.py actually creates. And does not have the well known problems that other programming languages have that use .bat-shims: Namely Ctrl-C not working properly.

myrsloik commented 4 years ago

What @stuxcrystal said. Interestingly enough .PY and .PYW did make its way into my PATHEXT automatically. Most likely the Python installer did it. If you want to install Python then install Python.

stax76 commented 4 years ago

I cannot find vsrepo-setup.py on my system or in the vsrepo website, this is not going to produce huge bloat by pulling a bunch of python dependencies and putting a full python environment in the exe?

Average users expect things to work out of the box, not every vapoursynth user is a programmer with command shell experience.

Maybe the python installer puts py in PATHEXT and maybe does this by defaults but security wise it's probably not a particular good idea for average users. There is no ps1 in PATHEXT and even if it would the script would still not run with the default policy.

theChaosCoder commented 4 years ago

hmm I can just call vsrepo from powershell

stax76 commented 4 years ago

hmm I can just call vsrepo from powershell

probably because py is in PATHEXT

theChaosCoder commented 4 years ago

You could apply the same security concerns to bat, cmd, exe and vbs ...

stuxcrystal commented 4 years ago

The setup.py is located here https://github.com/vapoursynth/vsrepo/blob/master/setup.py

Let me clarify: If you are using the portable-version of vapoursynth, I kinda expect those people to know what they are doing. If you are wrapping vapoursynth in your own application and want to use the portable version, it is your problem to get it working.

But thats just my opinion.

stax76 commented 4 years ago

You could apply the same security concerns to bat, cmd, exe and vbs ...

Ok, I didn't think it to the end.

If you are wrapping vapoursynth in your own application and want to use the portable version, it is your problem to get it working.

For you and me it's an easy tasks, I suggested it for average users or maybe noobs that want to learn the command line and vapoursynth.

stax76 commented 4 years ago

Namely Ctrl-C not working properly

I think Ctrl-C would work in a powershell session, just tried it with a test bat that sleeps for ten seconds.

timeout /T 10

It shows:

Terminate batch job (Y/N)?

Anyway, it was just an idea. staxrip has a feature to show Windows Terminal with special staxrip environment setup, I could adjust it for instance with an alias or create a bat wrapper but without timestamps I probably won't use vsrepo.