Winetricks / winetricks

Winetricks is an easy way to work around problems in Wine
GNU Lesser General Public License v2.1
2.8k stars 403 forks source link

Wrong package folder after AHK installation #1198

Closed kenorb closed 5 years ago

kenorb commented 5 years ago

I'm using the latest winetricks.

I'd like to fix/improve the installation of MT4, however I've encouraged some bug in winetricks.

In load_mt4() we do w_download then _try_cd "$W_CACHE/$W_PACKAGE" right before w_ahk_do in order to run ${file1}.

However first time when AHK is installed, on w_ahk_do execution, we're already in the wrong folder. We are in AHK folder, not in package one.

Here are reproducible steps using Docker container:

  1. docker run -it ea31337/ea-tester bash.
  2. Inside container: wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.
  3. Setup Xvfb display: ./eval.sh set_display (you can connect to it via VNC).
  4. Export DISPLAY by: export DISPLAY=:0.0.
  5. Run: bash -x winetricks mt4.

Relevant output:

Executing cd /home/ubuntu/.cache/winetricks/ahk
... AHK is installing...
Executing cd /home/ubuntu/.cache/winetricks/ahk # This is incorrect!
Executing wine y:\ahk\AutoHotkey.exe C:\windows\Temp\_mt4\tmp.ahk

Additional notes:

austin987 commented 5 years ago

While I don't doubt there could be a bug, I don't see it. To reproduce, I used:wineserver -k ; rm -rf ~/.wine ~/.cache/winetricks/ahk/ ~/.cache/winetricks/mt4/ ; winetricks -q mt4

so it's a clean prefix and mt4/ahk aren't downloaded. I added some echos to see what the cwd is:

diff --git a/src/winetricks b/src/winetricks
index 4487aa5..d374089 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -1875,6 +1875,7 @@ _EOF_

 w_ahk_do()
 {
+    echo "start w_ahk_do value is $W_CACHE/$W_PACKAGE"
     if ! test -f "$W_CACHE/ahk/AutoHotkey.exe"; then
         W_BROWSERAGENT=1 \
         w_download_to ahk https://www.autohotkey.com/download/AutoHotkey104805.zip c8bf1c3dc4622559963b6626316ba1d083bb8a8af605f78382e371e5294d435a
@@ -1890,6 +1891,7 @@ w_opt_unattended = ${W_OPT_UNATTENDED:-0}
 $@
 _EOF_
     w_try "$WINE" "$W_CACHE_WIN\\ahk\\AutoHotkey.exe" "$W_TMP_WIN"\\tmp.ahk
+    echo "end w_ahk_do value is $W_CACHE/$W_PACKAGE"
 }

 # Function to protect Wine-specific sections of code.
@@ -13435,6 +13437,7 @@ w_metadata mt4 apps \

 load_mt4()
 {
+    echo "start mt4 value is $W_CACHE/$W_PACKAGE"
     w_download https://web.archive.org/web/20160112133258/https://download.mql5.com/cdn/web/metaquotes.software.corp/mt4/mt4setup.exe?utm_campaign=www.metatrader4.com 96c82266e18cc4ada1bbc0cd0ada74c3a31d18914fb1a36626f4596c8bacb6f0 mt4setup.exe

     if w_workaround_wine_bug 7156 "${title} needs wingdings.ttf, installing opensymbol"; then
@@ -13445,9 +13448,12 @@ load_mt4()
     WINEDLLOVERRIDES="winebrowser.exe="
     export WINEDLLOVERRIDES

+    echo "middle mt4 value is $W_CACHE/$W_PACKAGE"
     # No documented silent install option, unfortunately..
     w_try_cd "$W_CACHE/$W_PACKAGE"
     w_ahk_do "
+        FileAppend, mt4/w_ahk_do value is %A_WorkingDir%, *
+        exit
         Run, ${file1}
         WinWait, MetaTrader Setup, license agreement
         ControlClick, Button1
@@ -13458,6 +13464,7 @@ load_mt4()
         Process, Wait, terminal.exe
         Process, Close, terminal.exe
     "
+    echo "end mt4 value is $W_CACHE/$W_PACKAGE"
 }

 #----------------------------------------------------------------

running that (after WINEDEBUG=-all to reduce output), shows the cwd is set properly:

