When I run:
winetricks install_mt5.verb
I've got the following error:
Unknown arg install_mt5
Usage: /usr/local/bin/winetricks [options] [command|verb|path-to-verb] ...
However it works when I rename the file to winetricks_mt5.verb.
Is that the expected behaviour that the file needs to be with specific pattern? Or this can be corrected?
I'm using winetricks 20160219.
Try:
winetricks ./install_mt5.verb
The same when specifying with ./ and with full path.
Works for me with 20160614, please update and retest.
Also, if still present, attach the full output, including the winetricks command.
Master branch has 20160425 the latest (as per WINETRICKS_VERSION variable), where I can find 20160614? Or how I can install it?
Here are clear steps to reproduce on empty folder with the version from master:
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
wget -O install_mt5.verb https://raw.githubusercontent.com/EA31337/FX-MT-VM/master/scripts/winetricks_mt5.verb
sh -x winetricks install_mt5.verb
Error:
Unknown arg install_mt5
It says it's using 20160425. It only works when you rename install_mt5.verb to winetricks_mt5.verb.
Trace output:
+ echo 'Using winetricks 20160425 - sha1sum: dcae61bee212ce79d810f45f4cb6a1e599b67ba8 with wine-1.8.1'
Using winetricks 20160425 - sha1sum: dcae61bee212ce79d810f45f4cb6a1e599b67ba8 with wine-1.8.1
+ w_metadata adobeair dlls 'title=Adobe AIR 20.x' publisher=Adobe year=2015 media=download file1=AdobeAIRInstaller.exe 'installed_file1=C:\Program Files\Common Files/Adobe AIR/Versions/1.0/Adobe AIR.dll' homepage=http://www.adobe.com/products/air/
+ case $WINETRICKS_OPT_VERBOSE in
+ set +x
Unknown arg install_mt5
Tested on OS X.
This actually gives more trace output:
WINETRICKS_OPT_VERBOSE=2 winetricks install_mt5.verb
Output:
++ echo 'file1="mt5setup.exe"'
++ echo 'category="apps"'
++ case "$OS" in
++ grep '[^"]$' /var/folders/vp/tlt7xf791gl1_v56m0xdmrph0000gn/T//winetricks.cRvKWgZf/w.kenorb.54075/metadata/apps/winetricks_mt5.vars
++ unset _W_md_cmd
++ case $WINETRICKS_OPT_VERBOSE in
++ set -x
++ echo install_mt5.verb
++ sed 's,.*/,,;s,.verb,,'
+ verb=install_mt5
+ execute_command install_mt5
+ case "$1" in
+ cmd=install_mt5
+ arg=
+ case "$1" in
+ winetricks_metadata_exists install_mt5
+ test -f '/var/folders/vp/tlt7xf791gl1_v56m0xdmrph0000gn/T//winetricks.cRvKWgZf/w.kenorb.54075/metadata/*/install_mt5.vars'
+ echo Unknown arg install_mt5
Unknown arg install_mt5
+ winetricks_usage
+ case $LANG in
+ cat
Usage: /usr/local/bin/winetricks [options] [command|verb|path-to-verb] ...
I am missing anything in my verb file? Because this points me to this function:
# Returns true if given verb has been registered
winetricks_metadata_exists()
{
test -f "$WINETRICKS_METADATA"/*/$1.vars
}
which checking whether verb was registered. I'm not sure what does it mean. And what is the .vars file.
I tested with some basic .verb files, which work. A few things I noticed
A) your .verb file starts with #!/bin/bash, which isn't needed (and that's not valid bash on its own).
B) The real problem is that winetricks doesn't like verbs that start with install_. That may or may not be a valid bug, I haven't dug into it yet. The .verb handling is kind of a mess, I don't have time right now to dig into that rabbit hole.
Btw, here's what I mean by a basic verb:
w_metadata true app
load_true()
{
echo "true should succeed"
true
}
Okay, so I found out what's going on. .verbs aren't really documented (they were on google code, but I don't think the wiki was moved. Anyway, what's going on is your verb's name and your command must match. Your command was winetricks_mt5, so when you had install_mt5.verb, it failed. Renaming to winetricks_mt5, which makes, worked around it. if you use asdf_mt5, or mf1.verb, it would also fail.
On that note, winetricks_ shouldn't be used in a verb's name. Just use 'mt5' and 'mt5.verb', and remove #!/bin/bash
@austin987 Thanks for your help, I'll try changing the command name. Btw. the wiki pages can be still exported I think.
I added a note on the readme:
https://github.com/Winetricks/winetricks/commit/75eb191b7630336a5b5822d3ebb41039977e54f9
and some tests, to prevent future breakage:
https://github.com/Winetricks/winetricks/commit/6c734f1023d50f8f09811aa7ea42469a13b4c148
BTW, the wiki is here: https://github.com/Winetricks/winetricks/tree/wiki
Most helpful comment
Okay, so I found out what's going on. .verbs aren't really documented (they were on google code, but I don't think the wiki was moved. Anyway, what's going on is your verb's name and your command must match. Your command was winetricks_mt5, so when you had install_mt5.verb, it failed. Renaming to winetricks_mt5, which makes, worked around it. if you use asdf_mt5, or mf1.verb, it would also fail.
On that note, winetricks_ shouldn't be used in a verb's name. Just use 'mt5' and 'mt5.verb', and remove #!/bin/bash