Using winetricks 20190310-next - sha256sum: 125f4a133beda72a8179372693af4eaac1bcb69c4a683d90b7e519880f13d1c9 with wine-4.5 and WINEARCH=win32
Executing w_do_call mt4
Executing load_mt4 
start mt4 value is /home/austin/.cache/winetricks/mt4
Executing mkdir -p /home/austin/.cache/winetricks/mt4
Executing cd /home/austin/.cache/winetricks/mt4
Downloading https://web.archive.org/web/20160112133258/https://download.mql5.com/cdn/web/metaquotes.software.corp/mt4/mt4setup.exe?utm_campaign=www.metatrader4.com to /home/austin/.cache/winetricks/mt4
--2019-03-31 20:00:25--  https://web.archive.org/web/20160112133258/https://download.mql5.com/cdn/web/metaquotes.software.corp/mt4/mt4setup.exe?utm_campaign=www.metatrader4.com
Resolving web.archive.org... 207.241.233.214
Connecting to web.archive.org|207.241.233.214|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/exe]
Saving to: 'mt4setup.exe'

mt4setup.exe                                        [    <=>                                                                                               ] 568.17K   773KB/s    in 0.7s    

2019-03-31 20:00:26 (773 KB/s) - 'mt4setup.exe' saved [581808]

Executing cd /home/austin/src/winetricks
------------------------------------------------------
Working around wine bug 7156 -- Meta Trader 4 needs wingdings.ttf, installing opensymbol
------------------------------------------------------
Executing w_do_call opensymbol
Executing load_opensymbol 
Executing cd /home/austin/.wine/dosdevices/c:/windows/temp/_opensymbol
Executing ar x /home/austin/.cache/winetricks/opensymbol/fonts-opensymbol_102.2+LibO3.5.4+dfsg2-0+deb7u11_all.deb data.tar.xz
Executing tar -Jxf /home/austin/.wine/dosdevices/c:/windows/temp/_opensymbol/data.tar.xz ./usr/share/fonts/truetype/openoffice/opens___.ttf
------------------------------------------------------
Running /usr/local/bin/wineserver -w. This will hang until all wine processes in prefix=/home/austin/.wine terminate
------------------------------------------------------
Executing wine regedit /S C:\windows\Temp\_opensymbol\_register-font.reg
Executing cp /home/austin/.wine/dosdevices/c:/windows/temp/_opensymbol/_register-font.reg /tmp/winetricks.jjtPrNz9/_reg_27db49c0_21907.reg
Executing wine regedit /S C:\windows\Temp\_opensymbol\_register-font.reg
Executing cp /home/austin/.wine/dosdevices/c:/windows/temp/_opensymbol/_register-font.reg /tmp/winetricks.jjtPrNz9/_reg_7fd847b4_21907.reg
middle mt4 value is /home/austin/.cache/winetricks/mt4
Executing cd /home/austin/.cache/winetricks/mt4
start w_ahk_do value is /home/austin/.cache/winetricks/mt4
Executing mkdir -p /home/austin/.cache/winetricks/ahk
Executing cd /home/austin/.cache/winetricks/ahk
Downloading https://www.autohotkey.com/download/AutoHotkey104805.zip to /home/austin/.cache/winetricks/ahk
--2019-03-31 20:00:27--  https://www.autohotkey.com/download/AutoHotkey104805.zip
Resolving www.autohotkey.com... 2606:4700:20::6819:7810, 2606:4700:20::6819:7910, 104.25.121.16, ...
Connecting to www.autohotkey.com|2606:4700:20::6819:7810|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.autohotkey.com/download/1.0/AutoHotkey104805.zip [following]
--2019-03-31 20:00:27--  https://www.autohotkey.com/download/1.0/AutoHotkey104805.zip
Reusing existing connection to [www.autohotkey.com]:443.
HTTP request sent, awaiting response... 200 OK
Length: 2047047 (2.0M) [application/octet-stream]
Saving to: 'AutoHotkey104805.zip'

AutoHotkey104805.zip                            100%[=====================================================================================================>]   1.95M  1.51MB/s    in 1.3s    

2019-03-31 20:00:28 (1.51 MB/s) - 'AutoHotkey104805.zip' saved [2047047/2047047]

Executing cd /home/austin/.cache/winetricks/mt4
Executing wine y:\ahk\AutoHotkey.exe C:\windows\Temp\_mt4\tmp.ahk
mt4/w_ahk_do value is Y:\mt4end w_ahk_do value is /home/austin/.cache/winetricks/mt4
end mt4 value is /home/austin/.cache/winetricks/mt4

w_download will cd (to the cache directory), but it does a cd to the previous directory before it finishes. As you can see above, when w_ahk_do() runs, the CWD is ~/.cache/winetricks/mt4.

If you want set -x; you can use winetricks -v (though calling it directly with bash -x should also work). There's a small portion of the code that disables set -x (generating the metadata) which is superverbose, but if you want it, you can use -vv or --really-verbose.

In addition, the files are in their correct place in the cache:

austin@laptop:~/src/winetricks$ ls ~/.cache/winetricks/mt4/ ~/.cache/winetricks/ahk/
/home/austin/.cache/winetricks/ahk/:
AU3_Spy.exe  AutoHotkey104805.zip  AutoHotkey.exe

/home/austin/.cache/winetricks/mt4/:
mt4setup.exe

Note: I'm not using docker. I don't see why docker would break things, but you may wan to try without docker to see what's different. In addition, make sure you're really using the latest winetricks (20190310-next)

kenorb commented 5 years ago

I've recorded cast at:

asciicast

To play on local terminal, so it can be terminal scrolled, run:

asciinema play https://asciinema.org/a/nH5Dljxl7jG56db0jqkhNkqbx

Here is the relevant log:

$ bash -x winetricks -v mt4
...
Executing cd /home/ubuntu/.cache/winetricks/mt4
+ case "$1" in
+ cd /home/ubuntu/.cache/winetricks/mt4
+ status=0
+ test 0 -ne 0
+ w_ahk_do '
... (correct till this point)...

+ mkdir -p /home/ubuntu/.cache/winetricks/ahk
+ status=0
+ test 0 -ne 0
+ checksum_ok=
+ tries=0
+ test 0 -lt 2
+ test 0 -eq 1
+ tries=1
+ test -s /home/ubuntu/.cache/winetricks/ahk/AutoHotkey104805.zip
+ test -f /home/ubuntu/.cache/winetricks/ahk/AutoHotkey104805.zip
++ pwd
+ _W_dl_olddir=/home/ubuntu/.cache/winetricks/mt4
... (still correct)...

...(here we're changing dir to ahk, not correct)...
+ w_try_cd /home/ubuntu/.cache/winetricks/ahk
+ w_try cd /home/ubuntu/.cache/winetricks/ahk
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing cd /home/ubuntu/.cache/winetricks/ahk'
Executing cd /home/ubuntu/.cache/winetricks/ahk
+ case "$1" in
+ cd /home/ubuntu/.cache/winetricks/ahk
+ status=0
+ test 0 -ne 0
+ echo 'Downloading https://www.autohotkey.com/download/AutoHotkey104805.zip to /home/ubuntu/.cache/winetricks/ahk'

...(due to Captcha on AHK site, we're re-trying again from archived version)...
+ tries=2
+ test -s /home/ubuntu/.cache/winetricks/ahk/AutoHotkey104805.zip
+ test -f /home/ubuntu/.cache/winetricks/ahk/AutoHotkey104805.zip
+ rm /home/ubuntu/.cache/winetricks/ahk/AutoHotkey104805.zip
++ pwd

...(_W_dl_olddir is overriden with AHK dir?)...
+ _W_dl_olddir=/home/ubuntu/.cache/winetricks/ahk
+ w_try_cd /home/ubuntu/.cache/winetricks/ahk
+ w_try cd /home/ubuntu/.cache/winetricks/ahk
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing cd /home/ubuntu/.cache/winetricks/ahk'
Executing cd /home/ubuntu/.cache/winetricks/ahk

...(entering AHK folder once again)...
2019-04-01 18:27:38 (407 KB/s) - 'AutoHotkey104805.zip' saved [2047047]
+ test 0 = 0
++ command -v file
+ _W_filetype=/usr/bin/file
+ case $_W_filetype-$_W_file in
+ case $(file "$_W_file") in
++ file AutoHotkey104805.zip
+ case "$_W_file" in
+ w_try_cd /home/ubuntu/.cache/winetricks/ahk
+ w_try cd /home/ubuntu/.cache/winetricks/ahk
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing cd /home/ubuntu/.cache/winetricks/ahk'
Executing cd /home/ubuntu/.cache/winetricks/ahk

This could be the cause?

...(_W_dl_olddir is overriden with AHK dir?)...
+ _W_dl_olddir=/home/ubuntu/.cache/winetricks/ahk

Not sure what's special in my configuration. Maybe it's because AHK every time is downloaded after 2nd attempt, it's due to Captcha hit while downloading AHK, so it always gets the archived version (I've got the Captcha on their website even on my web-browser, I'm from UK, I didn't use VPN). So if the code tried to back to previous path, not sure of the logic, it goes back to AHK, since it was entering this dir around 3 times.

Re captcha, I've other scripts which are installing AHK (which can help), but from the GitHub directly, to avoid Captcha.

austin987 commented 5 years ago

I wasn't aware that there was a github option now, that's good to know.

Yeah, I was suspicious of the olddir variable. It's being set inside the loop, which would cause your problem. I don't know why I'm not getting the captcha, I ran several times without issue.

In any case, does https://github.com/austin987/winetricks/tree/1198-autohotkey make a difference for you? It should solve the problem in two ways (use github so you don't get the captcha, and fix the variable being overwritten).

kenorb commented 5 years ago

The branch fails to install 7z.

+ winetricks_set_unattended 0
...
Executing wine 7z1602.exe
+ case "$1" in
+ wine 7z1602.exe

It seems $W_UNATTENDED_SLASH_S is empty in load_7zip(), so it runs the GUI installer instead.

Log file: winetricks.log

austin987 commented 5 years ago

It's unset if you don't use -q, which makes sense on first thought, but yeah, is bad if a user doesn't have 7z installed AND runs winetricks in GUI mode AND uses a verb with w_ahk_do().

So, there are at least two things that I think need to happen: 1) if w_ahk_do() is called, and 7zip isn't installed, install it silently and move on. 2) Obviously better tests; since I have 7zip installed, the codepath for win32 7zip isn't tested much.

Could you confirm that winetricks -q mt4 (with my branch with the previously mentioned branch) correctly launches the mt4 installer for you (it won't install, since the upstream installer changed, which is what I assume you meant to fix in the first place)?

kenorb commented 5 years ago

Issue with 7zip installation

I've run as bash -x winetricks -v -q mt4, it added /S, but I seems that 7zip was not installed correctly.

+ printf '%s\n' 'Executing wine 7z1602.exe /S'
Executing wine 7z1602.exe /S
+ case "$1" in
+ wine 7z1602.exe /S
0009:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0025:err:clipboard:convert_selection Timed out waiting for SelectionNotify event
0009:err:ole:CoGetClassObject class {00021401-0000-0000-c000-000000000046} not registered
0009:err:ole:CoGetClassObject no class object {00021401-0000-0000-c000-000000000046} could be created for context 0x1
0009:err:ole:CoGetClassObject class {00021401-0000-0000-c000-000000000046} not registered
0009:err:ole:CoGetClassObject no class object {00021401-0000-0000-c000-000000000046} could be created for context 0x1
0009:err:ole:CoGetClassObject class {00021401-0000-0000-c000-000000000046} not registered
0009:err:ole:CoGetClassObject no class object {00021401-0000-0000-c000-000000000046} could be created for context 0x1
0009:err:ole:CoGetClassObject class {00021401-0000-0000-c000-000000000046} not registered
0009:err:ole:CoGetClassObject no class object {00021401-0000-0000-c000-000000000046} could be created for context 0x1
+ status=0
+ test 0 -ne 0
+ status=0
+ test 0 -ne 0
+ winetricks_stats_log_command 7zip
+ echo 7zip
+ case "$W_PLATFORM" in
+ _W_LOGDIR=/home/ubuntu/.wine
+ mkdir -p /home/ubuntu/.wine
+ echo 7zip
+ unset _W_LOGDIR
+ postfile=/home/ubuntu/.local/share/winetricks/postinstall/7zip/7zip-postinstall.sh
+ test -f /home/ubuntu/.local/share/winetricks/postinstall/7zip/7zip-postinstall.sh
+ test 'C:\Program Files (x86)/7-Zip/7zFM.exe'
+ winetricks_is_installed 7zip
+ unset _W_file _W_file_unix
+ test 'C:\Program Files (x86)/7-Zip/7zFM.exe'
+ _W_file='C:\Program Files (x86)/7-Zip/7zFM.exe'
+ grep -qw 7zip /home/ubuntu/.wine/winetricks.log
+ case "$W_PLATFORM" in
+ case "${category}-${WINETRICKS_OPT_SHAREDPREFIX}" in
+ _W_prefix=/home/ubuntu/.wine
+ test -d /home/ubuntu/.wine/dosdevices
+ _W_IFS='  
'
+ IFS='|'
+ for _W_file_ in '$_W_file'
++ WINEPREFIX=/home/ubuntu/.wine
++ w_pathconv -u 'C:\Program Files (x86)/7-Zip/7zFM.exe'
++ case "$W_PLATFORM" in
++ case "$@" in
++ winetricks_wintounix 'C:\Program Files (x86)/7-Zip/7zFM.exe'
++ _W_winp_='C:\Program Files (x86)/7-Zip/7zFM.exe'
++ _W_winp='\Program Files (x86)/7-Zip/7zFM.exe'
++ printf %s /home/ubuntu/.wine/dosdevices/c:
++ echo '\Program Files (x86)/7-Zip/7zFM.exe'
++ sed 's,\\,/,g'
+ _W_file_unix='/home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe'
+ test -f '/home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe'
+ IFS='     
'
+ unset _W_file _W_prefix _W_IFS
+ return 1
+ w_die '7zip install completed, but installed file /home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe not found'
+ w_warn '7zip install completed, but installed file /home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe not found'
+ '[' -z '' ']'
+ echo ------------------------------------------------------
------------------------------------------------------
+ echo '7zip install completed, but installed file /home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe not found'
7zip install completed, but installed file /home/ubuntu/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe not found
+ echo ------------------------------------------------------
------------------------------------------------------
+ test 1
+ _W_timeout='--timeout 5'
+ case $WINETRICKS_GUI in
+ unset _W_timeout
+ exit 1
+ exit 1
+ exit 1
+ winetricks_cleanup

It failed for Wine v4.5 (Windows 7). Same with winetricks -v -q 7zip.

I've checked Program Files/ and Program Files (x86)/, it's not there, instead it was installed in C:\7-Zip/ (~/.wine/drive_c/7-Zip).

I thought the workaround would be installing vb6run and changing from Windows 7 to Windows 10 in winecfg as per this post, but it didn't help.

So in summary:

I've tried changing Windows 10 back to Windows 7 and opposite. So I'm not quiet sure why it's installing in different folder.

Workaround

For workaround, removing .wine folder worked (rm -fr ~/.wine), then installing 7zip via winetricks -v -q 7zip, and it's installed in the expected folder.


Original issue

Following the above workaround with 7zip, the installation wizard seems to run correctly.

I've tested on Ubuntu host using bash -x winetricks -v -q mt4 using your branch, it also works fine (the installer shows up).


In summary, as reported originally, it seems the folder is changed to correct one after the fixes, right before running AHK script:

Executing cd /home/ubuntu/.cache/winetricks/mt4
+ case "$1" in
+ cd /home/ubuntu/.cache/winetricks/mt4
+ status=0
+ test 0 -ne 0
+ w_ahk_do '

If you think 7zip installation can be improved, that's great, otherwise I think your branch got enough fixes for now.

austin987 commented 5 years ago

The 7zip installation may have a bug, but I can't reproduce it. Works here with 32/64 bit wine, with/without xvfb. E.g.,:

+ w_try_7z /home/austin/.cache/winetricks/ahk /home/austin/.cache/winetricks/ahk/AutoHotkey104805_Install.exe AutoHotkey.exe AU3_Spy.exe
+ destdir=/home/austin/.cache/winetricks/ahk
+ filename=/home/austin/.cache/winetricks/ahk/AutoHotkey104805_Install.exe
+ shift 2
++ command -v zz7z
+ test -x ''
+ w_warn 'Cannot find 7z.  Using Windows 7-Zip instead. (You can avoid this by installing 7z, e.g. '\''sudo apt-get install p7zip-full'\'' or '\''sudo yum install p7zip-plugins'\'').'
+ '[' -z '' ']'
+ echo ------------------------------------------------------
------------------------------------------------------
+ echo 'Cannot find 7z.  Using Windows 7-Zip instead. (You can avoid this by installing 7z, e.g. '\''sudo apt-get install p7zip-full'\'' or '\''sudo yum install p7zip-plugins'\'').'
Cannot find 7z.  Using Windows 7-Zip instead. (You can avoid this by installing 7z, e.g. 'sudo apt-get install p7zip-full' or 'sudo yum install p7zip-plugins').
+ echo ------------------------------------------------------
------------------------------------------------------
+ test 1
+ _W_timeout='--timeout 5'
+ case $WINETRICKS_GUI in
+ unset _W_timeout
+ WINETRICKS_OPT_SHAREDPREFIX=1
+ w_call 7zip
+ w_try w_do_call 7zip
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing w_do_call 7zip'
Executing w_do_call 7zip
+ case "$1" in
+ w_do_call 7zip
+ test mt4 = vd
+ case "$1" in
+ cmd=7zip
+ arg=
+ W_TMP=/home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ W_TMP_WIN='C:\windows\Temp\_7zip'
+ test '' = 1
+ rm -rf /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ mkdir -p /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ unset conflicts installed_file1 installed_exe1
+ winetricks_metadata_exists 7zip
+ test -f /tmp/winetricks.L215rJGq/w.austin.27613/metadata/apps/7zip.vars
+ . /tmp/winetricks.L215rJGq/w.austin.27613/metadata/apps/7zip.vars
++ title='7-Zip 16.02'
++ publisher='Igor Pavlov'
++ year=2016
++ media=download
++ file1=7z1602.exe
++ installed_exe1='C:\Program Files (x86)/7-Zip/7zFM.exe'
++ category=apps
+ case "$W_PLATFORM" in
+ case "${category}-${WINETRICKS_OPT_SHAREDPREFIX}" in
+ test '' = 1
+ rm -rf /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ mkdir -p /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ test '' '!=' 1
+ test ''
+ test '' '!=' 1
+ winetricks_is_installed 7zip
+ unset _W_file _W_file_unix
+ test 'C:\Program Files (x86)/7-Zip/7zFM.exe'
+ _W_file='C:\Program Files (x86)/7-Zip/7zFM.exe'
+ grep -qw 7zip /home/austin/.wine/winetricks.log
+ unset _W_file
+ return 1
+ W_PACKAGE=7zip
+ w_try load_7zip ''
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing load_7zip '
Executing load_7zip 
+ case "$1" in
+ load_7zip ''
+ w_download https://downloads.sourceforge.net/sevenzip/7z1602.exe 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ w_download_to 7zip https://downloads.sourceforge.net/sevenzip/7z1602.exe 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ winetricks_download_setup
+ case "${WINETRICKS_DOWNLOADER}" in
+ :
+ WINETRICKS_DOWNLOADER_RETRIES=3
+ WINETRICKS_DOWNLOADER_TIMEOUT=15
+ case "$WINETRICKS_OPT_TORIFY" in
+ torify=
+ aria2c_torify_opts=
+ _W_packagename=7zip
+ _W_url=https://downloads.sourceforge.net/sevenzip/7z1602.exe
+ _W_sum=629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ _W_file=
+ _W_cookiejar=
+ case $_W_packagename in
+ echo https://downloads.sourceforge.net/sevenzip/7z1602.exe
+ grep ' '
+ '[' x = x ']'
++ basename https://downloads.sourceforge.net/sevenzip/7z1602.exe
+ _W_file=7z1602.exe
+ w_get_shatype 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ _W_sum=629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
++ echo 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
++ tr -d '\n'
++ wc -c
++ tr -d ' '
+ _W_sum_length=64
+ case "$_W_sum_length" in
+ _W_shatype=sha256
+ echo 7zip
+ grep -q -e '\/-' -e '^-'
+ echo 7zip
+ grep -q '^/'
+ _W_cache=/home/austin/.cache/winetricks/7zip
+ test '!' -d /home/austin/.cache/winetricks/7zip
+ checksum_ok=
+ tries=0
++ pwd
+ _W_dl_olddir=/home/austin/.cache/winetricks/mt4
+ test 0 -lt 2
+ test 0 -eq 1
+ tries=1
+ test -s /home/austin/.cache/winetricks/7zip/7z1602.exe
+ test 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ test 1 = 1
++ du -k /home/austin/.cache/winetricks/7zip/7z1602.exe
++ cut -f1
+ test 1084 -gt 500000
+ case "$_W_shatype" in
+ w_get_sha256sum /home/austin/.cache/winetricks/7zip/7z1602.exe
+ _W_sha256_file=/home/austin/.cache/winetricks/7zip/7z1602.exe
+ '[' -f /home/austin/.cache/winetricks/7zip/7z1602.exe ']'
++ sha256sum
++ sed 's/(stdin)= //;s/ .*//'
+ _W_gotsha256sum=629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ '[' 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865x = 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865x ']'
+ checksum_ok=1
+ break
+ test 629ce3c424bd884e74aed6b7d87d8f0d75274fb87143b8d6360c5eec41d5f865
+ test '!' 1
+ w_try_cd /home/austin/.cache/winetricks/7zip
+ w_try cd /home/austin/.cache/winetricks/7zip
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing cd /home/austin/.cache/winetricks/7zip'
Executing cd /home/austin/.cache/winetricks/7zip
+ case "$1" in
+ cd /home/austin/.cache/winetricks/7zip
+ status=0
+ test 0 -ne 0
+ w_try /opt/oldwow64/wine-4.5/bin/wine 7z1602.exe /S
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing /opt/oldwow64/wine-4.5/bin/wine 7z1602.exe /S'
Executing /opt/oldwow64/wine-4.5/bin/wine 7z1602.exe /S
+ case "$1" in
+ /opt/oldwow64/wine-4.5/bin/wine 7z1602.exe /S
+ status=0
+ test 0 -ne 0
+ status=0
+ test 0 -ne 0
+ winetricks_stats_log_command 7zip
+ echo 7zip
+ case "$W_PLATFORM" in
+ _W_LOGDIR=/home/austin/.wine
+ mkdir -p /home/austin/.wine
+ echo 7zip
+ unset _W_LOGDIR
+ postfile=/home/austin/.local/share/winetricks/postinstall/7zip/7zip-postinstall.sh
+ test -f /home/austin/.local/share/winetricks/postinstall/7zip/7zip-postinstall.sh
+ test 'C:\Program Files (x86)/7-Zip/7zFM.exe'
+ winetricks_is_installed 7zip
+ unset _W_file _W_file_unix
+ test 'C:\Program Files (x86)/7-Zip/7zFM.exe'
+ _W_file='C:\Program Files (x86)/7-Zip/7zFM.exe'
+ grep -qw 7zip /home/austin/.wine/winetricks.log
+ case "$W_PLATFORM" in
+ case "${category}-${WINETRICKS_OPT_SHAREDPREFIX}" in
+ _W_prefix=/home/austin/.wine
+ test -d /home/austin/.wine/dosdevices
+ _W_IFS='  
'
+ IFS='|'
+ for _W_file_ in $_W_file
++ WINEPREFIX=/home/austin/.wine
++ w_pathconv -u 'C:\Program Files (x86)/7-Zip/7zFM.exe'
++ case "$W_PLATFORM" in
++ case "$@" in
++ winetricks_wintounix 'C:\Program Files (x86)/7-Zip/7zFM.exe'
++ _W_winp_='C:\Program Files (x86)/7-Zip/7zFM.exe'
++ _W_winp='\Program Files (x86)/7-Zip/7zFM.exe'
++ printf %s /home/austin/.wine/dosdevices/c:
++ echo '\Program Files (x86)/7-Zip/7zFM.exe'
++ sed 's,\\,/,g'
+ _W_file_unix='/home/austin/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe'
+ test -f '/home/austin/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe'
+ grep -q 'Wine placeholder DLL' '/home/austin/.wine/dosdevices/c:/Program Files (x86)/7-Zip/7zFM.exe'
+ IFS='     
'
+ unset _W_file _W_file_ _W_file_unix _W_prefix _W_IFS
+ return 0
+ test '' = 1
+ test '' = 1
+ rm -rf /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ mkdir -p /home/austin/.wine/dosdevices/c:/windows/temp/_7zip
+ unset W_USE_USERMOUNT
+ status=0
+ test 0 -ne 0
++ w_pathconv -w /home/austin/.cache/winetricks/ahk/AutoHotkey104805_Install.exe
++ case "$W_PLATFORM" in
++ case "$@" in
++ winetricks_early_wine winepath -w /home/austin/.cache/winetricks/ahk/AutoHotkey104805_Install.exe
++ WINEDEBUG=-all
++ /opt/oldwow64/wine-4.5/bin/wine winepath -w /home/austin/.cache/winetricks/ahk/AutoHotkey104805_Install.exe
++ sed 's/.*1h.=//'
++ tr -d '\r'
++ grep -v -e 'Module not found' -e 'Could not load wine-gecko'
++ w_pathconv -w /home/austin/.cache/winetricks/ahk
++ case "$W_PLATFORM" in
++ case "$@" in
++ winetricks_early_wine winepath -w /home/austin/.cache/winetricks/ahk
++ WINEDEBUG=-all
++ /opt/oldwow64/wine-4.5/bin/wine winepath -w /home/austin/.cache/winetricks/ahk
++ sed 's/.*1h.=//'
++ tr -d '\r'
++ grep -v -e 'Module not found' -e 'Could not load wine-gecko'
+ w_try /opt/oldwow64/wine-4.5/bin/wine 'C:\Program Files (x86)\7-Zip\7z.exe' x 'Y:\ahk\AutoHotkey104805_Install.exe' '-oY:\ahk' AutoHotkey.exe AU3_Spy.exe
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing /opt/oldwow64/wine-4.5/bin/wine C:\Program Files (x86)\7-Zip\7z.exe x Y:\ahk\AutoHotkey104805_Install.exe -oY:\ahk AutoHotkey.exe AU3_Spy.exe'
Executing /opt/oldwow64/wine-4.5/bin/wine C:\Program Files (x86)\7-Zip\7z.exe x Y:\ahk\AutoHotkey104805_Install.exe -oY:\ahk AutoHotkey.exe AU3_Spy.exe
+ case "$1" in
+ /opt/oldwow64/wine-4.5/bin/wine 'C:\Program Files (x86)\7-Zip\7z.exe' x 'Y:\ahk\AutoHotkey104805_Install.exe' '-oY:\ahk' AutoHotkey.exe AU3_Spy.exe

7-Zip [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21

Scanning the drive for archives:
1 file, 2047357 bytes (2000 KiB)

Extracting archive: Y:\ahk\AutoHotkey104805_Install.exe
--       
Path = Y:\ahk\AutoHotkey104805_Install.exe
Type = Nsis
Physical Size = 2047357
Method = LZMA:23
Solid = +
Headers Size = 42403
Embedded Stub Size = 49152
SubType = NSIS-2

Everything is Ok

Files: 2
Size:       259616
Compressed: 2047357
+ status=0
+ test 0 -ne 0
+ chmod +x /home/austin/.cache/winetricks/ahk/AutoHotkey.exe
+ cat
+ awk 'sub("$", "\r")'
+ w_try /opt/oldwow64/wine-4.5/bin/wine 'y:\ahk\AutoHotkey.exe' 'C:\windows\Temp\_mt4\tmp.ahk'
+ export WINEDLLOVERRIDES
+ printf '%s\n' 'Executing /opt/oldwow64/wine-4.5/bin/wine y:\ahk\AutoHotkey.exe C:\windows\Temp\_mt4\tmp.ahk'
Executing /opt/oldwow64/wine-4.5/bin/wine y:\ahk\AutoHotkey.exe C:\windows\Temp\_mt4\tmp.ahk
+ case "$1" in
+ /opt/oldwow64/wine-4.5/bin/wine 'y:\ahk\AutoHotkey.exe' 'C:\windows\Temp\_mt4\tmp.ahk'

I'll push the current fixes shortly and close this. If you find more issues, please open a new bug (or send a PR for the mt4 stuff ;) ).

austin987 commented 5 years ago

https://github.com/Winetricks/winetricks/commit/5128c9f3941d160af2c08dab4e89153fc71d08c5 https://github.com/Winetricks/winetricks/commit/5a207df50196b548e489e09c6adcba166e9b2e4d