From f20d37f6dc9c776fbca80bb251d945fffe906130413e30fa56a3b7fdbbec222a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 18 Oct 2016 21:54:51 +0000 Subject: [PATCH] - Updated to 1.9.21 development snapshot - Initial version of the HID minidriver. - Support for lists in the RichEdit control. - System tray improvements. - Various bug fixes. - updated winetricks OBS-URL: https://build.opensuse.org/package/show/Emulators/wine?expand=0&rev=375 --- wine-1.9.20.tar.bz2 | 3 - wine-1.9.20.tar.bz2.sign | 16 - wine-1.9.21.tar.bz2 | 3 + wine-1.9.21.tar.bz2.sign | 16 + wine.changes | 10 + wine.spec | 4 +- winetricks | 1190 ++++++++++++++++++++------------------ winetricks.1 | 2 +- 8 files changed, 649 insertions(+), 595 deletions(-) delete mode 100644 wine-1.9.20.tar.bz2 delete mode 100644 wine-1.9.20.tar.bz2.sign create mode 100644 wine-1.9.21.tar.bz2 create mode 100644 wine-1.9.21.tar.bz2.sign diff --git a/wine-1.9.20.tar.bz2 b/wine-1.9.20.tar.bz2 deleted file mode 100644 index 85ff3ba..0000000 --- a/wine-1.9.20.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2769f30642329916f12696f7be225644d28fc54d1b9181c979381d70b9a279df -size 23555024 diff --git a/wine-1.9.20.tar.bz2.sign b/wine-1.9.20.tar.bz2.sign deleted file mode 100644 index c6eb574..0000000 --- a/wine-1.9.20.tar.bz2.sign +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIcBAABCAAGBQJX79ZoAAoJEM76yOqvF1Gd3pkP/ROQzpA5VdiI84mglIQnYO8O -4SlHXM+DFpyhSAeCVPS48G93Gdgg+YZtHv3KMP6ulOvq6yvyfZdkkwnPg3L9u0AS -eem3ujYqwm4DvRNgl4y5LLZ6SYVZvuy2YVWyO4bY3kx6r5qFWVinJS5O59ackQC4 -DMh3OtZrDXL1W3URkICYBrgabKt7F9/oCtTbk3dL8bmzlY6s6Kok8c0BC3eGSeBc -ld0pMRnvllgyoFAJ2xOhACHYTRWEe+fZupW0zpyyvihPsxh6a4P2GZgmiNxr8g5o -nSfAmxeleY4bk5hIpF6JNgR9s8OjXwJNRcIWG97sJYi7bYLPkdgj1s9Hi9pcX05w -o712f5wQq5Zb8UZZrWs1d3D/BhcQUBBOya0G8znWsrH1OjMgZyk4kPl5fHOejdnh -PoPnOthERM3L4fgqC5Hn6wlhrRRn7X6ze9ST905mMq/GBjJ0XpwUWOK/JjC2s6YR -YRk6e9+CnsNzqNj5a/LM8XV/p7ErkLlG7rn+TPMLVa5SGZ50dl/D8z3lun4lKdS0 -8xH9MA2oF+8FLhePUS3VKv01FktUF7/lGyjP7l6vvTYic49Rd/x/9EA86MQckm9e -j77E8sQ6W5jna7cXsJ2oe782Kh2okz9jpXT0gXgAsrKcWuhingII5CKRc4+HNDuu -k7KFBuurtv8f6fr/3Wnq -=5bs5 ------END PGP SIGNATURE----- diff --git a/wine-1.9.21.tar.bz2 b/wine-1.9.21.tar.bz2 new file mode 100644 index 0000000..3a4e7f0 --- /dev/null +++ b/wine-1.9.21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b6dd027021be9dd646d65bd19c0334c36dcf9403d8ed4a6e9460b6703efade1 +size 23561191 diff --git a/wine-1.9.21.tar.bz2.sign b/wine-1.9.21.tar.bz2.sign new file mode 100644 index 0000000..51e2303 --- /dev/null +++ b/wine-1.9.21.tar.bz2.sign @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIcBAABCAAGBQJYASbtAAoJEM76yOqvF1GdAxcQAJjS1H8P/gON34j1NpaU98z4 +toczEf04DdBJFjye3SkJY7ZE3GLcKjEl5q3n/0Zeg90OQVlZ/Z9FVSt2iXBxHkxB +Bb3n5ZKHcYta1EcfRNPzkloxgRoVycTg5keuJ+fOuqVHxyFp+NUY0VF8Xj/aQzip +FmJwf7kU3foV1ARvSUHbmI8iY8Cw8qJlc55606bMP04S2JrguYCGDRRkWgJLdlrD +I2eNnnjfmrfyDwKbYIC40a9JuROSFrGgGcwDdfJqrPr5wdItCPq7QIEJ4wUPI60T +G4wpVErCXsfi867DtUPdLF/N3eYOvQx9HXZ3FrQGhU4qeJv2F7RvLhxqHHdpW57O +EqOcIZqAvZGPi80l9cAogI9iXBvo2pS8JCbJV9XpdxwX6xfK9NwO1I4jjmeUdALI +54jPjJJlmj8mTxsNmmljs9Xi2Kru/6uZZ0iHwByvk+Af5yjv21DR8/vlrUOSzNUV +N6uy9vCLlTEJhVX/Q5QfZKLmrOgxE8rvysYdrqGRWhHn2IAl5/j3EEemFAJeFYkI +PEbFbw8HBVIGVPyXV19+Nc1kBQZ/Zm0ZxNiYgJ3Fv689CoDGFkL0pQ2oxfKEmtyC +OYOyvD3MiN1jSPWHC555WAPzB5AyZHPpEOhXhayumxyWJu2xnVo6DQRZnFP1HFrA +tJI1+5imrJd5Q2QNfd51 +=neSL +-----END PGP SIGNATURE----- diff --git a/wine.changes b/wine.changes index a0ec5b0..a2976f6 100644 --- a/wine.changes +++ b/wine.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Oct 18 21:54:12 UTC 2016 - meissner@suse.com + +- Updated to 1.9.21 development snapshot + - Initial version of the HID minidriver. + - Support for lists in the RichEdit control. + - System tray improvements. + - Various bug fixes. +- updated winetricks + ------------------------------------------------------------------- Mon Oct 3 16:57:24 UTC 2016 - meissner@suse.com diff --git a/wine.spec b/wine.spec index f4b9843..9934078 100644 --- a/wine.spec +++ b/wine.spec @@ -53,8 +53,8 @@ BuildRequires: sane-backends-devel BuildRequires: update-desktop-files BuildRequires: valgrind-devel BuildRequires: xorg-x11-devel -%define realver 1.9.20 -Version: 1.9.20 +%define realver 1.9.21 +Version: 1.9.21 Release: 0 Summary: An MS Windows Emulator License: LGPL-2.1+ diff --git a/winetricks b/winetricks index ae5de0a..1a9cba7 100644 --- a/winetricks +++ b/winetricks @@ -2,7 +2,7 @@ # Name of this version of winetricks (YYYYMMDD) # (This doesn't change often, use the sha1sum of the file when reporting problems) -WINETRICKS_VERSION=20160724 +WINETRICKS_VERSION=20161012 # This is a UTF-8 file # You should see an o with two dots over it here [ö] @@ -165,15 +165,15 @@ w_askpermission() echo "$@" echo "------------------------------------------------------" - if test $W_OPT_UNATTENDED + if test "$W_OPT_UNATTENDED" then _W_timeout="--timeout 5" fi case $WINETRICKS_GUI in - zenity) $WINETRICKS_GUI $_W_timeout --question --title=winetricks --text="$(echo $@ | sed 's,\\\\,\\\\\\\\,g')" --no-wrap;; + zenity) $WINETRICKS_GUI "$_W_timeout" --question --title=winetricks --text="$(echo "$@" | sed 's,\\\\,\\\\\\\\,g')" --no-wrap;; kdialog) $WINETRICKS_GUI --title winetricks --warningcontinuecancel "$@" ;; - none) printf %s "Press Y or N, then Enter: " ; read response ; test "$response" = Y || test "$response" = y;; + none) printf %s "Press Y or N, then Enter: " ; read -r response ; test "$response" = Y || test "$response" = y;; esac if test $? -ne 0 @@ -198,7 +198,7 @@ w_info() _W_timeout="--timeout 3" case $WINETRICKS_GUI in - zenity) $WINETRICKS_GUI $_W_timeout --info --title=winetricks --text="$(echo $@ | sed 's,\\\\,\\\\\\\\,g')" --no-wrap;; + zenity) $WINETRICKS_GUI "$_W_timeout" --info --title=winetricks --text="$(echo "$@" | sed 's,\\\\,\\\\\\\\,g')" --no-wrap;; kdialog) $WINETRICKS_GUI --title winetricks --msgbox "$@" ;; none) ;; esac @@ -213,13 +213,13 @@ w_warn() echo "$@" >&2 echo "------------------------------------------------------" >&2 - if test $W_OPT_UNATTENDED + if test "$W_OPT_UNATTENDED" then _W_timeout="--timeout 5" fi case $WINETRICKS_GUI in - zenity) $WINETRICKS_GUI $_W_timeout --error --title=winetricks --text="$(echo $@ | sed 's,\\\\,\\\\\\\\,g')";; + zenity) $WINETRICKS_GUI "$_W_timeout" --error --title=winetricks --text="$(echo "$@" | sed 's,\\\\,\\\\\\\\,g')";; kdialog) $WINETRICKS_GUI --title winetricks --error "$@" ;; none) ;; esac @@ -236,14 +236,14 @@ w_warn_cancel() echo "$@" >&2 echo "------------------------------------------------------" >&2 - if test $W_OPT_UNATTENDED + if test "$W_OPT_UNATTENDED" then _W_timeout="--timeout 5" fi # Zenity has no cancel button, but will set status to 1 if you click the go-away X case $WINETRICKS_GUI in - zenity) $WINETRICKS_GUI $_W_timeout --error --title=winetricks --text="$(echo $@ | sed 's,\\\\,\\\\\\\\,g')";; + zenity) $WINETRICKS_GUI "$_W_timeout" --error --title=winetricks --text="$(echo "$@" | sed 's,\\\\,\\\\\\\\,g')";; kdialog) $WINETRICKS_GUI --title winetricks --warningcontinuecancel "$@" ;; none) ;; esac @@ -262,6 +262,7 @@ w_die() # Kill all instances of a process in a safe way (Solaris killall kills _everything_) w_killall() { + # shellcheck disable=SC2046,SC2086 kill -s KILL $(pgrep $1) } @@ -293,7 +294,7 @@ w_try() status=$? if test $status -ne 0 then - w_die "Note: command '$@' returned status $status. Aborting." + w_die "Note: command $* returned status $status. Aborting." fi } @@ -309,7 +310,7 @@ w_try_7z() 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 p7zip-plugins')." WINETRICKS_OPT_SHAREDPREFIX=1 w_call 7zip # errors out if there is a space between -o and path - w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w $2)" -o"$(w_pathconv -w $1)" + w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w "$2")" -o"$(w_pathconv -w "$1")" fi } @@ -328,7 +329,7 @@ w_try_ar() # -t* prevents 7-zip from decompressing .tar.xz to .tar, see # https://sourceforge.net/p/sevenzip/discussion/45798/thread/8cd16946/?limit=25 - w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" -t* x "$(w_pathconv -w $1)" + w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" -t* x "$(w_pathconv -w "$1")" fi } @@ -343,6 +344,11 @@ w_try_cabextract() w_try cabextract -q "$@" } +w_try_cd() +{ + w_try cd "$@" +} + w_try_msiexec64() { if test "$W_ARCH" != "win64" @@ -350,6 +356,7 @@ w_try_msiexec64() w_die "bug: 64-bit msiexec called from a $W_ARCH prefix." fi + # shellcheck disable=SC2086 w_try "$WINE" start /wait "$W_SYSTEM64_DLLS_WIN32/msiexec.exe" $W_UNATTENDED_SLASH_Q "$@" } @@ -361,12 +368,14 @@ w_try_regedit() *) unset cmdc ;; esac + # shellcheck disable=SC2086 w_try winetricks_early_wine $cmdc regedit $W_UNATTENDED_SLASH_S "$@" } w_try_regsvr() { - w_try "$WINE" regsvr32 $W_UNATTENDED_SLASH_S $@ + # shellcheck disable=SC2086 + w_try "$WINE" regsvr32 $W_UNATTENDED_SLASH_S "$@" } w_try_unrar() @@ -380,7 +389,7 @@ w_try_unrar() else w_warn "Cannot find unrar. Using Windows 7-Zip instead. (You can avoid this by installing unrar, e.g. 'sudo apt-get install unrar' or 'sudo yum install unrar')." WINETRICKS_OPT_SHAREDPREFIX=1 w_call 7zip - w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w $1)" + w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w "$1")" fi } @@ -411,7 +420,7 @@ w_try_unzip() WINETRICKS_OPT_SHAREDPREFIX=1 w_call 7zip # errors out if there is a space between -o and path - w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w $zipfile)" -o"$(w_pathconv -w $destdir)" "$@" + w_try "$WINE" "$W_PROGRAMS_X86_WIN\\7-Zip\\7z.exe" x "$(w_pathconv -w "$zipfile")" -o"$(w_pathconv -w "$destdir")" "$@" } w_read_key() @@ -435,7 +444,7 @@ w_read_key() then # read key from user case $LANG in - da*) _W_keymsg="Angiv venligst registrerings-nøglen for pakken '$_PACKAGE'" + da*) _W_keymsg="Angiv venligst registrerings-nøglen for pakken '$W_PACKAGE'" _W_nokeymsg="Ingen nøgle angivet" ;; de*) _W_keymsg="Bitte einen Key für Paket '$W_PACKAGE' eingeben" @@ -464,7 +473,7 @@ w_read_key() *zenity) W_KEY=$(zenity --entry --text "$_W_keymsg") ;; *kdialog) W_KEY=$(kdialog --inputbox "$_W_keymsg") ;; *xmessage) w_die "sorry, can't read key from GUI with xmessage" ;; - none) printf %s "$_W_keymsg": ; read W_KEY ;; + none) printf %s "$_W_keymsg": ; read -r W_KEY ;; esac if test "$W_KEY" = "" then @@ -473,7 +482,7 @@ w_read_key() echo "$W_KEY" > "$_W_keyfile" fi W_RAW_KEY=$(cat "$_W_keyfile") - W_KEY=$(echo $W_RAW_KEY | tr -d '[:blank:][=-=]') + W_KEY=$(echo "$W_RAW_KEY" | tr -d '[:blank:][=-=]') unset _W_keyfile _W_keymsg _W_nokeymsg } @@ -489,7 +498,7 @@ winetricks_wintounix() # Prepend the location of drive c printf %s "$WINEPREFIX"/dosdevices/c: # Change backslashes to slashes - echo $_W_winp | sed 's,\\,/,g' + echo "$_W_winp" | sed 's,\\,/,g' } # Convert between Unix path and Windows path @@ -583,9 +592,10 @@ winetricks_wget_progress() # which was the subshell, not all the elements of the pipeline... # have to go find and kill the wget. # If we ran wget in the background, we could kill it more directly, perhaps... - if pid=$(ps augxw | grep ."$_W_file" | grep -v grep | awk '{print $2}') + if pid=$(pgrep -f ."$_W_file") then echo User aborted download, killing wget + # shellcheck disable=SC2086 kill $pid fi fi @@ -597,7 +607,7 @@ winetricks_wget_progress() w_dotnet_verify() { - case $1 in + case "$1" in dotnet11) version="1.1" ;; dotnet11sp1) version="1.1 SP1" ;; dotnet20) version="2.0" ;; @@ -614,10 +624,15 @@ w_dotnet_verify() *) echo error ; exit 1 ;; esac w_call dotnet_verifier + # FIXME: The logfile may be useful somewhere (or at least print the location) + + # for 'run, netfx_setupverifier.exe /q:a /c:"setupverifier2.exe"' line + # shellcheck disable=SC2140 w_ahk_do " SetTitleMatchMode, 2 ; FIXME; this only works the first time? Check if it's already verified somehow.. + run, netfx_setupverifier.exe /q:a /c:"setupverifier2.exe" winwait, Verification Utility ControlClick, Button1 @@ -644,7 +659,8 @@ w_dotnet_verify() } } " - dn_status=$? + dn_status="$?" + w_info ".Net Verifier returned $dn_status" } # Checks if the user can run the self-update/rollback commands @@ -658,7 +674,7 @@ winetricks_check_update_availability() fi # Checks read/write permissions on update directories - if ! (test -r $0 && test -w $0 && test -w ${0%/*} && test -x ${0%/*}) + if ! (test -r "$0" && test -w "$0" && test -w "${0%/*}" && test -x "${0%/*}") then w_warn "You don't have the proper permissions to run this command. Try again with sudo or as root." exit; @@ -676,16 +692,16 @@ winetricks_selfupdate() _W_tmpdir=${TMPDIR:-/tmp} _W_tmpdir="$(mktemp -d "$_W_tmpdir/$_W_filename.XXXXXXXX")" - w_download_to $_W_tmpdir https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks - w_try mv $_W_tmpdir/$_W_filename $_W_update_file.gz - w_try gunzip $_W_update_file.gz - w_try rmdir $_W_tmpdir + w_download_to "$_W_tmpdir" https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks + w_try mv "$_W_tmpdir/$_W_filename" "${_W_update_file}.gz" + w_try gunzip "${_W_update_file}.gz" + w_try rmdir "$_W_tmpdir" - w_try cp $0 $_W_rollback_file - w_try chmod -x $_W_rollback_file + w_try cp "$0" "$_W_rollback_file" + w_try chmod -x "$_W_rollback_file" - w_try mv $_W_update_file $0 - w_try chmod +x $0 + w_try mv "$_W_update_file" "$0" + w_try chmod +x "$0" w_warn "Update finished! The current version is $($0 -V). Use 'winetricks --update-rollback' to return to the previous version." @@ -698,10 +714,10 @@ winetricks_selfupdate_rollback() _W_rollback_file="${0}.bak" - if test -f $_W_rollback_file + if test -f "$_W_rollback_file" then - w_try mv $_W_rollback_file $0 - w_try chmod +x $0 + w_try mv "$_W_rollback_file" "$0" + w_try chmod +x "$0" w_warn "Rollback finished! The current version is $($0 -V)." else w_warn "Nothing to rollback." @@ -744,16 +760,17 @@ w_download_to() tries=0 while test $tries -lt 2 do - tries=$(expr $tries + 1) + tries=$((tries + 1)) if test -s "$_W_cache/$_W_file" then - if test "$3" + if test "$_W_sum" then if test $tries = 1 then # The cache was full. If the file is larger than 500 MB, # don't checksum it, that just annoys the user. + # shellcheck disable=SC2046 if test $(du -k "$_W_cache/$_W_file" | cut -f1) -gt 500000 then checksum_ok=1 @@ -762,7 +779,7 @@ w_download_to() fi # If checksum matches, declare success and exit loop w_get_sha1sum "$_W_cache/$_W_file" - if [ "$_W_gotsum"x = "$3"x ] + if [ "$_W_gotsum"x = "$_W_sum"x ] then checksum_ok=1 break @@ -783,19 +800,19 @@ w_download_to() fi _W_dl_olddir=$(pwd) - cd "$_W_cache" + w_try_cd "$_W_cache" # Mac folks tend to have curl rather than wget # On Mac, 'which' doesn't return good exit status # Need to jam in --header "Accept-Encoding: gzip,deflate" else # redhat.com decompresses liberation-fonts.tar.gz! # Note: this causes other sites to compress downloads, hence # the kludge further down. See http://code.google.com/p/winezeug/issues/detail?id=77 - echo Downloading $_W_url to $_W_cache + echo "Downloading $_W_url to $_W_cache" # For sites that prefer Mozilla in the user-agent header, set W_BROWSERAGENT=1 case "$W_BROWSERAGENT" in 1) _W_agent="Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)" ;; - *) _W_agent= ;; + *) _W_agent="" ;; esac case "$WINETRICKS_OPT_TORIFY" in @@ -807,7 +824,7 @@ w_download_to() w_die "--torify was used, but torify is not installed, please install it." ; exit 1 fi ;; *) torify= - aria2c_torify_opts= ;; + aria2c_torify_opts="" ;; esac if [ -x "$(which aria2c 2>/dev/null)" ] @@ -832,6 +849,7 @@ w_download_to() # [*] --read-timeout is useful on the adobe server that doesn't # close the connection unless you tell it to (control-C or closing # the socket) + # shellcheck disable=SC2086 winetricks_wget_progress \ -O "$_W_file" -nd \ -c --read-timeout=300 --retry-connrefused \ @@ -843,6 +861,7 @@ w_download_to() then # curl doesn't get filename from the location given by the server! # fortunately, we know it + # shellcheck disable=SC2086 $torify curl -L -o "$_W_file" -C - \ --header "Accept-Encoding: gzip,deflate" \ ${_W_cookiejar:+--cookie "$_W_cookiejar"} \ @@ -868,7 +887,7 @@ w_download_to() *.exe) chmod +x "$_W_file" ;; esac - cd "$_W_dl_olddir" + w_try_cd "$_W_dl_olddir" unset _W_dl_olddir elif test $tries = 2 then @@ -879,9 +898,9 @@ w_download_to() _W_url="https://web.archive.org/web/$_W_url" done - if test "$3" && test ! "$checksum_ok" + if test "$_W_sum" && test ! "$checksum_ok" then - w_verify_sha1sum $3 "$_W_cache/$_W_file" + w_verify_sha1sum "$_W_sum" "$_W_cache/$_W_file" fi } @@ -923,7 +942,7 @@ w_open_webpage() # Caches downloads in winetrickscache/$W_PACKAGE w_download() { - w_download_to $W_PACKAGE "$@" + w_download_to "$W_PACKAGE" "$@" } # Download one or more files via BitTorrent @@ -938,13 +957,13 @@ w_download_torrent() w_call utorrent UT_WINPATH="$W_CACHE_WIN\\$W_PACKAGE" - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if [ "$2"x != ""x ] # foo.torrent parameter supplied then w_try "$WINE" utorrent "/DIRECTORY" "$UT_WINPATH" "$UT_WINPATH\\$2" & else # grab all torrents - for torrent in $(ls *.torrent) + for torrent in *.torrent do w_try "$WINE" utorrent "/DIRECTORY" "$UT_WINPATH" "$UT_WINPATH\\$torrent" & done @@ -999,6 +1018,7 @@ w_download_manual_to() _W_file="$3" _W_sha1sum="$4" + # shellcheck disable=SC2154 case "$media" in "download") w_info "FAIL: bug: media type is download, but w_download_manual was called. Programmer, please change verb's media type to manual_download." @@ -1028,7 +1048,7 @@ w_download_manual_to() if test "$_W_sha1sum" then - w_verify_sha1sum $_W_sha1sum "$W_CACHE/$_W_packagename/$_W_file" + w_verify_sha1sum "$_W_sha1sum" "$W_CACHE/$_W_packagename/$_W_file" fi unset _W_url _W_file _W_sha1sum _W_dlmsg @@ -1036,7 +1056,7 @@ w_download_manual_to() w_download_manual() { - w_download_manual_to $W_PACKAGE "$@" + w_download_manual_to "$W_PACKAGE" "$@" } # Turn off news, overlays, and friend interaction in Steam @@ -1142,7 +1162,12 @@ w_question() *zenity) $WINETRICKS_GUI --entry --text "$1" ;; *kdialog) $WINETRICKS_GUI --inputbox "$1" ;; *xmessage) w_die "sorry, can't ask question with xmessage" ;; - none) echo -n "$1" >&2 ; read W_ANSWER ; echo $W_ANSWER; unset W_ANSWER;; + none) + # Using printf instead of echo because we don't want a newline + printf "%s" "$1" >&2 ; + read -r W_ANSWER ; + echo "$W_ANSWER"; + unset W_ANSWER;; esac } @@ -1200,7 +1225,7 @@ w_steam_install_game() # "Updating $title" - small download progress dialog # "Steam - Ready" game install done. (Only comes up if main window not up.) - cd "$W_PROGRAMS_X86_UNIX/Steam" + w_try_cd "$W_PROGRAMS_X86_UNIX/Steam" w_ahk_do " SetTitleMatchMode 2 SetWinDelay 500 @@ -1336,6 +1361,8 @@ winetricks_load_gog() game_title="$2" other_files="$3" reader_control="$4" + # FIXME: actually unused, but not sure how it should be used + # shellcheck disable=SC2034 run_command="$5" download_id="$6" install_dir="$7" @@ -1366,14 +1393,14 @@ winetricks_load_gog() do case "$file_and_size_and_sha1" in *,*,*) - sha1sum=$(echo $file_and_size_and_sha1 | sed "s/.*,//") - minsize=$(echo $file_and_size_and_sha1 | sed 's/[^,]*,\([^,]*\),.*/\1/') - file=$(echo $file_and_size_and_sha1 | sed 's/,.*//') + sha1sum=$(echo "$file_and_size_and_sha1" | sed "s/.*,//") + minsize=$(echo "$file_and_size_and_sha1" | sed 's/[^,]*,\([^,]*\),.*/\1/') + file=$(echo "$file_and_size_and_sha1" | sed 's/,.*//') ;; *,*) sha1sum="" - minsize=$(echo $file_and_size_and_sha1 | sed 's/.*,//') - file=$(echo $file_and_size_and_sha1 | sed 's/,.*//') + minsize=$(echo "$file_and_size_and_sha1" | sed 's/.*,//') + file=$(echo "$file_and_size_and_sha1" | sed 's/,.*//') ;; *) sha1sum="" @@ -1382,6 +1409,7 @@ winetricks_load_gog() ;; esac file_path="$installer_path/$file" + # shellcheck disable=SC2046 if ! test -s "$file_path" || test $(stat -Lc%s "$file_path") -lt $minsize then # FIXME: bring back automated download @@ -1389,7 +1417,7 @@ winetricks_load_gog() w_download_manual "https://www.gog.com/en/download/game/$download_id/$file_id" "$file" check_sha1=1 filesize=$(stat -Lc%s "$file_path") - if test $minsize -gt 1 && test $filesize -ne $minsize + if test $minsize -gt 1 && test "$filesize" -ne $minsize then check_sha1="" w_warn "Expected file size $minsize, please report new size $filesize." @@ -1399,10 +1427,10 @@ winetricks_load_gog() w_verify_sha1sum "$sha1sum" "$file_path" fi fi - file_id=$(expr $file_id + 1) + file_id=$((file_id + 1)) done - cd "$installer_path" + w_try_cd "$installer_path" w_ahk_do " run $installer WinWait, Setup - $game_title, Start installation @@ -1483,24 +1511,24 @@ w_umount() then # Windows winetricks_load_vcdmount - cd "$VCD_DIR" + w_try_cd "$VCD_DIR" w_try vcdmount.exe /u else echo "Running $WINETRICKS_SUDO umount $W_ISO_MOUNT_ROOT" case "$WINETRICKS_SUDO" in gksudo) # -l lazy unmount in case executable still running - $WINETRICKS_SUDO "umount -l $W_ISO_MOUNT_ROOT" - w_try $WINETRICKS_SUDO "rm -rf $W_ISO_MOUNT_ROOT" + "$WINETRICKS_SUDO" "umount -l $W_ISO_MOUNT_ROOT" + w_try "$WINETRICKS_SUDO" "rm -rf $W_ISO_MOUNT_ROOT" ;; *) - $WINETRICKS_SUDO umount -l $W_ISO_MOUNT_ROOT - w_try $WINETRICKS_SUDO rm -rf $W_ISO_MOUNT_ROOT + "$WINETRICKS_SUDO" "umount -l $W_ISO_MOUNT_ROOT" + w_try "$WINETRICKS_SUDO" "rm -rf $W_ISO_MOUNT_ROOT" ;; esac - "$WINE" eject ${W_ISO_MOUNT_LETTER}: - rm -f "$WINEPREFIX"/dosdevices/${W_ISO_MOUNT_LETTER}: - rm -f "$WINEPREFIX"/dosdevices/${W_ISO_MOUNT_LETTER}:: + "$WINE" eject "${W_ISO_MOUNT_LETTER}:" + rm -f "$WINEPREFIX/dosdevices/${W_ISO_MOUNT_LETTER}:" + rm -f "$WINEPREFIX/dosdevices/${W_ISO_MOUNT_LETTER}::" fi } @@ -1556,7 +1584,7 @@ Usage: 'w_override_dlls mode[,mode] dll ...'." ;; _W_mode="" ;; esac shift - echo Using $_W_mode override for following DLLs: $@ + echo "Using $_W_mode override for following DLLs: $*" cat > "$W_TMP"/override-dll.reg <<_EOF_ REGEDIT4 @@ -1814,14 +1842,13 @@ w_override_app_dlls() b|builtin) _W_mode=builtin ;; n|native) _W_mode=native ;; default) _W_mode=default ;; - d|disabled) - _W_mode="" ;; + d|disabled) _W_mode="" ;; *) w_die "w_override_app_dlls: unknown mode $_W_mode. (want native, builtin, default, or disabled) Usage: 'w_override_app_dlls app mode dll ...'." ;; esac - echo Using $_W_mode override for following DLLs when running $_W_app: $@ + echo "Using $_W_mode override for following DLLs when running $_W_app: $*" ( echo REGEDIT4 echo "" @@ -1873,7 +1900,7 @@ w_set_winver() "$WINE" reg delete "HKLM\\System\\CurrentControlSet\\Control\\ProductOptions" /v ProductType /f || true ) > /dev/null 2>&1 - case $1 in + case "$1" in win31) echo "Setting Windows version to $1" cat > "$W_TMP"/set-winver.reg <<_EOF_ @@ -2063,27 +2090,27 @@ w_wine_version() # Parse major/minor/micro/nano fields of VALUE. Ignore nano. Abort if major is not 1. case $2 in 0*|1.0|1.0.*) w_die "bug: $2 is before 1.1, we don't bother with bugs fixed that long ago" ;; - 1.1.*) _W_minor=1; _W_micro=$(echo $2 | sed 's/.*\.//');; + 1.1.*) _W_minor=1; _W_micro=$(echo "$2" | sed 's/.*\.//');; 1.2) _W_minor=2; _W_micro=0;; - 1.2.*) _W_minor=2; _W_micro=$(echo $2 | sed 's/.*\.//');; - 1.3.*) _W_minor=3; _W_micro=$(echo $2 | sed 's/.*\.//');; + 1.2.*) _W_minor=2; _W_micro=$(echo "$2" | sed 's/.*\.//');; + 1.3.*) _W_minor=3; _W_micro=$(echo "$2" | sed 's/.*\.//');; 1.4) _W_minor=4; _W_micro=0;; - 1.4.*) _W_minor=4; _W_micro=$(echo $2 | sed 's/.*\.//');; - 1.5.*) _W_minor=5; _W_micro=$(echo $2 | sed 's/.*\.//');; + 1.4.*) _W_minor=4; _W_micro=$(echo "$2" | sed 's/.*\.//');; + 1.5.*) _W_minor=5; _W_micro=$(echo "$2" | sed 's/.*\.//');; 1.6|1.6-rc*) _W_minor=6; _W_micro=0;; - 1.6.*) _W_minor=6; _W_micro=$(echo $2 | sed 's/.*\.//');; - 1.7.*) _W_minor=7; _W_micro=$(echo $2 | sed 's/.*\.//');; - 1.8.*) _W_minor=8; _W_micro=$(echo $2 | sed 's/.*\.//');; - 1.9.*) _W_minor=9; _W_micro=$(echo $2 | sed 's/.*\.//');; + 1.6.*) _W_minor=6; _W_micro=$(echo "$2" | sed 's/.*\.//');; + 1.7.*) _W_minor=7; _W_micro=$(echo "$2" | sed 's/.*\.//');; + 1.8.*) _W_minor=8; _W_micro=$(echo "$2" | sed 's/.*\.//');; + 1.9.*) _W_minor=9; _W_micro=$(echo "$2" | sed 's/.*\.//');; *) w_die "bug: unrecognized version $2";; esac # Comparing current wine version 1.$WINETRICKS_WINE_MINOR.$WINETRICKS_WINE_MICRO against 1.$_W_minor.$_W_micro - if test $WINETRICKS_WINE_MINOR = $_W_minor + if test "$WINETRICKS_WINE_MINOR" = "$_W_minor" then - test $WINETRICKS_WINE_MICRO $1 $_W_micro || return 1 + test "$WINETRICKS_WINE_MICRO" "$1" "$_W_micro" || return 1 else - test $WINETRICKS_WINE_MINOR $1 $_W_minor || return 1 + test "$WINETRICKS_WINE_MINOR" "$1" "$_W_minor" || return 1 fi } @@ -2155,13 +2182,14 @@ w_workaround_wine_bug() *) _W_msg="-- $2";; esac + # shellcheck disable=SC2086 if test "$3" && w_wine_version_in $3 $4 $5 $6 then echo "Current Wine does not have Wine bug $1, so not applying workaround" return 1 fi - case $1 in + case "$1" in "$WINETRICKS_BLACKLIST") echo "Wine bug $1 workaround blacklisted, skipping" return 1 @@ -2177,7 +2205,7 @@ w_workaround_wine_bug() zh_TW*|zh_HK*) w_warn "繞過 wine bug ${1} $_W_msg" ;; *) w_warn "Working around wine bug ${1} $_W_msg" ;; esac - winetricks_stats_log_command w_workaround_wine_bug-$1 + winetricks_stats_log_command "w_workaround_wine_bug-$1" return 0 } @@ -2197,17 +2225,18 @@ w_metadata() *) set +x ;; esac + # shellcheck disable=SC2154 if test "$installed_exe1" || test "$installed_file1" || test "$publisher" || test "$year" then w_die "bug: stray metadata tags set: somebody forgot a backslash in a w_metadata somewhere. Run with sh -x to see where." fi - if winetricks_metadata_exists $1 + if winetricks_metadata_exists "$1" then w_die "bug: a verb named $1 already exists." fi _W_md_cmd="$1" - _W_category=$2 + _W_category="$2" file="$WINETRICKS_METADATA/$_W_category/$1.vars" shift shift @@ -2231,7 +2260,7 @@ w_metadata() # slashes in that variable instead of backslashes. echo ${arg%%=*}=\"${arg#*=}\" done > "$file" - echo category='"'$_W_category'"' >> "$file" + echo category='"'"$_W_category"'"' >> "$file" # If the problem described above happens, you'd see errors like this: # /tmp/w.dank.4650/metadata/dlls/comctl32.vars: 6: Syntax error: Unterminated quoted string # so check for lines that aren't properly quoted. @@ -2285,7 +2314,7 @@ w_do_call() { ( # Hack.. - if test $cmd = vd + if test "$cmd" = vd then load_vd $arg _W_status=$? @@ -2294,8 +2323,8 @@ w_do_call() return $_W_status fi - case $1 in - *=*) arg=$(echo $1 | sed 's/.*=//'); cmd=$(echo $1 | sed 's/=.*//');; + case "$1" in + *=*) arg=$(echo "$1" | sed 's/.*=//'); cmd=$(echo "$1" | sed 's/=.*//');; *) cmd=$1; arg=$2 ;; esac @@ -2311,16 +2340,18 @@ w_do_call() # Unset all known used metadata values, in case this is a nested call unset conflicts installed_file1 installed_exe1 - if winetricks_metadata_exists $1 + if winetricks_metadata_exists "$1" then - . "$WINETRICKS_METADATA"/*/$1.vars - elif winetricks_metadata_exists $cmd + # shellcheck disable=SC1090 + . "$WINETRICKS_METADATA"/*/"${1}.vars" + elif winetricks_metadata_exists "$cmd" then - . "$WINETRICKS_METADATA"/*/$cmd.vars - elif test $cmd = native || test $cmd = disabled || test $cmd = builtin || test $cmd = default + # shellcheck disable=SC1090 + . "$WINETRICKS_METADATA"/*/"${cmd}.vars" + elif test "$cmd" = native || test "$cmd" = disabled || test "$cmd" = builtin || test "$cmd" = default then # ugly special case - can't have metadata for these verbs until we allow arbitrary parameters - w_override_dlls $cmd $arg + w_override_dlls "$cmd" "$arg" _W_status=$? test "$W_OPT_NOCLEAN" = 1 || rm -rf "$W_TMP" mkdir -p "$W_TMP" @@ -2334,13 +2365,14 @@ w_do_call() windows_cmd|wine_cmd) ;; *) + # shellcheck disable=SC2154 case "$category"-"$WINETRICKS_OPT_SHAREDPREFIX" in apps-0|benchmarks-0|games-0) winetricks_set_wineprefix "$cmd" # If it's a new wineprefix, give it metadata if test ! -f "$WINEPREFIX"/wrapper.cfg then - echo ww_name=\"$title\" > "$WINEPREFIX"/wrapper.cfg + echo ww_name=\""$title"\" > "$WINEPREFIX"/wrapper.cfg fi ;; esac @@ -2351,25 +2383,26 @@ w_do_call() mkdir -p "$W_TMP" # Don't install if already installed - if test "$WINETRICKS_FORCE" != 1 && winetricks_is_installed $1 + if test "$WINETRICKS_FORCE" != 1 && winetricks_is_installed "$1" then echo "$1 already installed, skipping" return 0 fi # Don't install if a conflicting verb is already installed: + # shellcheck disable=SC2154 if test "$WINETRICKS_FORCE" != 1 && test "$conflicts" && test -f "$WINEPREFIX/winetricks.log" then for x in $conflicts do - w_conflicts $1 $x + w_conflicts "$1" "$x" done fi # We'd like to get rid of W_PACKAGE, but for now, just set it as late as possible. W_PACKAGE=$1 - w_try load_$cmd $arg - winetricks_stats_log_command $* + w_try "load_$cmd" "$arg" + winetricks_stats_log_command "$@" # User-specific postinstall hook. # Source it so the script can call w_download() if needed. @@ -2377,22 +2410,30 @@ w_do_call() if test -f "$postfile" then chmod +x "$postfile" + # shellcheck disable=SC1090 . "$postfile" fi # Verify install if test "$installed_exe1" || test "$installed_file1" then - if ! winetricks_is_installed $1 + if ! winetricks_is_installed "$1" then w_die "$1 install completed, but installed file $_W_file_unix not found" fi fi # If the user specified --verify, also run GUI tests: - if test "$WINETRICKS_VERIFY" = 1 && command -v verify_$cmd > /dev/null 2>&1 + if test "$WINETRICKS_VERIFY" = 1 then - w_try verify_$cmd + # command -v isn't POSIX :( + "verify_$cmd" 2>/dev/null + verify_status=$? + case $verify_status in + 0) w_warn "verify_$cmd succeeded!" ;; + 127) echo "verify_$cmd not found, not verifying $cmd" ;; + *) w_die "verify_$cmd failed!" ;; + esac fi # Clean up after this verb @@ -2406,7 +2447,7 @@ w_do_call() # If you want to check exit status yourself, use w_do_call w_call() { - w_try w_do_call $@ + w_try w_do_call "$@" } w_register_font() @@ -2461,7 +2502,7 @@ w_append_path() { # Prepend $1 to the Windows path in the registry. # Use printf %s to avoid interpreting backslashes. - _W_NEW_PATH="$(printf %s $1| sed 's,\\\\,\\\\\\\\,g')" + _W_NEW_PATH="$(printf %s "$1" | sed 's,\\\\,\\\\\\\\,g')" _W_WIN_PATH="$(w_expand_env PATH | sed 's,\\\\,\\\\\\\\,g')" sed 's/$/\r/' > "$W_TMP"/path.reg <<_EOF_ @@ -2495,7 +2536,7 @@ winetricks_get_platform() { if [ "${OS}" = "Windows_NT" ] then - if [ ! -v ${WINELOADERNOEXEC} ] + if [ ! -v "${WINELOADERNOEXEC}" ] then export W_PLATFORM="windows_cmd" else @@ -2511,7 +2552,7 @@ winetricks_print_version() { # just to get the winetricks version: winetricks_get_sha1sum_prog - w_get_sha1sum $0 + w_get_sha1sum "$0" echo "$WINETRICKS_VERSION - sha1sum: $_W_gotsum" } @@ -2581,9 +2622,10 @@ winetricks_detect_sudo() winetricks_get_prefix_var() { ( + # shellcheck disable=SC1090 . "$W_PREFIXES_ROOT/$p/wrapper.cfg" # The cryptic sed is there to turn ' into '\'' - eval echo \$ww_$1 | sed "s/'/'\\\''/" + eval echo \$ww_"$1" | sed "s/'/'\\\''/" ) } @@ -2694,7 +2736,7 @@ winetricks_prefixmenu() " \ > "$WINETRICKS_WORKDIR"/zenity.sh - if ls -d $W_PREFIXES_ROOT/*/dosdevices > /dev/null 2>&1 + if ls -d "$W_PREFIXES_ROOT"/*/dosdevices > /dev/null 2>&1 then for prefix in "$W_PREFIXES_ROOT"/*/dosdevices do @@ -3052,9 +3094,10 @@ winetricks_settings_menu() code=$(winetricks_metadata_basename "$metadatafile") ( title='?' - author='?' + # shellcheck disable=SC1090 . "$metadatafile" # Begin 'title' strings localization code + # shellcheck disable=SC2154 case $LANG in uk*) case "$title_uk" in "") ;; @@ -3063,7 +3106,7 @@ winetricks_settings_menu() esac # End of code printf "%s %s %s %s" " " FALSE \ - $code \ + "$code" \ "\"$title\"" ) done >> "$WINETRICKS_WORKDIR"/zenity.sh @@ -3277,18 +3320,19 @@ winetricks_showmenu() code=$(winetricks_metadata_basename "$metadatafile") ( title='?' - author='?' + # shellcheck disable=SC1090 . "$metadatafile" + # shellcheck disable=SC2154 if test "$W_OPT_SHOWBROKEN" = 1 || test "$wine_showstoppers" = "" then # Compute cached and downloadable flags flags="" - winetricks_is_cached $code && flags="$_W_cached" + winetricks_is_cached "$code" && flags="$_W_cached" installed=FALSE - if winetricks_is_installed $code + if winetricks_is_installed "$code" then installed=TRUE - echo $code >> "$WINETRICKS_WORKDIR"/installed.txt + echo "$code" >> "$WINETRICKS_WORKDIR"/installed.txt fi printf %s " $installed \ $code \ @@ -3330,16 +3374,16 @@ winetricks_metadata_basename() #basename $1 .vars # first, remove suffix .vars - _W_mb_tmp=${1%.vars} + _W_mb_tmp="${1%.vars}" # second, remove any directory prefix - echo ${_W_mb_tmp##*/} + echo "${_W_mb_tmp##*/}" unset _W_mb_tmp } # Returns true if given verb has been registered winetricks_metadata_exists() { - test -f "$WINETRICKS_METADATA"/*/$1.vars + test -f "$WINETRICKS_METADATA"/*/"${1}.vars" } # Returns true if given verb has been cached @@ -3347,12 +3391,13 @@ winetricks_metadata_exists() winetricks_is_cached() { # FIXME: also check file2... if given + # shellcheck disable=SC2154 _W_path="$W_CACHE/$1/$file1" case "$_W_path" in *..*) # Remove /foo/.. so verbs that don't have their own cache directories # can refer to siblings - _W_path="$(echo $_W_path | sed 's,/[^/]*/\.\.,,')" + _W_path="$(echo "$_W_path" | sed 's,/[^/]*/\.\.,,')" ;; esac if test -f "$_W_path" @@ -3433,10 +3478,11 @@ winetricks_list_cached() # If this is too slow, we can unset known metadata by hand ( code=$(winetricks_metadata_basename "$_W_metadatafile") + # shellcheck disable=SC1090 . "$_W_metadatafile" - if winetricks_is_cached $code + if winetricks_is_cached "$code" then - echo $code + echo "$code" fi ) done | sort @@ -3446,15 +3492,15 @@ winetricks_list_cached() # List verbs which are automatically downloadable, regardless of whether they're cached yet winetricks_list_download() { - cd "$WINETRICKS_METADATA" - grep -l 'media=.download' */*.vars | sed 's,.*/,,;s/\.vars//' | sort -u + w_try_cd "$WINETRICKS_METADATA" + grep -l 'media=.download' ./*/*.vars | sed 's,.*/,,;s/\.vars//' | sort -u } # List verbs which are downloadable with user intervention, regardless of whether they're cached yet winetricks_list_manual_download() { - cd "$WINETRICKS_METADATA" - grep -l 'media=.manual_download' */*.vars | sed 's,.*/,,;s/\.vars//' | sort -u + w_try_cd "$WINETRICKS_METADATA" + grep -l 'media=.manual_download' ./*/*.vars | sed 's,.*/,,;s/\.vars//' | sort -u } winetricks_list_installed() @@ -3462,17 +3508,18 @@ winetricks_list_installed() ( # Jump through a couple hoops to evaluate the verbs in alphabetical order # Assume that no filename contains '|' - cd "$WINETRICKS_METADATA" - for _W_metadatafile in $(ls */*.vars | sed 's,^\(.*\)/,\1|,' | sort -t\| -k 2 | tr '|' /) + w_try_cd "$WINETRICKS_METADATA" + for _W_metadatafile in $(find . -iname \*.vars | sed 's,^\(.*\)/,\1|,' | sort -t\| -k 2 | tr '|' /) do # Use a subshell to avoid putting metadata in global space # If this is too slow, we can unset known metadata by hand ( code=$(winetricks_metadata_basename "$_W_metadatafile") + # shellcheck disable=SC1090 . "$_W_metadatafile" - if winetricks_is_installed $code + if winetricks_is_installed "$code" then - echo $code + echo "$code" fi ) done @@ -3516,19 +3563,20 @@ winetricks_list_all() # If this is too slow, we can unset known metadata by hand ( code=$(winetricks_metadata_basename "$_W_metadatafile") + # shellcheck disable=SC1090 . "$_W_metadatafile" # Compute cached and downloadable flags flags="" test "$media" = "download" && winetricks_append_to_flags "$_W_download" - winetricks_is_cached $code && winetricks_append_to_flags "$_W_cached" + winetricks_is_cached "$code" && winetricks_append_to_flags "$_W_cached" test "$flags" && flags="[$flags]" if ! test "$year" && ! test "$publisher" then - printf "%-24s %s %s\n" $code "$title" "$flags" + printf "%-24s %s %s\n" "$code" "$title" "$flags" else - printf "%-24s %s (%s, %s) %s\n" $code "$title" "$publisher" "$year" "$flags" + printf "%-24s %s (%s, %s) %s\n" "$code" "$title" "$publisher" "$year" "$flags" fi ) done @@ -3546,8 +3594,8 @@ winetricks_die_if_user_not_dirowner() _W_checkdir=$(dirname "$1") fi _W_nuser=$(id -u) - _W_nowner=$(ls -l -n -d -L "$_W_checkdir" | awk '{print $3}') - if test x$_W_nuser != x$_W_nowner + _W_nowner=$(stat -c '%u' "$_W_checkdir") + if test x"$_W_nuser" != x"$_W_nowner" then w_die "You ($(id -un)) don't own $_W_checkdir. Don't run this tool as another user!" fi @@ -3562,13 +3610,13 @@ winetricks_die_if_user_not_dirowner() # Usage: read_bytes offset count device winetricks_read_bytes() { - dd status=noxfer if=$3 bs=1 skip=$1 count=$2 2>/dev/null + dd status=noxfer if="$3" bs=1 skip="$1" count="$2" 2>/dev/null } # Usage: read_hex offset count device winetricks_read_hex() { - od -j $1 -N $2 -t x1 $3 | # offset $1, count $2, single byte hex format, file $3 + od -j "$1" -N "$2" -t x1 "$3" | # offset $1, count $2, single byte hex format, file $3 sed 's/^[^ ]* //' | # remove address sed '$d' # remove final line which is just final offset } @@ -3579,7 +3627,7 @@ winetricks_read_hex() # udf uses little endian words, so this only works on little endian machines. winetricks_read_decimal() { - od -j $1 -N 4 -t u4 $2 | # offset $1, byte count 4, four byte decimal format, file $2 + od -j "$1" -N 4 -t u4 "$2" | # offset $1, byte count 4, four byte decimal format, file $2 sed 's/^[^ ]* //' | # remove address sed '$d' # remove final line which is just final offset } @@ -3611,37 +3659,37 @@ winetricks_read_udf_volume_name() # 32 24 volume identifier (dstring) # 1. check the 16 bit TagIdentifier of the descriptor tag, make sure it's 2 - tagid=$(winetricks_read_hex 524288 2 $1) - : echo tagid is $tagid + tagid=$(winetricks_read_hex 524288 2 "$1") + : echo "tagid is $tagid" case "$tagid" in - "02 00") : echo Found AVDP ;; + "02 00") : echo "Found AVDP" ;; *) echo "Did not find AVDP (tagid was $tagid)"; exit 1;; esac # 2. read the location of the main volume descriptor: - offset=$(winetricks_read_decimal 524308 $1) - : echo MVD is at sector $offset - offset=$(expr $offset \* 2048) - : echo MVD is at byte $offset + offset=$(winetricks_read_decimal 524308 "$1") + : echo "MVD is at sector $offset" + offset=$((offset * 2048)) + : echo "MVD is at byte $offset" # 3. check the TagIdentifier of the MVD's descriptor tag, make sure it's 1 - tagid=$(winetricks_read_hex $offset 2 $1) - : echo tagid is $tagid + tagid=$(winetricks_read_hex $offset 2 "$1") + : echo "tagid is $tagid" case "$tagid" in "01 00") : echo Found MVD ;; *) echo Did not find MVD; exit 1;; esac # 4. Read whether the name is in 8 or 16 bit chars - offset=$(expr $offset + 24) - width=$(winetricks_read_hex $offset 1 $1) + offset=$((offset + 24)) + width=$(winetricks_read_hex $offset 1 "$1") - offset=$(expr $offset + 1) + offset=$((offset + 1)) # 5. Profit! case $width in - 08) winetricks_read_bytes $offset 30 $1 | sed 's/ *$//' ;; - 10) winetricks_read_bytes $offset 30 $1 | tr -d '\000' | sed 's/ *$//' ;; + 08) winetricks_read_bytes $offset 30 "$1" | sed 's/ *$//' ;; + 10) winetricks_read_bytes $offset 30 "$1" | tr -d '\000' | sed 's/ *$//' ;; *) echo "Unhandled dvd volname character width '$width'"; exit 1;; esac @@ -3650,7 +3698,7 @@ winetricks_read_udf_volume_name() winetricks_read_iso9660_volume_name() { - winetricks_read_bytes 32808 30 $1 | sed 's/ *$//' + winetricks_read_bytes 32808 30 "$1" | sed 's/ *$//' } winetricks_read_volume_name() @@ -3664,25 +3712,25 @@ winetricks_read_volume_name() # "CD001": ecma-119 # "CDW02": ecma-168 - std_id=$(winetricks_read_bytes 32769 5 $1) - : echo std_id is $std_id + std_id=$(winetricks_read_bytes 32769 5 "$1") + : echo "std_id is $std_id" case $std_id in - CD001) winetricks_read_iso9660_volume_name $1 ;; - BEA01) winetricks_read_udf_volume_name $1; ;; + CD001) winetricks_read_iso9660_volume_name "$1" ;; + BEA01) winetricks_read_udf_volume_name "$1" ;; *) echo "Unrecognized disk type $std_id"; exit 1 ;; esac } winetricks_volname() { - x=$(volname $1 2> /dev/null| sed 's/ *$//') + x=$(volname "$1" 2> /dev/null| sed 's/ *$//') if test "x$x" = "x" then # UDF? See https://bugs.launchpad.net/bugs/678419 - x=$(winetricks_read_volume_name $1) + x=$(winetricks_read_volume_name "$1") fi - echo $x + echo "$x" } # Really, should take a volume name as argument, and use 'mount' to get @@ -3822,7 +3870,7 @@ winetricks_load_vcdmount() w_download_to vcd http://static.slysoft.com/SetupVirtualCloneDrive.exe # have to use cmd else vista won't let cygwin run .exe's? chmod +x "$W_CACHE"/vcd/SetupVirtualCloneDrive.exe - cd "$W_CACHE/vcd" + w_try_cd "$W_CACHE/vcd" cmd /c SetupVirtualCloneDrive.exe fi if test -x "$W_PROGRAMS_UNIX/$VCD_DIR/vcdmount.exe" @@ -3847,9 +3895,9 @@ winetricks_mount_cached_iso() if test "$WINE" = "" then winetricks_load_vcdmount - my_img_win="$(w_pathconv -w $WINETRICKS_IMG | tr '\012' ' ' | sed 's/ $//')" - cd "$VCD_DIR" - w_try vcdmount.exe /l=$letter "$my_img_win" + my_img_win="$(w_pathconv -w "$WINETRICKS_IMG" | tr '\012' ' ' | sed 's/ $//')" + w_try_cd "$VCD_DIR" + w_try vcdmount.exe /l="$letter" "$my_img_win" tries=0 while test $tries -lt 20 @@ -3864,7 +3912,7 @@ winetricks_mount_cached_iso() break 2 fi done - tries=$(expr $tries + 1) + tries=$((tries + 1)) echo "Waiting for mount to finish mounting" sleep 1 done @@ -3879,7 +3927,7 @@ winetricks_mount_cached_iso() ;; *) w_try $WINETRICKS_SUDO mkdir -p $W_ISO_MOUNT_ROOT - w_try $WINETRICKS_SUDO mount -o ro,loop,uid=$_W_USERID,unhide "$WINETRICKS_IMG" $W_ISO_MOUNT_ROOT + w_try $WINETRICKS_SUDO mount -o ro,loop,uid="$_W_USERID",unhide "$WINETRICKS_IMG" $W_ISO_MOUNT_ROOT ;; esac @@ -3915,8 +3963,8 @@ winetricks_is_mounted() _W_tmp="$(winetricks_list_mounts "$1")" if test "$_W_tmp" then - _W_dev=$(echo $_W_tmp | sed 's/ .*//') - _W_mountpoint="$(echo $_W_tmp | sed 's/^[^ ]* //')" + _W_dev=$(echo "$_W_tmp" | sed 's/ .*//') + _W_mountpoint="$(echo "$_W_tmp" | sed 's/^[^ ]* //')" # Volume found! return 0 fi @@ -3926,12 +3974,12 @@ winetricks_is_mounted() rm -f "$W_TMP_EARLY/_W_tmp.$LOGNAME" winetricks_list_mounts . | while true do - IFS= read _W_tmp + IFS= read -r _W_tmp - _W_dev=$(echo $_W_tmp | sed 's/ .*//') + _W_dev=$(echo "$_W_tmp" | sed 's/ .*//') test "$_W_dev" || break - _W_mountpoint="$(echo $_W_tmp | sed 's/^[^ ]* //')" - _W_volname=$(winetricks_volname $_W_dev) + _W_mountpoint="$(echo "$_W_tmp" | sed 's/^[^ ]* //')" + _W_volname=$(winetricks_volname "$_W_dev") if test "$1" = "$_W_volname" then # Volume found! Want to return from function here, but can't @@ -3943,8 +3991,8 @@ winetricks_is_mounted() if test -f "$W_TMP_EARLY/_W_tmp.$LOGNAME" then # Volume found! Return from function. - _W_dev=$(cat "$W_TMP_EARLY/_W_tmp.$LOGNAME" | sed 's/ .*//') - _W_mountpoint="$(cat "$W_TMP_EARLY/_W_tmp.$LOGNAME" | sed 's/^[^ ]* //')" + _W_dev=$(sed 's/ .*//' "$W_TMP_EARLY/_W_tmp.$LOGNAME") + _W_mountpoint="$(sed 's/^[^ ]* //' "$W_TMP_EARLY/_W_tmp.$LOGNAME")" rm -f "$W_TMP_EARLY/_W_tmp.$LOGNAME" return 0 fi @@ -3961,7 +4009,7 @@ winetricks_mount_real_volume() # Wait for user to insert disc. case $LANG in - da*)_W_mountmsg="Indsæt venligst disken '$_W_expected_volname' (krævet af pakken '$_PACKAGE')" ;; + da*)_W_mountmsg="Indsæt venligst disken '$_W_expected_volname' (krævet af pakken '$W_PACKAGE')" ;; de*)_W_mountmsg="Bitte Disk '$_W_expected_volname' einlegen (für Paket '$W_PACKAGE')" ;; pl*) _W_mountmsg="Proszę włożyć dysk '$_W_expected_volname' (potrzebny paczce '$W_PACKAGE')" ;; ru*) _W_mountmsg="Пожалуйста, вставьте том '$_W_expected_volname' (требуется для пакета '$W_PACKAGE')" ;; @@ -4009,6 +4057,7 @@ winetricks_cleanup() set +e if test -f "$WINETRICKS_WORKDIR/dd-pid" then + # shellcheck disable=SC2046 kill $(cat "$WINETRICKS_WORKDIR/dd-pid") fi test "$WINETRICKS_CACHE_SYMLINK" && rm -f "$WINETRICKS_CACHE_SYMLINK" @@ -4025,7 +4074,7 @@ winetricks_set_unattended() # http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 # So in attended mode, W_OPT_UNATTENDED should be empty. - case $1 in + case "$1" in 1) W_OPT_UNATTENDED=1 # Might want to trim our stable of variables here a bit... @@ -4102,7 +4151,7 @@ winetricks_set_wineprefix() case "$W_PLATFORM" in "windows_cmd|wine_cmd") - W_CACHE_WIN="$(w_pathconv -w $W_CACHE)" + W_CACHE_WIN="$(w_pathconv -w "$W_CACHE")" ;; *) # For case where Z: doesn't exist or / is writable (!), @@ -4140,6 +4189,7 @@ winetricks_set_wineprefix() fi W_APPDATA_WIN="$(w_expand_env AppData)" + # shellcheck disable=SC2034 W_APPDATA_UNIX="$(w_pathconv -u "$W_APPDATA_WIN")" # FIXME: get fonts path from SHGetFolderPath @@ -4165,7 +4215,9 @@ winetricks_set_wineprefix() W_SYSTEM32_DLLS="$W_WINDIR_UNIX/syswow64" W_SYSTEM32_DLLS_WIN="C:\\windows\\syswow64" W_SYSTEM64_DLLS="$W_WINDIR_UNIX/system32" + # shellcheck disable=SC2034 W_SYSTEM64_DLLS_WIN32="C:\\windows\\sysnative" # path to access 64-bit dlls from 32-bit apps + # shellcheck disable=SC2034 W_SYSTEM64_DLLS_WIN64="C:\\windows\\system32" # path to access 64-bit dlls from 64-bit apps # 64-bit prefixes still have plenty of issues: w_warn "You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug." @@ -4184,19 +4236,19 @@ winetricks_annihilate_wineprefix() uk*) w_askpermission "Бажаєте видалити '$WINEPREFIX'?" ;; *) w_askpermission "Delete $WINEPREFIX, its apps, icons, and menu items?" ;; esac - rm -rf "$WINEPREFIX"/* rm -rf "$WINEPREFIX" # Also remove menu items. - find $XDG_DATA_HOME/applications/wine -type f -name '*.desktop' -exec grep -q -l "$WINEPREFIX" '{}' ';' -exec rm '{}' ';' + find "$XDG_DATA_HOME/applications/wine" -type f -name '*.desktop' -exec grep -q -l "$WINEPREFIX" '{}' ';' -exec rm '{}' ';' # Also remove desktop items. # Desktop might be synonym for home directory, so only go one level # deep to avoid extreme slowdown if user has lots of files ( - if ! test "$XDG_DESKTOP_DIR" && test -f $XDG_CONFIG_HOME/user-dirs.dirs + if ! test "$XDG_DESKTOP_DIR" && test -f "$XDG_CONFIG_HOME/user-dirs.dirs" then - . $XDG_CONFIG_HOME/user-dirs.dirs + # shellcheck disable=SC1090 + . "$XDG_CONFIG_HOME/user-dirs.dirs" fi find "$XDG_DESKTOP_DIR" -maxdepth 1 -type f -name '*.desktop' -exec grep -q -l "$WINEPREFIX" '{}' ';' -exec rm '{}' ';' ) @@ -4230,7 +4282,7 @@ winetricks_init() WINETRICKS_CATEGORIES="apps benchmarks dlls fonts games settings" for _W_cat in $WINETRICKS_CATEGORIES do - mkdir -p "$WINETRICKS_METADATA"/$_W_cat + mkdir -p "$WINETRICKS_METADATA/$_W_cat" done # Which subdirectory of WINETRICKS_METADATA is currently active (or main, if none) @@ -4266,6 +4318,7 @@ winetricks_init() else XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" fi + # shellcheck disable=SC2153 if test "$WINETRICKS_DIR" then # For backwards compatibility @@ -4340,20 +4393,10 @@ winetricks_init() then w_die "WINE is $WINE, which is neither on the path nor an executable file" fi - case "$WINETRICKS_OPT_VERBOSE" in - 1|2) echo -n "Wine is '$WINE'; Wine version is " - "$WINE" --version || w_die "Can't get Wine version" - echo "winetricks is $0 ; winetricks version is $WINETRICKS_VERSION" - ;; - esac unset _abswine ;; esac - winetricks_set_wineprefix $1 - - # FIXME: don't hardcode - W_PROGRAMS_DRIVE=c - + winetricks_set_wineprefix "$1" # Whether to automate installs (0=no, 1=yes) winetricks_set_unattended ${W_OPT_UNATTENDED:-0} @@ -4509,7 +4552,7 @@ winetricks_handle_option() if ! test "$WINETRICKS_LIB" then WINETRICKS_SRCDIR=$(dirname "$0") - WINETRICKS_SRCDIR=$(cd "$WINETRICKS_SRCDIR"; pwd) + WINETRICKS_SRCDIR=$(w_try_cd "$WINETRICKS_SRCDIR"; pwd) # Which GUI helper to use (none/zenity/kdialog). See winetricks_detect_gui. WINETRICKS_GUI=none @@ -4517,7 +4560,7 @@ then WINETRICKS_OPT_SHAREDPREFIX=${WINETRICKS_OPT_SHAREDPREFIX:-1} # Handle options before init, to avoid starting wine for --help or --version - while winetricks_handle_option $1 + while winetricks_handle_option "$1" do shift done @@ -4526,7 +4569,7 @@ then # If --isolate is used, pass verb to winetricks_init, so it can set the wineprefix using winetricks_set_wineprefix() # Otherwise, an arch mismatch between ${WINEPREFIX:-$HOME/.wine} and the prefix to be made for the isolated app would cause it to fail case $WINETRICKS_OPT_SHAREDPREFIX in - 0) winetricks_init $1 ;; + 0) winetricks_init "$1" ;; *) winetricks_init ;; esac fi @@ -4545,7 +4588,7 @@ winetricks_install_app() esac # FIXME: initialize a new wineprefix for this app, set lots of global variables - if ! w_do_call $1 $2 + if ! w_do_call "$1" "$2" then w_die "$fail_msg" fi @@ -4600,7 +4643,7 @@ helper_d3dx9_xx() done fi - w_override_dlls native $dllname + w_override_dlls native "$dllname" } helper_win2ksp4() @@ -4609,7 +4652,7 @@ helper_win2ksp4() # http://www.microsoft.com/downloads/details.aspx?FamilyID=1001AAF1-749F-49F4-8010-297BD6CA33A0&displaylang=en w_download_to win2ksp4 http://download.microsoft.com/download/E/6/A/E6A04295-D2A8-40D0-A0C5-241BFECD095E/W2KSP4_EN.EXE fadea6d94a014b039839fecc6e6a11c20afa4fa8 - w_try_cabextract -d "$W_TMP" -L -F $filename "$W_CACHE"/win2ksp4/W2KSP4_EN.EXE + w_try_cabextract -d "$W_TMP" -L -F "$filename" "$W_CACHE"/win2ksp4/W2KSP4_EN.EXE } helper_xpsp3() @@ -4619,7 +4662,7 @@ helper_xpsp3() # http://www.microsoft.com/en-us/download/details.aspx?id=24 w_download_to xpsp3 http://download.microsoft.com/download/d/3/0/d30e32d8-418a-469d-b600-f32ce3edf42d/WindowsXP-KB936929-SP3-x86-ENU.exe c81472f7eeea2eca421e116cd4c03e2300ebfde4 - w_try_cabextract -d "$W_TMP" -L -F $filename "$W_CACHE"/xpsp3/WindowsXP-KB936929-SP3-x86-ENU.exe + w_try_cabextract -d "$W_TMP" -L -F "$filename" "$W_CACHE"/xpsp3/WindowsXP-KB936929-SP3-x86-ENU.exe } helper_win7sp1() @@ -4629,7 +4672,7 @@ helper_win7sp1() # https://www.microsoft.com/en-us/download/details.aspx?id=5842 w_download_to win7sp1 http://download.microsoft.com/download/0/A/F/0AFB5316-3062-494A-AB78-7FB0D4461357/windows6.1-KB976932-X86.exe c3516bc5c9e69fee6d9ac4f981f5b95977a8a2fa - w_try_cabextract -d "$W_TMP" -L -F $filename "$W_CACHE"/win7sp1/windows6.1-KB976932-X86.exe + w_try_cabextract -d "$W_TMP" -L -F "$filename" "$W_CACHE"/win7sp1/windows6.1-KB976932-X86.exe } #--------------------------------------------------------- @@ -4661,7 +4704,7 @@ load_adobeair() # 2016-02-17: 20.0.0.260 (strings 'Adobe AIR.dll' | grep 20\\. ) sha1sum 2fdd561556fe881c4e5538d4ee37f523871befd3 w_download http://airdownload.adobe.com/air/win/download/20.0/AdobeAIRInstaller.exe 2fdd561556fe881c4e5538d4ee37f523871befd3 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" AdobeAIRInstaller.exe $W_UNATTENDED_DASH_SILENT } @@ -4701,7 +4744,7 @@ load_art2kmin() { # See http://www.microsoft.com/downloads/details.aspx?familyid=d9ae78d9-9dc6-4b38-9fa6-2c745a175aed&displaylang=en w_download http://download.microsoft.com/download/D/2/A/D2A2FC8B-0447-491C-A5EF-E8AA3A74FB98/AccessRuntime.exe 571811b7536e97cf4e4e53bbf8260cddd69f9b2d - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" AccessRuntime.exe $W_UNATTENDED_SLASH_Q } @@ -4753,7 +4796,7 @@ load_cabinet() { # http://www.microsoft.com/downloads/en/details.aspx?FamilyId=9AD000F2-CAE7-493D-B0F3-AE36C570ADE8&displaylang=en w_download http://download.microsoft.com/download/3/b/f/3bf74b01-16ba-472d-9a8c-42b2b4fa0d76/mdac_typ.exe f68594d1f578c3b47bf0639c46c11c5da161feee - w_try_cabextract --directory="$W_TMP" "$W_CACHE"/cabinet/$file1 + w_try_cabextract --directory="$W_TMP" "$W_CACHE/cabinet/$file1" w_try cp "$W_TMP"/cabinet.dll "$W_SYSTEM32_DLLS"/cabinet.dll w_override_dlls native,builtin cabinet @@ -4851,7 +4894,7 @@ load_comdlg32ocx() { # By analogy with vb5 version in http://support.microsoft.com/kb/168917 w_download http://activex.microsoft.com/controls/vb6/ComDlg32.cab d4f3e193c6180eccd73bad53a8500beb5b279cbf - w_try_cabextract --directory="$W_TMP" "$W_CACHE"/comdlg32ocx/${file1} + w_try_cabextract --directory="$W_TMP" "$W_CACHE/comdlg32ocx/${file1}" w_try cp "$W_TMP"/comdlg32.ocx "$W_SYSTEM32_DLLS"/comdlg32.ocx w_try_regsvr comdlg32.ocx } @@ -5466,7 +5509,7 @@ load_directx9() # See http://code.google.com/p/winezeug/issues/detail?id=71 w_set_winver winxp - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" WINEDLLOVERRIDES="wintrust=b,mscoree=,ddraw,d3d8,d3d9,dsound,dinput=n" \ w_try "$WINE" $DIRECTX_NAME /t:"$W_TMP_WIN" $W_UNATTENDED_SLASH_Q @@ -5556,7 +5599,7 @@ load_dxsdk_nov2006() w_try_cabextract "$W_CACHE"/dxsdk_nov2006/dxsdk_aug2006.exe w_try_unzip "$W_TMP" dxsdk.exe - cd "$W_TMP" + w_try_cd "$W_TMP" w_try "$WINE" msiexec /i Microsoft_DirectX_SDK.msi $W_UNATTENDED_SLASH_Q } @@ -5577,7 +5620,7 @@ load_dxsdk_jun2010() # Without dotnet20, install aborts halfway through w_call dotnet20 - cd "$W_TMP" + w_try_cd "$W_TMP" w_try "$WINE" "$W_CACHE"/dxsdk_jun2010/DXSDK_Jun10.exe ${W_OPT_UNATTENDED:+/U} } @@ -5628,7 +5671,7 @@ load_dotnet11() w_call corefonts w_call fontfix - w_try cd "$W_CACHE/dotnet11" + w_try w_try_cd "$W_CACHE/dotnet11" # Use builtin regsvcs.exe to work around https://bugs.winehq.org/show_bug.cgi?id=25120 if test $W_OPT_UNATTENDED then @@ -5681,7 +5724,7 @@ load_dotnet11sp1() w_call remove_mono w_call dotnet11 - w_try cd "$W_CACHE/dotnet11sp1" + w_try w_try_cd "$W_CACHE/dotnet11sp1" # Use builtin regsvcs.exe to work around http://bugs.winehq.org/show_bug.cgi?id=25120 if test $W_OPT_UNATTENDED then @@ -5746,7 +5789,7 @@ load_dotnet20() "$WINE" reg delete 'HKLM\Software\Microsoft\.NETFramework\v2.0.50727\SBSDisabled' /f fi - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" dotnetfx.exe ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} w_unset_winver @@ -5786,7 +5829,7 @@ load_dotnet20sdk() w_call dotnet20 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, setup.exe ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} @@ -5870,7 +5913,7 @@ load_dotnet20sp1() # Workaround Wine/Mono integration: "$WINE" reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727" /v Version /t REG_SZ /d "2.0.50727" /f - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" "$WINE" NetFx20SP1_x86.exe ${W_OPT_UNATTENDED:+/q} status=$? @@ -5927,7 +5970,7 @@ load_dotnet20sp2() fi $WINESERVER -w - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, NetFx20SP2_x86.exe ${W_OPT_UNATTENDED:+ /q /c:"install.exe /q"} @@ -6009,6 +6052,7 @@ load_dotnet30() # AF's workaround to avoid long pause LANGPACKS_BASE_PATH="${W_WINDIR_UNIX}/SYSMSICache/Framework/v3.0" test -d "${LANGPACKS_BASE_PATH}" || mkdir -p "${LANGPACKS_BASE_PATH}" + # shellcheck disable=SC1010 for lang in ar cs da de el es fi fr he it jp ko nb nl pl pt-BR pt-PT ru \ sv tr zh-CHS zh-CHT do @@ -6023,8 +6067,8 @@ load_dotnet30() WINEDLLOVERRIDES="ngen.exe,mscorsvw.exe=b;$WINEDLLOVERRIDES" - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /q /c:"install.exe /q"} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /q /c:"install.exe /q"} # Doesn't install any ngen.exe # W_NGEN_CMD="" @@ -6059,7 +6103,7 @@ load_dotnet30sp1() w_call dotnet20sp1 $WINESERVER -w - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" "$WINE" reg add "HKLM\\Software\\Microsoft\\Net Framework Setup\\NDP\\v3.0" /v Version /t REG_SZ /d "3.0" /f "$WINE" reg add "HKLM\\Software\\Microsoft-\\Net Framework Setup\\NDP\\v3.0" /v SP /t REG_DWORD /d 0001 /f @@ -6067,9 +6111,9 @@ load_dotnet30sp1() w_try "$WINE" msiexec /i "XPSEP XP and Server 2003 32 bit.msi" ${W_UNATTENDED_SLASH_QB} "$WINE" sc delete FontCache3.0.0.0 - "$WINE" $file1 ${W_OPT_UNATTENDED:+/q} + "$WINE" "$file1" ${W_OPT_UNATTENDED:+/q} status=$? - w_info $file1 exited with status $status + w_info "$file1 exited with status $status" # Doesn't install any ngen.exe # W_NGEN_CMD="" @@ -6114,9 +6158,9 @@ load_dotnet35() "$WINE" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5" /f # See also http://blogs.msdn.com/astebner/archive/2008/07/17/8745415.aspx - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_cabextract $W_UNATTENDED_DASH_Q "$W_CACHE"/dotnet35/dotnetfx35.exe - cd wcu/dotNetFramework + w_try_cd wcu/dotNetFramework "$WINE" dotNetFx35setup.exe /lang:ENU $W_UNATTENDED_SLASH_Q # Doesn't install any ngen.exe @@ -6160,7 +6204,7 @@ load_dotnet35sp1() WINEDLLOVERRIDES=ngen.exe,mscorsvw.exe=b export WINEDLLOVERRIDES - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, dotnetfx35.exe /lang:ENU $W_UNATTENDED_SLASH_Q @@ -6224,7 +6268,7 @@ load_dotnet40() w_try rm -f "$W_WINDIR_UNIX/system32/mscoree.dll" - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" WINEDLLOVERRIDES=fusion=b "$WINE" dotNetFx40_Full_x86_x64.exe ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} || true @@ -6274,7 +6318,7 @@ load_dotnet45() w_call dotnet40 w_set_winver win7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" WINEDLLOVERRIDES=fusion=b "$WINE" dotnetfx45_full_x86_x64.exe ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} status=$? @@ -6330,7 +6374,7 @@ load_dotnet452() w_call dotnet40 w_set_winver win7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" WINEDLLOVERRIDES=fusion=b "$WINE" NDP452-KB2901907-x86-x64-AllOS-ENU.exe ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} status=$? @@ -6384,15 +6428,15 @@ load_dotnet46() w_call dotnet45 w_set_winver win7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if w_workaround_wine_bug 38959 ; then echo "This installer will fail unless run in quiet mode." echo "See: https://bugs.winehq.org/show_bug.cgi?id=38959" - WINEDLLOVERRIDES=fusion=b "$WINE" ${file1} /q /c:"install.exe /q" + WINEDLLOVERRIDES=fusion=b "$WINE" "$file1" /q /c:"install.exe /q" # Once bug is fixed, use: - #WINEDLLOVERRIDES=fusion=b "$WINE" ${file1} ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} + #WINEDLLOVERRIDES=fusion=b "$WINE" "$file1" ${W_OPT_UNATTENDED:+/q /c:"install.exe /q"} status=$? fi @@ -6426,9 +6470,9 @@ load_dotnet_verifier() # 2015/12/27: sha1sum b9712da2943e057668f21f68c473657a205c5cb8 # 2016/09/22: name change, to netfx_setupverifier_new_2015_12_18.zip - w_download https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/99/90/04/netfx_setupverifier_new_2015_12_18.zip b9712da2943e057668f21f68c473657a205c5cb8 ${file1} + w_download https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/99/90/04/netfx_setupverifier_new_2015_12_18.zip b9712da2943e057668f21f68c473657a205c5cb8 "${file1}" - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try_unzip "$W_SYSTEM32_DLLS" netfx_5F00_setupverifier_5F00_new.zip netfx_setupverifier.exe w_warn "You can run the .Net Verifier with \"${WINE} netfx_setupverifier.exe\"" @@ -6533,7 +6577,7 @@ load_flash() w_download http://download.macromedia.com/pub/flashplayer/installers/archive/fp_14.0.0.176_archive.zip 40df72ab2c22bcd4442aa35eb586000776129982 w_try_unzip "$W_TMP" "$W_CACHE"/flash/fp_14.0.0.176_archive.zip fp_14.0.0.176_archive/14_0_r0_176/flashplayer14_0r0_176_winax.exe - cd "$W_TMP"/fp_14.0.0.176_archive/14_0_r0_176 + w_try_cd "$W_TMP"/fp_14.0.0.176_archive/14_0_r0_176 w_try "$WINE" flashplayer14_0r0_176_winax.exe ${W_OPT_UNATTENDED:+ /install} # Mozilla / Firefox (NPAPI) plugin @@ -6549,12 +6593,13 @@ load_flash() w_download http://download.macromedia.com/pub/flashplayer/installers/archive/fp_14.0.0.179_archive.zip b94860ca0eff3e1420c24f9647a5f9f5e610ce34 w_try_unzip "$W_TMP" "$W_CACHE"/flash/fp_14.0.0.179_archive.zip fp_14.0.0.179_archive/14_0_r0_179/flashplayer14_0r0_179_win.exe - cd "$W_TMP"/fp_14.0.0.179_archive/14_0_r0_179 + w_try_cd "$W_TMP"/fp_14.0.0.179_archive/14_0_r0_179 w_try "$WINE" flashplayer14_0r0_179_win.exe ${W_OPT_UNATTENDED:+ /install} # Projector (standalone player) # 2015-07-06 w_download http://download.macromedia.com/pub/flashplayer/updaters/14/flashplayer_14_sa.exe 62e5bc2e88b50091847408b9d473ee4a6c185167 + # shellcheck disable=SC2154 w_try cp "${W_CACHE}/${W_PACKAGE}/${file3}" "$W_SYSTEM32_DLLS/Macromed/Flash" # After updating the above, you should carry the following steps out by @@ -6563,18 +6608,18 @@ load_flash() # not something newer.) # rm -rf ~/.cache/winetricks/flash - # cd ~/winetricks/src + # w_try_cd ~/winetricks/src # rm -rf ~/.wine # sh winetricks -q flash ie7 - # cd ~/".wine/drive_c/Program Files/Internet Explorer" + # w_try_cd ~/".wine/drive_c/Program Files/Internet Explorer" # wine iexplore.exe http://www.adobe.com/software/flash/about # Verify that the version of Flash shows up and that you're not prompted # to install Flash again # - # cd ~/winetricks/src + # w_try_cd ~/winetricks/src # rm -rf ~/.wine # sh winetricks -q flash firefox - # cd ~/.wine/drive_c/Program\ Files/Mozilla\ Firefox + # w_try_cd ~/.wine/drive_c/Program\ Files/Mozilla\ Firefox # wine firefox.exe http://www.adobe.com/software/flash/about # Verify that the version of Flash shows up and that you're not prompted # to install Flash again @@ -6613,7 +6658,7 @@ w_metadata gdiplus_winxp dlls \ load_gdiplus_winxp() { w_download_manual http://download.cnet.com/NET-Framework-1-0-GDIPLUS-DLL-Security-Update/3000-10250_4-10732223.html NDP1.0sp2-KB830348-X86-Enu.exe 6113cd89d77525958295ccbd73b5fb8b89abd0aa - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try_cabextract -d "$W_TMP" -F FL_gdiplus_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 "$W_CACHE/${W_PACKAGE}/$file1" w_try cp "$W_TMP/FL_gdiplus_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8" "$W_SYSTEM32_DLLS/gdiplus.dll" @@ -6634,7 +6679,7 @@ w_metadata glidewrapper dlls \ load_glidewrapper() { w_download http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe 7a9d60a18b660473742b476465e9aea7bd5ab6f8 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # The installer opens its README in a web browser, really annoying when doing make check/test: # FIXME: maybe we should back up this key first? @@ -6652,7 +6697,7 @@ _EOF_ fi # NSIS installer - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} if test ${W_OPT_UNATTENDED} then @@ -6677,7 +6722,7 @@ load_gfw() w_download http://download.microsoft.com/download/5/5/8/55846E20-4A46-4EF8-B272-7F988BC9090A/gfwlivesetupmin.exe 6f9e0ba052c68c8b51bb0e3ce6024d0e1c7b20b2 # FIXME: Depends on .NET 20, but is it really needed? For now, skip it. - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" gfwlivesetupmin.exe /nodotnet $W_UNATTENDED_SLASH_Q w_call msasn1 @@ -6722,7 +6767,7 @@ load_gmdls() w_try mv "$W_TMP"/gm16.dls "$W_SYSTEM32_DLLS"/drivers/gm.dls if test "$W_ARCH" = "win64" then - w_try cd "$W_SYSTEM64_DLLS"/drivers + w_try w_try_cd "$W_SYSTEM64_DLLS"/drivers w_try ln -s ../../syswow64/drivers/gm.dls fi } @@ -6762,7 +6807,7 @@ load_dirac() # Avoid mfc90 not found error. (DiracSplitter-libschroedinger.ax needs mfc90 to register itself, I think.) w_call vcrun2008 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run DiracDirectShowFilter-1.0.2.exe @@ -6798,7 +6843,7 @@ w_metadata ffdshow dlls \ load_ffdshow() { w_download $WINETRICKS_SOURCEFORGE/ffdshow-tryout/ffdshow_beta7_rev3154_20091209.exe 8534c31489e51df70ee9583438d6211e6f0696d0 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" ffdshow_beta7_rev3154_20091209.exe $W_UNATTENDED_SLASH_SILENT } @@ -6839,7 +6884,7 @@ load_icodecs() # 2014-04-11: http://www.cucusoft.com/codecdownload/codinstl.exe (linked from http://www.cucusoft.com/codec.asp) w_download "http://www.cucusoft.com/codecdownload/codinstl.exe" 2c5d64f472abe3f601ce352dcca75b4f02996f8a - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -6884,7 +6929,7 @@ load_jet40() # See also http://bugs.winehq.org/show_bug.cgi?id=6085 # FIXME: "failed with error 2" w_download http://download.microsoft.com/download/4/3/9/4393c9ac-e69e-458d-9f6d-2fe191c51469/jet40sp8_9xnt.exe 8cd25342030857969ede2d8fcc34f3f7bcc2d6d4 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" jet40sp8_9xnt.exe $W_UNATTENDED_SLASH_Q } @@ -6911,7 +6956,7 @@ load_ie8_kb2936068() quiet="" fi - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" "$WINE" IE8-WindowsXP-KB2936068-x86-ENU.exe $quiet status=$? case $status in @@ -6937,7 +6982,7 @@ load_kde() w_download http://mirrors.mit.edu/kde/stable/kdewin/installer/kdewin-installer-gui-1.0.0.exe 0d798facb7fbf11529e7ecd067e875d76adb9d78 mkdir -p "$W_PROGRAMS_UNIX/kde" w_try cp "$W_CACHE/kde/${file1}" "$W_PROGRAMS_UNIX/kde" - cd "$W_PROGRAMS_UNIX/kde" + w_try_cd "$W_PROGRAMS_UNIX/kde" # There's no unattended option, probably because there are so many choices, # it's like Cygwin w_try "$WINE" "${file1}" @@ -6957,8 +7002,8 @@ w_metadata kindle apps \ load_kindle() { w_download http://kindleforpc.amazon.com/44025/KindleForPC-installer-1.16.44025.exe c57d0a7d8cd5f1c3020536edf336c3187f3e051f - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} if w_workaround_wine_bug 35041 then @@ -7011,7 +7056,7 @@ load_mdac27() w_download http://download.microsoft.com/download/3/b/f/3bf74b01-16ba-472d-9a8c-42b2b4fa0d76/mdac_typ.exe f68594d1f578c3b47bf0639c46c11c5da161feee load_native_mdac w_set_winver nt40 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" mdac_typ.exe ${W_OPT_UNATTENDED:+ /q /C:"setup $W_UNATTENDED_SLASH_QNT"} w_unset_winver } @@ -7032,7 +7077,7 @@ load_mdac28() w_download http://download.microsoft.com/download/4/a/a/4aafff19-9d21-4d35-ae81-02c48dcbbbff/MDAC_TYP.EXE 4fbc272c79da59e38818924d8575accb0af776fb load_native_mdac w_set_winver nt40 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" mdac_typ.exe ${W_OPT_UNATTENDED:+ /q /C:"setup $W_UNATTENDED_SLASH_QNT"} w_unset_winver } @@ -7051,33 +7096,34 @@ load_mdx() { helper_directx_dl - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_cabextract -F "*MDX*" "$W_CACHE"/directx9/$DIRECTX_NAME - w_try_cabextract -F "*.cab" *Archive.cab + w_try_cabextract -F "*.cab" ./*Archive.cab # Install assemblies - w_try_cabextract -d "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code/1.0.2902.0" -F "microsoft.directx*" *MDX1_x86.cab + w_try_cabextract -d "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code/1.0.2902.0" -F "microsoft.directx*" ./*MDX1_x86.cab for file in mdx_*.cab do ver="${file%%_x86.cab}" ver="${ver##mdx_}" w_try_cabextract -d "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code/$ver" -F "microsoft.directx*" "$file" done - w_try_cabextract -d "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code/1.0.2911.0" -F "microsoft.directx.direct3dx*" *MDX1_x86.cab + w_try_cabextract -d "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code/1.0.2911.0" -F "microsoft.directx.direct3dx*" ./*MDX1_x86.cab # Add them to GAC - cd "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code" + w_try_cd "$W_WINDIR_UNIX/Microsoft.NET/DirectX for Managed Code" for ver in * do - cd "$ver" - for asm in *.dll - do - name="${asm%%.dll}" - w_try mkdir -p "$W_WINDIR_UNIX/assembly/GAC/$name/${ver}__31bf3856ad364e35" - w_try cp "$asm" "$W_WINDIR_UNIX/assembly/GAC/$name/${ver}__31bf3856ad364e35" - done - cd - + ( + w_try_cd "$ver" + for asm in *.dll + do + name="${asm%%.dll}" + w_try mkdir -p "$W_WINDIR_UNIX/assembly/GAC/$name/${ver}__31bf3856ad364e35" + w_try cp "$asm" "$W_WINDIR_UNIX/assembly/GAC/$name/${ver}__31bf3856ad364e35" + done + ) done # AssemblyFolders @@ -7149,7 +7195,7 @@ load_mfc40() { w_download http://activex.microsoft.com/controls/vc/mfc40.cab 53c570e2c811674d6e4fa46cff5a3a04cd0ffc24 w_try_cabextract -d "$W_TMP" "$W_CACHE"/mfc40/mfc40.cab - w_try_cabextract -d "$W_SYSTEM32_DLLS" -F *40.dll "$W_TMP"/mfc40.exe + w_try_cabextract -d "$W_SYSTEM32_DLLS" -F '*40.dll' "$W_TMP"/mfc40.exe } #---------------------------------------------------------------- @@ -7166,7 +7212,7 @@ w_metadata mozillabuild apps \ load_mozillabuild() { w_download http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-2.0.0.exe daba4bc03ae9014c68611fd36b05dcc4083c6fdb - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" MozillaBuildSetup-2.0.0.exe $W_UNATTENDED_SLASH_S } @@ -7268,7 +7314,7 @@ load_msflxgrd() # 2015/11/09: 3d6c04e923781d4ce0d3ab62189b8de352ab25d5 w_download http://activex.microsoft.com/controls/vb6/MsFlxGrd.cab 3d6c04e923781d4ce0d3ab62189b8de352ab25d5 - w_try_cabextract --directory="$W_TMP" "$W_CACHE"/msflxgrd/${file1} + w_try_cabextract --directory="$W_TMP" "$W_CACHE/msflxgrd/${file1}" w_try cp -f "$W_TMP"/[Mm][Ss][Ff][Ll][Xx][Gg][Rr][Dd].[Oo][Cc][Xx] "$W_SYSTEM32_DLLS" w_try_regsvr MSFLXGRD.OCX } @@ -7416,7 +7462,7 @@ load_msxml3() # It won't install on top of Wine's msxml3, which has a pretty high version number, so delete Wine's fake DLL rm "$W_SYSTEM32_DLLS"/msxml3.dll w_override_dlls native msxml3 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i msxml3.msi $W_UNATTENDED_SLASH_Q } @@ -7439,7 +7485,7 @@ load_msxml4() # SP3 (2009): http://www.microsoft.com/downloads/details.aspx?familyid=7F6C0CB4-7A5E-4790-A7CF-9E139E6819C0 w_download http://download.microsoft.com/download/A/2/D/A2D8587D-0027-4217-9DAD-38AFDB0A177E/msxml.msi aa70c5c1a7a069af824947bcda1d9893a895318b w_override_dlls native,builtin msxml4 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i msxml.msi $W_UNATTENDED_SLASH_Q } @@ -7511,8 +7557,8 @@ w_metadata ogg dlls \ load_ogg() { w_download http://downloads.xiph.org/releases/oggdsf/opencodecs_0.85.17777.exe 386cf7cd29ffcbf8705eff8c8233de448ecf33ab - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 $W_UNATTENDED_SLASH_S + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" $W_UNATTENDED_SLASH_S } #---------------------------------------------------------------- @@ -7601,14 +7647,14 @@ load_openwatcom() # Options documented at http://bugzilla.openwatcom.org/show_bug.cgi?id=898 # But they don't seem to work on Wine, so jam them into setup.inf # Pick smallest installation that supports 16-bit C and C++ - cd "$W_TMP" + w_try_cd "$W_TMP" cp "$W_CACHE"/openwatcom/open-watcom-c-win32-1.9.exe . w_try_unzip . open-watcom-c-win32-1.9.exe setup.inf sed -i 's/tools16=.*/tools16=true/' setup.inf w_try zip -f open-watcom-c-win32-1.9.exe w_try "$WINE" open-watcom-c-win32-1.9.exe -s else - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" open-watcom-c-win32-1.9.exe fi @@ -7652,7 +7698,7 @@ load_physx() { # Has a minor issue, see bug report http://bugs.winehq.org/show_bug.cgi?id=34167 w_download http://uk.download.nvidia.com/Windows/9.14.0702/PhysX-9.14.0702-SystemSoftware.msi 81e2d38e2356e807ad80cdf150ed5acfff839c8b - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i PhysX-9.14.0702-SystemSoftware.msi $W_UNATTENDED_SLASH_Q } @@ -7733,8 +7779,8 @@ load_quicktime72() # https://support.apple.com/downloads/quicktime w_download http://appldnld.apple.com.edgesuite.net/content.info.apple.com/QuickTime/061-2915.20070710.pO94c/QuickTimeInstaller.exe bb89981f10cf21de57b9453e53cf81b9194271a9 - cd "$W_CACHE"/"$W_PACKAGE" - w_try "$WINE" ${file1} ALLUSERS=1 DESKTOP_SHORTCUTS=0 QTTaskRunFlags=0 QTINFO.BISQTPRO=1 SCHEDULE_ASUW=0 REBOOT_REQUIRED=No $W_UNATTENDED_SLASH_QN > /dev/null 2>&1 + w_try_cd "$W_CACHE"/"$W_PACKAGE" + w_try "$WINE" "$file1" ALLUSERS=1 DESKTOP_SHORTCUTS=0 QTTaskRunFlags=0 QTINFO.BISQTPRO=1 SCHEDULE_ASUW=0 REBOOT_REQUIRED=No $W_UNATTENDED_SLASH_QN > /dev/null 2>&1 if w_workaround_wine_bug 11681 then @@ -7770,7 +7816,7 @@ load_quicktime76() # http://www.apple.com/quicktime/download/ w_download http://appldnld.apple.com/QuickTime/041-0025.20101207.Ptrqt/QuickTimeInstaller.exe 1eec8904f041d9e0ad3459788bdb690e45dbc38e - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" QuickTimeInstaller.exe ALLUSERS=1 DESKTOP_SHORTCUTS=0 QTTaskRunFlags=0 QTINFO.BISQTPRO=1 SCHEDULE_ASUW=0 REBOOT_REQUIRED=No $W_UNATTENDED_SLASH_QN > /dev/null 2>&1 if w_workaround_wine_bug 11681 @@ -7805,7 +7851,7 @@ load_remove_mono() mono_uuid="$($WINE uninstaller --list | grep Mono | cut -f1 -d\|)" if test "$mono_uuid" then - "$WINE" uninstaller --remove $mono_uuid + "$WINE" uninstaller --remove "$mono_uuid" else w_warn "Mono does not appear to be installed." fi @@ -7971,9 +8017,10 @@ load_shockwave() { # 2015-12-27 sha1sum: 3ac6d85e54dffb2940c89fc10e63363a47ec96d0 # 2016-02-18 sha1sum: 45147a791e3f71bd67ead1622d9120060dd196e5 # 2016-03-11 sha1sum: 4f955f42984ae69d2f6078d3a3fe9fadc4a25e34 - - w_download http://fpdownload.macromedia.com/get/shockwave/default/english/win95nt/latest/sw_lic_full_installer.msi 4f955f42984ae69d2f6078d3a3fe9fadc4a25e34 - cd "$W_CACHE/$W_PACKAGE" + # 2016-10-11 sha1sum: bcb6a9d9a6f7781db3de3120a0c9dcd8118642d1 + + w_download http://fpdownload.macromedia.com/get/shockwave/default/english/win95nt/latest/sw_lic_full_installer.msi bcb6a9d9a6f7781db3de3120a0c9dcd8118642d1 + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i sw_lic_full_installer.msi $W_UNATTENDED_SLASH_Q } @@ -7997,7 +8044,7 @@ load_speechsdk() # Otherwise it only installs the SDK and not the redistributable: w_set_winver win2k - cd "$W_TMP" + w_try_cd "$W_TMP" w_try "$WINE" msiexec /i "Microsoft Speech SDK 5.1.msi" $W_UNATTENDED_SLASH_Q w_unset_winver @@ -8019,7 +8066,7 @@ load_tabctl32() # Nov 2012: tabctl32 w_download http://activex.microsoft.com/controls/vb6/TABCTL32.CAB beca51d05924a5466ab80eb0f8d0cdf8bc1ac697 - w_try_cabextract --directory="$W_TMP" "$W_CACHE"/tabctl32/${file1} + w_try_cabextract --directory="$W_TMP" "$W_CACHE/tabctl32/${file1}" w_try cp -f "$W_TMP"/[Tt][Aa][Bb][Cc][Tt][Ll][3][2].[Oo][Cc][Xx] "$W_SYSTEM32_DLLS" w_try_regsvr tabctl32.ocx } @@ -8133,7 +8180,7 @@ w_metadata vb5run dlls \ load_vb5run() { w_download http://download.microsoft.com/download/vb50pro/utility/1/win98/en-us/msvbvm50.exe 28bfaf09b8ac32cf5ffa81252f3e2fadcb3a8f27 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msvbvm50.exe $W_UNATTENDED_SLASH_Q } @@ -8168,14 +8215,14 @@ load_vb6run() rm -f "$W_SYSTEM32_DLLS"/olepro32.dll rm -f "$W_SYSTEM32_DLLS"/stdole2.tlb - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # Exits with status 43 for some reason? "$WINE" vbrun60sp6.exe $W_UNATTENDED_SLASH_Q status=$? case $status in 0|43) ;; - *) w_die $W_PACKAGE installation failed + *) w_die "$W_PACKAGE installation failed" esac } @@ -8278,7 +8325,7 @@ load_vcrun6sp6() # No EULA is presented when passing command-line extraction arguments, # so we'll simplify extraction with cabextract. w_try_cabextract "$W_CACHE"/vcrun6sp6/Vs6sp6.exe -d "$W_TMP" -F vcredist.exe - cd "$W_TMP" + w_try_cd "$W_TMP" # Delete some fake DLLs to avoid vcredist installer warnings w_try rm -f "$W_SYSTEM32_DLLS"/comcat.dll @@ -8292,7 +8339,7 @@ load_vcrun6sp6() status=$? case $status in 0|43) ;; - *) w_die $W_PACKAGE installation failed + *) w_die "$W_PACKAGE installation failed" esac # And then some apps need mfc42u.dll, dont know what right way @@ -8318,7 +8365,7 @@ load_vcrun2003() echo "Installing BZFlag (which comes with the Visual C++ 2003 runtimes)" # winetricks-test can't handle ${file1} in url since it does a raw parsing :/ w_download https://sourceforge.net/projects/bzflag/files/bzedit%20win32/1.6.5/BZEditW32_1.6.5.exe bdd1b32c4202fd77e6513fd507c8236888b09121 - w_try "$WINE" "$W_CACHE"/vcrun2003/${file1} $W_UNATTENDED_SLASH_S + w_try "$WINE" "$W_CACHE/vcrun2003/${file1}" $W_UNATTENDED_SLASH_S w_try cp "$W_PROGRAMS_X86_UNIX/BZEdit1.6.5"/m*71* "$W_SYSTEM32_DLLS" } @@ -8346,9 +8393,9 @@ load_vcrun2005() # http://support.microsoft.com/kb/2538242 w_download http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE b8fab0bb7f62a24ddfe77b19cd9a1451abd7b847 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_override_dlls native,builtin atl80 msvcm80 msvcp80 msvcr80 vcomp - w_try "$WINE" $file1 $W_UNATTENDED_SLASH_Q + w_try "$WINE" "$file1" $W_UNATTENDED_SLASH_Q } #---------------------------------------------------------------- @@ -8368,8 +8415,8 @@ load_vcrun2008() # http://support.microsoft.com/kb/2538242 w_download http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe 470640aa4bb7db8e69196b5edb0010933569e98d w_override_dlls native,builtin atl90 msvcm90 msvcp90 msvcr90 vcomp90 - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 $W_UNATTENDED_SLASH_Q + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" $W_UNATTENDED_SLASH_Q } #---------------------------------------------------------------- @@ -8388,7 +8435,7 @@ load_vcrun2010() w_download http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe 372d9c1670343d3fb252209ba210d4dc4d67d358 w_override_dlls native,builtin msvcp100 msvcr100 vcomp100 atl100 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" vcredist_x86.exe $W_UNATTENDED_SLASH_Q case "$W_ARCH" in @@ -8429,7 +8476,7 @@ load_vcrun2012() w_download http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe 96b377a27ac5445328cbaae210fc4f0aaa750d3f w_override_dlls native,builtin atl110 msvcp110 msvcr110 vcomp110 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" vcredist_x86.exe $W_UNATTENDED_SLASH_Q case "$W_ARCH" in @@ -8474,7 +8521,7 @@ load_vcrun2013() w_download http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe df7f0a73bfa077e483e51bfb97f5e2eceedfb6a3 w_override_dlls native,builtin atl120 msvcp120 msvcr120 vcomp120 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" vcredist_x86.exe $W_UNATTENDED_SLASH_Q case "$W_ARCH" in @@ -8523,7 +8570,7 @@ load_vcrun2015() w_override_dlls native,builtin api-ms-win-crt-conio-l1-1-0 api-ms-win-crt-heap-l1-1-0 api-ms-win-crt-locale-l1-1-0 api-ms-win-crt-math-l1-1-0 api-ms-win-crt-runtime-l1-1-0 api-ms-win-crt-stdio-l1-1-0 atl140 msvcp140 msvcr140 ucrtbase vcomp140 vcruntime140 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" vc_redist.x86.exe $W_UNATTENDED_SLASH_Q case "$W_ARCH" in @@ -8585,7 +8632,7 @@ load_vjrun20() # See http://www.microsoft.com/downloads/details.aspx?FamilyId=E9D87F37-2ADC-4C32-95B3-B5E3A21BAB2C w_download http://download.microsoft.com/download/9/2/3/92338cd0-759f-4815-8981-24b437be74ef/vjredist.exe 80a098e36b90d159da915aebfbfbacf35f302bd8 - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" vjredist.exe ${W_OPT_UNATTENDED:+ /q /C:"install $W_UNATTENDED_SLASH_QNT"} } @@ -8628,7 +8675,7 @@ load_windowscodecs() # Always run the WIC installer in passive mode. # See http://bugs.winehq.org/show_bug.cgi?id=16876 and # http://bugs.winehq.org/show_bug.cgi?id=23232 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test -x /usr/bin/taskset && w_workaround_wine_bug 32859 "Working around possibly broken libX11" then @@ -8697,7 +8744,7 @@ load_wmi() w_set_winver win98 w_override_dlls native,builtin wbemprox wmiutils # Note: there is a crash in the background towards the end, doesn't seem to hurt; see http://bugs.winehq.org/show_bug.cgi?id=7920 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" wmi9x.exe $W_UNATTENDED_SLASH_S w_unset_winver } @@ -8746,7 +8793,7 @@ load_wsh56js() # See also http://www.microsoft.com/downloads/details.aspx?FamilyID=16dd21a1-c4ee-4eca-8b80-7bd1dfefb4f8&DisplayLang=en w_download http://download.microsoft.com/download/b/c/3/bc3a0c36-fada-497d-a3de-8b0139766f3b/Windows2000-KB917344-56-x86-enu.exe add5f74c5bd4da6cfae47f8306de213ec6ed52c8 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_override_dlls native,builtin jscript # setupapi looks at the versions in new and original jscript.dll, and Wine's original is newer than wsh56js's, so we have to nuke the original w_try rm "$W_SYSTEM32_DLLS/jscript.dll" @@ -8769,7 +8816,7 @@ load_wsh56vb() # See also http://www.microsoft.com/downloads/details.aspx?familyid=4F728263-83A3-464B-BCC0-54E63714BC75 w_download http://download.microsoft.com/download/IE60/Patch/Q318089/W9XNT4Me/EN-US/vbs56men.exe 48f14a93db33caff271da0c93f334971f9d7cb22 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_override_dlls native,builtin vbscript # setupapi looks at the versions in new and original vbscript.dll, and Wine's original is newer than wsh56vb's, so we have to nuke the original w_try rm "$W_SYSTEM32_DLLS/vbscript.dll" @@ -8840,13 +8887,13 @@ load_xact() # Register xactengine?_?.dll for x in "$W_SYSTEM32_DLLS"/xactengine* do - w_try_regsvr $(basename "$x") + w_try_regsvr "$(basename "$x")" done # and xaudio?_?.dll, but not xaudio2_8 (unsupported) for x in 0 1 2 3 4 5 6 7 do - w_try_regsvr $(basename "$W_SYSTEM32_DLLS/xaudio2_${x}") + w_try_regsvr "$(basename "$W_SYSTEM32_DLLS/xaudio2_${x}")" done } @@ -8892,13 +8939,13 @@ load_xact_jun2010() # Register xactengine?_?.dll for x in "$W_SYSTEM32_DLLS"/xactengine* do - w_try_regsvr $(basename "$x") + w_try_regsvr "$(basename "$x")" done # and xaudio?_?.dll, but not xaudio2_8 (unsupported) for x in 0 1 2 3 4 5 6 7 do - w_try_regsvr $(basename "$W_SYSTEM32_DLLS/xaudio2_${x}") + w_try_regsvr "$(basename "$W_SYSTEM32_DLLS/xaudio2_${x}")" done } @@ -8958,7 +9005,7 @@ load_xmllite() # Doesn't install in newer versions: w_set_winver winxp - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_override_dlls native xmllite case $LANG in en*) w_try "$WINE" WindowsXP-KB915865-v11-x86-ENU.exe $W_UNATTENDED_SLASH_Q ;; @@ -8984,8 +9031,8 @@ load_xna31() { w_call dotnet20sp2 w_download http://download.microsoft.com/download/5/9/1/5912526C-B950-4662-99B6-119A83E60E5C/xnafx31_redist.msi bdd33b677c9576a63ff2a6f65e12c0563cc116e6 - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" msiexec $W_UNATTENDED_SLASH_QUIET /i $file1 + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" msiexec $W_UNATTENDED_SLASH_QUIET /i "$file1" } #---------------------------------------------------------------- @@ -9011,8 +9058,8 @@ load_xna40() # http://www.microsoft.com/en-us/download/details.aspx?id=20914 w_download http://download.microsoft.com/download/A/C/2/AC2C903B-E6E8-42C2-9FD7-BEBAC362A930/xnafx40_redist.msi 49efdc29f65fc8263c196338552c7009fc96c5de - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" msiexec $W_UNATTENDED_SLASH_QUIET /i $file1 + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" msiexec $W_UNATTENDED_SLASH_QUIET /i "$file1" } #---------------------------------------------------------------- @@ -9029,8 +9076,8 @@ load_xvid() { w_call vcrun6 w_download http://www.koepi.info/Xvid-1.3.2-20110601.exe 0a11498a96f75ad019c4c7d06161504140337dc0 - cd "$W_CACHE"/"$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ --mode unattended --decode_divx 1 --decode_3ivx 1 --decode_other 1} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ --mode unattended --decode_divx 1 --decode_3ivx 1 --decode_other 1} } #---------------------------------------------------------------- @@ -9051,7 +9098,7 @@ load_baekmuk() # Need to download from Debian as the project page has unique captcha tokens per visitor w_download http://http.debian.net/debian/pool/main/f/fonts-baekmuk/fonts-baekmuk_2.2.orig.tar.gz afdee34f700007de6ea87b43c92a88b7385ba65b - cd "$W_TMP" + w_try_cd "$W_TMP" tar zxvf "$W_CACHE/$W_PACKAGE/$file1" baekmuk-ttf-2.2/ttf w_try mv baekmuk-ttf-2.2/ttf/*.ttf "$W_FONTSDIR_UNIX" w_register_font batang.ttf "Baekmuk Batang" @@ -9249,9 +9296,9 @@ w_metadata droid fonts \ installed_file1="$W_FONTSDIR_WIN/DroidSans-Bold.ttf" do_droid() { - w_download ${DROID_URL}$1'?raw=true' $3 $1 - w_try cp -f "$W_CACHE"/droid/$1 "$W_FONTSDIR_UNIX" - w_register_font $1 "$2" + w_download "${DROID_URL}$1'?raw=true'" "$3" "$1" + w_try cp -f "$W_CACHE/droid/$1" "$W_FONTSDIR_UNIX" + w_register_font "$1" "$2" } load_droid() @@ -9472,12 +9519,12 @@ w_metadata ipamona fonts \ load_ipamona() { - w_download http://www.geocities.jp/ipa_mona/$file1 57dd13ab58c0005d3ee2932539e4987ab0242bc7 + w_download "http://www.geocities.jp/ipa_mona/$file1" 57dd13ab58c0005d3ee2932539e4987ab0242bc7 - cd "$W_TMP" + w_try_cd "$W_TMP" gunzip -dc "$W_CACHE/$W_PACKAGE/$file1" | tar -xf - - w_try mv *IPAMonaFonts*/fonts/*.ttf "$W_FONTSDIR_UNIX" + w_try mv ./*IPAMonaFonts*/fonts/*.ttf "$W_FONTSDIR_UNIX" w_register_font ipagui-mona.ttf "IPAMonaUIGothic" w_register_font ipag-mona.ttf "IPAMonaGothic" @@ -9509,7 +9556,7 @@ load_liberation() esac w_download https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-1.04.tar.gz 097882c92e3260742a3dc3bf033792120d8635a3 - cd "$W_TMP" + w_try_cd "$W_TMP" gunzip -dc "$W_CACHE"/liberation/liberation-fonts-1.04.tar.gz | tar -xf - mv liberation-fonts-1.04/*.ttf "$W_FONTSDIR_UNIX" @@ -9561,7 +9608,7 @@ load_opensymbol() # Note: The source download package on debian is for _all_ of OpenOffice, which is 266 MB. w_download http://security.debian.org/debian-security/pool/updates/main/libr/libreoffice/fonts-opensymbol_102.6+LibO4.3.3-2+deb8u5_all.deb b683e6304c58fdbb5c31443609a3398c71a3fcf0 - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_ar "$W_CACHE/$W_PACKAGE/$file1" data.tar.xz w_try tar Jvxf "$W_TMP/data.tar.xz" ./usr/share/fonts/truetype/openoffice/opens___.ttf w_try mv "$W_TMP/usr/share/fonts/truetype/openoffice/opens___.ttf" "$W_FONTSDIR_UNIX" @@ -9636,7 +9683,7 @@ w_metadata uff fonts \ load_uff() { w_download http://font.ubuntu.com/download/ubuntu-font-family-0.70.1.zip efbab0d5d8cb5cff091307d2360dcb1bfe1ae6e1 - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_unzip . "$W_CACHE"/uff/ubuntu-font-family-0.70.1.zip mv ubuntu-font-family-0.70.1/*.ttf "$W_FONTSDIR_UNIX" @@ -9661,7 +9708,7 @@ load_wenquanyi() # See http://wenq.org/enindex.cgi # Donate at http://wenq.org/enindex.cgi?Download(en)#MicroHei_Beta if you want to help support free CJK font development w_download $WINETRICKS_SOURCEFORGE/wqy/wqy-microhei-0.2.0-beta.tar.gz 28023041b22b6368bcfae076de68109b81e77976 - cd "$W_TMP/" + w_try_cd "$W_TMP/" gunzip -dc "$W_CACHE/wenquanyi/wqy-microhei-0.2.0-beta.tar.gz" | tar -xf - w_try mv wqy-microhei/wqy-microhei.ttc "$W_FONTSDIR_UNIX" w_register_font wqy-microhei.ttc "WenQuanYi Micro Hei" @@ -9703,10 +9750,10 @@ load_allfonts() # This verb uses reflection, should probably do it portably instead, but that would require keeping it up to date for file in "$WINETRICKS_METADATA"/fonts/*.vars do - cmd=$(basename $file .vars) + cmd=$(basename "$file" .vars) case $cmd in allfonts|cjkfonts) ;; - *) w_call $cmd;; + *) w_call "$cmd";; esac done } @@ -9721,13 +9768,13 @@ w_metadata 3m_library apps \ year="2015" \ media="download" \ file1="3M-TM-Cloud-Library-PC-App-LIVE-Installer-1.51.735677.exe" \ - installed_exe1="$W_PROGRAMS_X86_WIN/3M(TM) Cloud Library PC App/3MCloudLibrary.exe" + installed_exe1="$W_PROGRAMS_X86_WIN/3M(TM) Cloud Library PC App/3MCloudLibrary.exe" \ homepage="http://www.3m.com/us/library/eBook/index.html" load_3m_library() { w_download http://www.3m.com/us/library/eBook/docs/3M-TM-Cloud-Library-PC-App-LIVE-Installer-1.51.735677.exe 810dc5f6b74ab7b34893288ee44ef7dc563a4ee7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" 3M-TM-Cloud-Library-PC-App-LIVE-Installer-1.51.735677.exe $W_UNATTENDED_SLASH_S } @@ -9744,7 +9791,7 @@ w_metadata 7zip apps \ load_7zip() { w_download http://www.7-zip.org/a/7z1602.exe a86f0726019ca84d1de1b036033d888d4538b2a9 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" "${file1}" $W_UNATTENDED_SLASH_S } @@ -9761,7 +9808,7 @@ w_metadata abiword apps \ load_abiword() { w_download http://www.abisource.com/downloads/abiword/2.8.6/Windows/abiword-setup-2.8.6.exe a91acd3f60e842d23556032d34f1600602768318 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" abiword-setup-2.8.6.exe $W_UNATTENDED_SLASH_S } @@ -9780,7 +9827,7 @@ load_adobe_diged() { w_download http://kb2.adobe.com/cps/403/kb403051/attachments/setup.exe 4c79685408fa6ca12ef8bb0e0eaa4a846e21f915 # NSIS installer - w_try "$WINE" "$W_CACHE"/$W_PACKAGE/setup.exe ${W_OPT_UNATTENDED:+ /S} + w_try "$WINE" "$W_CACHE/$W_PACKAGE/setup.exe" ${W_OPT_UNATTENDED:+ /S} } #---------------------------------------------------------------- @@ -9810,7 +9857,7 @@ load_adobe_diged4() w_call dotnet40 #w_call win7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, ${file1} ${W_OPT_UNATTENDED:+ /S} @@ -9834,7 +9881,7 @@ w_metadata audible apps \ load_audible() { w_download http://download.audible.com/AM50/ActiveSetupN.exe 49f501471912ccca442bcc1c8f2c69160579f712 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # Use exact title match! w_ahk_do " SetWinDelay 500 @@ -9865,7 +9912,7 @@ w_metadata audibledm apps \ load_audibledm() { w_download http://download.audible.com/AM50/AudibleDM_iTunesSetup.exe 03261d77a59ebbceedf6683b5301c162bc0c7788 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 500 SetTitleMatchMode, 2 @@ -9898,7 +9945,7 @@ load_autohotkey() { W_BROWSERAGENT=1 \ w_download http://www.autohotkey.com/download/AutoHotkey104805_Install.exe 13e5a9ca6d5b7705f1cd02560c3af4d38b1904fc - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" AutoHotkey104805_Install.exe $W_UNATTENDED_SLASH_S } @@ -9915,7 +9962,7 @@ w_metadata cmake apps \ load_cmake() { w_download http://www.cmake.org/files/v2.8/cmake-2.8.11.2-win32-x86.exe d79af5715c0ad48d78bb731cce93b5ad89b16512 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" cmake-2.8.11.2-win32-x86.exe $W_UNATTENDED_SLASH_S } @@ -9958,7 +10005,7 @@ load_controlpad() echo "If setup says 'Unable to start DDE ...', press Ignore" - cd "$W_TMP" + w_try_cd "$W_TMP" w_try "$WINE" setup $W_UNATTENDED_SLASH_QT if ! test -f "$W_SYSTEM32_DLLS"/FM20.DLL @@ -9980,7 +10027,7 @@ w_metadata controlspy apps \ load_controlspy() { w_download http://download.microsoft.com/download/a/3/1/a315b133-03a8-4845-b428-ec585369b285/ControlSpy.msi efe33701f78b5853ba73353f028b777b4c849e77 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i ControlSpy.msi ${W_UNATTENDED_SLASH_QB} } @@ -10031,7 +10078,7 @@ w_metadata emu8086 apps \ load_emu8086() { w_download http://www.emu8086.com/files/emu8086v408r11.zip aa71b46ee9259e5b31a300c820277e551969da7b - w_try_unzip "$W_TMP" "$W_CACHE/$W_PACKAGE"/$file1 + w_try_unzip "$W_TMP" "$W_CACHE/$W_PACKAGE/$file1" w_try "$WINE" "$W_TMP/Setup.exe" $W_UNATTENDED_SLASH_SILENT } @@ -10071,7 +10118,7 @@ load_ev3() quiet="" fi - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" "$file1" ${quiet} if w_workaround_wine_bug 40729 "Setting override for urlmon.dll to native to avoid crash" @@ -10098,7 +10145,7 @@ w_metadata firefox apps \ load_firefox() { w_download "https://download.mozilla.org/?product=firefox-39.0-SSL&os=win&lang=en-US" 75eccbd9b2d44210b551c9a5045f03f01e899528 "$file1" - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ -ms} } @@ -10117,7 +10164,7 @@ load_fontxplorer() { w_download http://www.moonsoftware.com/files/legacy/Font_Xplorer_122_Free.exe 22feb63be28730cbfad5458b139464490a25a68d - cd "$W_CACHE/fontxplorer" + w_try_cd "$W_CACHE/fontxplorer" w_try "$WINE" Font_Xplorer_122_Free.exe $W_UNATTENDED_SLASH_S } @@ -10134,8 +10181,8 @@ w_metadata foobar2000 apps \ load_foobar2000() { w_download_manual http://www.foobar2000.org/download foobar2000_v1.3.10.exe d4d60effc26d3ead48ba6f9c5ad32b9066231807 - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 $W_UNATTENDED_SLASH_S + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" $W_UNATTENDED_SLASH_S } #---------------------------------------------------------------- @@ -10174,7 +10221,7 @@ load_irfanview() w_call mfc42 fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test "$W_OPT_UNATTENDED" then w_ahk_do " @@ -10223,7 +10270,7 @@ load_irfanview() winwaitclose " else - w_try "$WINE" $file1 + w_try "$WINE" "$file1" fi } @@ -10249,8 +10296,8 @@ load_ie6() w_download http://download.oldapps.com/Internet_Explorer/ie60.exe 8e483db28ff01a7cabd39147ab6c59753ea1f533 - cd "$W_TMP" - "$WINE" "$W_CACHE"/"$W_PACKAGE"/$file1 + w_try_cd "$W_TMP" + "$WINE" "$W_CACHE/$W_PACKAGE/$file1" w_call msls31 @@ -10265,7 +10312,7 @@ load_ie6() w_override_dlls native,builtin iexplore.exe inetcpl.cpl itircl itss jscript mlang mshtml msimtf shdoclc shdocvw shlwapi # Remove the fake DLLs, if any - mv "$W_PROGRAMS_UNIX"/"Internet Explorer"/iexplore.exe "$W_PROGRAMS_UNIX"/"Internet Explorer"/iexplore.exe.bak + mv "$W_PROGRAMS_UNIX/Internet Explorer/iexplore.exe" "$W_PROGRAMS_UNIX/Internet Explorer/iexplore.exe.bak" for dll in itircl itss jscript mlang mshtml msimtf shdoclc shdocvw shlwapi do test -f "$W_SYSTEM32_DLLS"/$dll.dll && @@ -10287,7 +10334,7 @@ load_ie6() mv inseng.dll "$W_SYSTEM32_DLLS" w_override_dlls native inseng - cd "$W_TMP/IE 6.0 Full" + w_try_cd "$W_TMP/IE 6.0 Full" if [ $W_UNATTENDED_SLASH_Q ] then "$WINE" IE6SETUP.EXE /q:a /r:n /c:"ie6wzd /S:""#e"" /q:a /r:n" @@ -10304,7 +10351,7 @@ load_ie6() # Work around DLL registration bug until ierunonce/RunOnce/wineboot is fixed # FIXME: whittle down this list - cd "$W_SYSTEM32_DLLS" + w_try_cd "$W_SYSTEM32_DLLS" for i in actxprxy.dll browseui.dll browsewm.dll cdfview.dll ddraw.dll \ dispex.dll dsound.dll iedkcs32.dll iepeers.dll iesetup.dll imgutil.dll \ inetcomm.dll inetcpl.cpl inseng.dll isetup.dll jscript.dll laprxy.dll \ @@ -10384,7 +10431,7 @@ load_ie7() # Install w_download http://download.microsoft.com/download/3/8/8/38889DC1-848C-4BF2-8335-86C573AD86D9/IE7-WindowsXP-x86-enu.exe d39b89c360fbaa9706b5181ae4718100687a5326 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" "$WINE" IE7-WindowsXP-x86-enu.exe $W_UNATTENDED_SLASH_QUIET @@ -10405,7 +10452,7 @@ load_ie7() # Work around DLL registration bug until ierunonce/RunOnce/wineboot is fixed # FIXME: whittle down this list - cd "$W_SYSTEM32_DLLS" + w_try_cd "$W_SYSTEM32_DLLS" for i in actxprxy.dll browseui.dll browsewm.dll cdfview.dll ddraw.dll \ dispex.dll dsound.dll iedkcs32.dll iepeers.dll iesetup.dll \ imgutil.dll inetcomm.dll inseng.dll isetup.dll jscript.dll laprxy.dll \ @@ -10423,10 +10470,10 @@ load_ie7() # Seeing is believing case $WINETRICKS_GUI in none) - w_warn "To start ie7, use the command "$WINE" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" + w_warn "To start ie7, use the command \"$WINE\" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" ;; *) - w_warn "Starting ie7. To start it later, use the command "$WINE" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" + w_warn "Starting ie7. To start it later, use the command \"$WINE\" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" "$WINE" "${W_PROGRAMS_WIN}\\Internet Explorer\\iexplore" http://www.microsoft.com/windows/internet-explorer/ie7/ > /dev/null 2>&1 & ;; esac @@ -10489,7 +10536,7 @@ load_ie8() else quiet="" fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # KLUDGE: if / is writable, having a Z: mapping to it causes ie8 to put temporary directories on Z:\ # so hide it temporarily. This is not very robust! @@ -10505,7 +10552,7 @@ load_ie8() # Work around DLL registration bug until ierunonce/RunOnce/wineboot is fixed # FIXME: whittle down this list - cd "$W_SYSTEM32_DLLS" + w_try_cd "$W_SYSTEM32_DLLS" for i in actxprxy.dll browseui.dll browsewm.dll cdfview.dll ddraw.dll \ dispex.dll dsound.dll iedkcs32.dll iepeers.dll iesetup.dll \ imgutil.dll inetcomm.dll isetup.dll jscript.dll laprxy.dll \ @@ -10535,10 +10582,10 @@ _EOF_ # Seeing is believing case $WINETRICKS_GUI in none) - w_warn "To start ie8, use the command "$WINE" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" + w_warn "To start ie8, use the command \"$WINE\" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" ;; *) - w_warn "Starting ie8. To start it later, use the command "$WINE" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" + w_warn "Starting ie8. To start it later, use the command \"$WINE\" '${W_PROGRAMS_WIN}\\\\Internet Explorer\\\\iexplore'" "$WINE" "${W_PROGRAMS_WIN}\\Internet Explorer\\iexplore" http://www.microsoft.com/windows/internet-explorer > /dev/null 2>&1 & ;; esac @@ -10558,8 +10605,8 @@ w_metadata kobo apps \ load_kobo() { w_download http://download.kobobooks.com/desktop/1/KoboSetup.exe 31a5f5583edf4b716b9feacb857d2170104cabd9 - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} } #---------------------------------------------------------------- @@ -10577,7 +10624,7 @@ load_mingw() { w_download "$WINETRICKS_SOURCEFORGE/mingw/files/mingw-get-setup.exe" 66f1355f16ac1e328243e877880eb6e45e8b30e2 - cd "$W_CACHE/mingw" + w_try_cd "$W_CACHE/mingw" w_try "$WINE" "$file1" w_append_path 'C:\MinGW\bin' @@ -10599,7 +10646,7 @@ w_metadata mpc apps \ load_mpc() { w_download $WINETRICKS_SOURCEFORGE/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.5_x86/MPC-HC.1.7.5.x86.exe 39f90869929007ae0576ae30dca6cd22ed5a59c2 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" MPC-HC.1.7.5.x86.exe ${W_OPT_UNATTENDED:+ /VERYSILENT} } @@ -10646,7 +10693,7 @@ load_mt4() export WINEDLLOVERRIDES # No documented silent install option, unfortunately.. - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " Run, ${file1} WinWait, MetaTrader 4 Setup, license agreement @@ -10678,8 +10725,8 @@ load_nook() # 7 Oct 2011 sha1sum 3b0301bd55471cc47cced44501547411fac9fcea # 7 Mar 2012 sha1sum e7060a63b9b303ddd820de762d9df254e1c931bc w_download http://images.barnesandnoble.com/PResources/download/eReader2/bndr2_setup_latest.exe e7060a63b9b303ddd820de762d9df254e1c931bc - cd "$W_CACHE/$W_PACKAGE" - "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try_cd "$W_CACHE/$W_PACKAGE" + "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} # normally has exit status 199? } @@ -10696,7 +10743,7 @@ w_metadata npp apps \ load_npp() { w_download https://notepad-plus-plus.org/repository/6.x/6.7.9.2/npp.6.7.9.2.Installer.exe 34574fb2e4e06ff941061bf444b57ce926ce23d7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" "${file1}" $W_UNATTENDED_SLASH_S } @@ -10821,8 +10868,8 @@ w_metadata opera apps \ load_opera() { w_download ftp://ftp.opera.com/pub/opera/win/1150/en/Opera_1150_en_Setup.exe df50c7aed50e92af858e8834f833dd0543014b46 - cd "$W_CACHE"/$W_PACKAGE - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /silent /launchopera 0 /allusers} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /silent /launchopera 0 /allusers} } #---------------------------------------------------------------- @@ -10845,7 +10892,7 @@ load_picasa39() then w_warn "Picasa 3.9 authentication to the Google account is currently broken under wine. See http://bugs.winehq.org/show_bug.cgi?id=29434 for more details." fi - cd "$W_CACHE"/$W_PACKAGE + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run picasa39-setup.exe @@ -10888,7 +10935,7 @@ w_metadata protectionid apps \ load_protectionid() { w_download http://pid.gamecopyworld.com/dl.php?f=ProtectionId.670.halloween.2015.rar a307e15f28d00959cffddd8fda073aac6df943c8 "$file1" - cd "$W_SYSTEM32_DLLS" + w_try_cd "$W_SYSTEM32_DLLS" w_try_unrar "${W_CACHE}/${W_PACKAGE}/${file1}" # ProtectionId.670.halloween.2015 has a different executable name than usual, this may need to be disabled on next update: mv Protection_ID.eXe protection_id.exe @@ -10914,10 +10961,10 @@ load_psdk2003() # Unpack ISO (how handy that 7z can do this!) # Only the windows version of 7z can handle .img files? WINETRICKS_OPT_SHAREDPREFIX=1 w_call 7zip - cd "$W_PROGRAMS_X86_UNIX"/7-Zip + w_try_cd "$W_PROGRAMS_X86_UNIX"/7-Zip w_try "$WINE" 7z.exe x -y -o"$W_TMP_WIN" "$W_CACHE_WIN\\psdk2003\\5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm.img" - cd "$W_TMP/Setup" + w_try_cd "$W_TMP/Setup" # Sanity check... w_verify_sha1sum 6376ab5394226f426366d0646bf244d26156697b PSDK-x86.msi @@ -10944,7 +10991,7 @@ load_psdkwin7() # do an AutoHotKey script until Microsoft gets its act together: # http://social.msdn.microsoft.com/Forums/en-US/windowssdk/thread/c053b616-7d5b-405d-9841-ec465a8e21d5 w_download http://download.microsoft.com/download/7/A/B/7ABD2203-C472-4036-8BA0-E505528CCCB7/winsdk_web.exe a01dcc67a38f461e80ea649edf1353f306582507 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if w_workaround_wine_bug 21596 then w_warn "When given a choice, select only C++ compilers and headers, the other options don't work yet. See http://bugs.winehq.org/show_bug.cgi?id=21596" @@ -10998,7 +11045,7 @@ load_psdkwin71() # don't have a working unattended recipe. Maybe we'll have to # do an AutoHotKey script until Microsoft gets its act together: # http://social.msdn.microsoft.com/Forums/en-US/windowssdk/thread/c053b616-7d5b-405d-9841-ec465a8e21d5 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" winsdk_web.exe if w_workaround_wine_bug 21362 @@ -11057,7 +11104,7 @@ load_python26() w_die "This installer is broken under $WINETRICKS_WINE_VERSION. Please upgrade Wine. See https://code.google.com/p/winetricks/issues/detail?id=347 for more info." fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" msiexec /i python-2.6.2.msi ALLUSERS=1 $W_UNATTENDED_SLASH_Q w_ahk_do " @@ -11095,7 +11142,7 @@ load_spotify() # updates too frequently to check checksum :-( w_download http://www.spotify.com/download/Spotify%20Installer.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # w_download doesn't handle renaming for us without a checksum, tsk. # And AutoHotKey thinks % is a variable reference. if test ! -f SpotifyInstaller.exe @@ -11137,7 +11184,7 @@ load_safari() w_warn "Safari's silent install is broken under Wine. See http://bugs.winehq.org/show_bug.cgi?id=23493. You should do a regular install if you want to use Safari." fi - cd "$W_CACHE"/$W_PACKAGE + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" SafariSetup.exe $W_UNATTENDED_SLASH_QN } @@ -11155,7 +11202,7 @@ load_sketchup() { w_download http://dl.google.com/sketchup/GoogleSketchUpWEN.exe f0628e6f05241f91e4f36d6be3b8685a408ad12b - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run GoogleSketchUpWEN.exe @@ -11204,7 +11251,7 @@ load_steam() # 21 Jun 2015 0e8046d40c38d817338135ec73a5b217cc340cf5 # 29 Dec 2015 728e3c82fd57c68cbbdb64965719081ffee6272c w_download http://media.steampowered.com/client/installer/SteamSetup.exe 728e3c82fd57c68cbbdb64965719081ffee6272c - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # Should be fixed in newer steam versions, since 2012. Commenting out for a while before removing in case users need to revert locally # @@ -11267,7 +11314,7 @@ load_uplay() # 16 Feb 2014 ? sha1sum 19f98632ad1ff330c647f8ff1a3a15b44238c709 # Changes too frequently, don't check anymore w_download http://static3.cdn.ubi.com/orbit/launcher_installer/UplayInstaller.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # NSIS installer w_try "$WINE" UplayInstaller.exe ${W_OPT_UNATTENDED:+ /S} @@ -11325,10 +11372,10 @@ load_utorrent3() # 28 Jun 2013: sha1sum d2408c8a09a2bd9704af39f818ec7ac9e9cca46e w_download http://download-new.utorrent.com/endpoint/utorrent/os/windows/track/stable/ d2408c8a09a2bd9704af39f818ec7ac9e9cca46e uTorrent.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # If you don't use /PERFORMINSTALL, it just runs µTorrent # FIXME: That's no longer a quiet option, though.. - "$WINE" $file1 /PERFORMINSTALL /NORUN + "$WINE" "$file1" /PERFORMINSTALL /NORUN # dang installer exits with status 1 on success status=$? @@ -11360,7 +11407,7 @@ load_vc2005express() # Unpack ISO (how handy that 7z can do this!) w_try_7z "$W_TMP" "$W_CACHE"/vc2005express/VC.iso - cd "$W_TMP" + w_try_cd "$W_TMP" if [ $W_UNATTENDED_SLASH_Q ] then chmod +x Ixpvc.exe @@ -11422,15 +11469,15 @@ load_vc2005trial() # Unpack ISO (how handy that 7z can do this!) # Only the windows version of 7z can handle .img files? WINETRICKS_OPT_SHAREDPREFIX=1 w_call 7zip - cd "$W_PROGRAMS_X86_UNIX"/7-Zip + w_try_cd "$W_PROGRAMS_X86_UNIX"/7-Zip w_try "$WINE" 7z.exe x -y -o"$W_TMP_WIN" "$W_CACHE_WIN\\vc2005trial\\En_vs_2005_vsts_180_Trial.img" - cd "$W_TMP" + w_try_cd "$W_TMP" # Sanity check... w_verify_sha1sum 15433993ab7573c5154dbea2dcb65450f2adbf5c vs/wcu/runmsi.exe - cd vs/Setup + w_try_cd vs/Setup w_ahk_do " SetTitleMatchMode 2 run setup.exe @@ -11475,7 +11522,7 @@ load_vc2008express() w_try_7z "$W_TMP" "$W_CACHE"/vc2008express/VS2008ExpressENUX1397868.iso # See also http://blogs.msdn.com/b/astebner/archive/2008/04/25/8425198.aspx - cd "$W_TMP"/VCExpress + w_try_cd "$W_TMP"/VCExpress w_try "$WINE" setup.exe $W_UNATTENDED_SLASH_Q } @@ -11495,7 +11542,7 @@ load_vc2010express() # Unpack ISO w_try_7z "$W_TMP" "$W_CACHE"/vc2010express/VS2010Express1.iso - cd "$W_TMP"/VCExpress + w_try_cd "$W_TMP"/VCExpress # dotnet40 leaves winver at win2k, which causes vc2010 to abort on # start because it looks for c:\users\$LOGNAME\Application Data @@ -11528,8 +11575,8 @@ w_metadata vlc apps \ load_vlc() { w_download http://get.videolan.org/vlc/2.2.1/win32/vlc-2.2.1-win32.exe 4cbcea9764b6b657d2147645eeb5b973b642530e - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} } #---------------------------------------------------------------- @@ -11549,7 +11596,7 @@ load_winamp() # 2014 winamp5621_full_emusic-7plus_en-us.exe afc172039db52fdc202114bec7bcf8b5bf2468bb w_download http://winampplugins.co.uk/Winamp/winamp5666_full_all_redux.exe 136314be0da42ed399b88a106cb1f43093e2c0c2 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test $W_OPT_UNATTENDED then w_ahk_do " @@ -11611,7 +11658,7 @@ load_wme9() # See also http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24 w_download http://download.microsoft.com/download/8/1/f/81f9402f-efdd-439d-b2a4-089563199d47/WMEncoder.exe 7a3f8781f3e5705651992ef0150ee30bc1295116 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" WMEncoder.exe $W_UNATTENDED_SLASH_Q } @@ -11626,7 +11673,7 @@ load_wm9codecs() # Used by direct calls from load_wmp9, so we have to specify cache directory. # http://birds.camden.rutgers.edu/ w_download_to wm9codecs http://birds.camden.rutgers.edu/WM9Codecs9x.exe 8b76bdcbea0057eb12b7966edab4b942ddacc253 - cd "$W_CACHE/wm9codecs" + w_try_cd "$W_CACHE/wm9codecs" w_set_winver win2k w_try "$WINE" WM9Codecs9x.exe $W_UNATTENDED_SLASH_Q } @@ -11668,7 +11715,7 @@ load_wmp9() # Wine's pidgen is too stubby, crashes, see Wine bug 31111 w_override_app_dlls MPSetup.exe native pidgen - cd "$W_CACHE"/"$W_PACKAGE" + w_try_cd "$W_CACHE"/"$W_PACKAGE" w_try "$WINE" MPSetup.exe $W_UNATTENDED_SLASH_Q load_wm9codecs @@ -11703,7 +11750,7 @@ load_wmp10() w_download http://download.microsoft.com/download/1/2/a/12a31f29-2fa9-4f50-b95d-e45ef7013f87/MP10Setup.exe 69862273a5d9d97b4a2e5a3bd93898d259e86657 # Crashes on exit, but otherwise ok; see http://bugs.winehq.org/show_bug.cgi?id=12633 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" MP10Setup.exe $W_UNATTENDED_SLASH_Q # Disable WMP's services, since they depend on unimplemented stuff, they trigger the GUI debugger several times @@ -11736,7 +11783,7 @@ load_3dmark2000() fi w_try_unzip "$W_TMP/$W_PACKAGE" "$W_CACHE/$W_PACKAGE"/3dmark2000_v11_100308.exe - cd "$W_TMP/$W_PACKAGE" + w_try_cd "$W_TMP/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run Setup.exe @@ -11787,7 +11834,7 @@ load_3dmark2001() w_download http://www.ocinside.de/download/3dmark2001se_330_100308.exe 643bacbcc1615bb4f46d3b045b1b8d78371a6b54 fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -11832,7 +11879,7 @@ load_3dmark03() w_download_manual http://www.futuremark.com/download/3dmark03/ 3DMark03_v360_1901.exe 46a439101ddbbe3c9563b5e9651cb61b46ce0619 fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_warn "Don't use mouse while this installer is running. Sorry..." # This old installer doesn't seem to be scriptable the usual way, so spray and pray. w_ahk_do " @@ -11891,7 +11938,7 @@ load_3dmark05() w_download http://www.ocinside.de/download/3dmark05_v130_1901.exe 8ad6bc2917e22edf5fc95d1fa96cc82515093fb2 fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run 3DMark05_v130_1901.exe WinWait ahk_class #32770, Welcome @@ -11914,11 +11961,9 @@ load_3dmark05() } WinWaitClose, ahk_class #32770, Complete " - ARGS="" if w_workaround_wine_bug 22392 then w_warn "You must run the app with the -nosysteminfo option to avoid a crash on startup" - ARGS="-nosysteminfo" fi } @@ -11936,7 +11981,7 @@ load_3dmark06() { w_download_manual http://www.futuremark.com/support/downloads 3DMark06_v121_installer.exe a125a4b0a5649f848292f38cf424c672d8142058 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run $file1 WinWait ahk_class #32770, Welcome @@ -11969,11 +12014,9 @@ load_3dmark06() w_call d3dx9_36 fi - ARGS="" if w_workaround_wine_bug 22392 then w_warn "You must run the app with the -nosysteminfo option to avoid a crash on startup" - ARGS="-nosysteminfo" fi } @@ -11991,7 +12034,7 @@ load_unigine_heaven() # FIXME: use w_download_torrent() w_download_manual http://unigine.com/download/torrents/Unigine_Heaven-2.1.msi.torrent Unigine_Heaven-2.1.msi 3d7b94a3734cdae85f98032b61668e743979c444 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -12039,7 +12082,7 @@ load_algodoo_demo() { w_download http://www.algodoo.com/download/Algodoo_1_7_1-Win32.exe caa73e73669a8787652a6bed123bbe2682152f12 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " ; This one's funny... on Wine, keyboard works once you click manually, but until then, only ControlClick seems to work. run, Algodoo_1_7_1-Win32.exe @@ -12087,7 +12130,7 @@ load_amnesia_tdd_demo() { w_download_manual "http://www.amnesiagame.com/#demo" amnesia_tdd_demo_1.0.1.exe 0bf0bc6e9c8ea76f1c44582d9302a9b22d31d1b6 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -12132,7 +12175,7 @@ load_aoe3_demo() w_download "http://download.microsoft.com/download/a/5/2/a525997e-8423-435b-b694-08118d235064/aoe3trial.exe" 2b0a123243092d79f910db5691d99d469f7c17c3 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -12161,8 +12204,8 @@ load_aoe3_demo() WinKill,Empires " # or should we just do $WINESERVER -k, like fable_tlc does? - PID=$(ps augxw | grep IDriver | grep -v grep | awk '{print $2}') - kill $PID + # shellcheck disable=SC2046 + kill $(pgrep -f IDriver) fi } @@ -12180,7 +12223,7 @@ load_aoe_demo() { w_download http://download.microsoft.com/download/aoe/Trial/1.0/WIN98/EN-US/MSAoE.exe 23630a65ce4133038107f3175f8fc54a914bc2f3 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run, MSAoE.exe SetTitleMatchMode, 2 @@ -12248,6 +12291,7 @@ load_acreedbro() # FIXME: figure out why these executables don't exit, and do a proper workaround or fix sleep 10 + # shellcheck disable=SC2009 if ps augxw | grep -i exe | egrep 'winemenubuilder.exe|setup.exe|PnkBstrA.exe | egrep -v egrep' then w_warn "Killing processes so patcher does not complain about game still running" @@ -12257,7 +12301,7 @@ load_acreedbro() w_info "Applying patch $W_CACHE/$W_PACKAGE/ac_brotherhood_1.01_ww.exe..." - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -12295,7 +12339,7 @@ w_metadata atmosphir games \ load_atmosphir() { w_download_manual http://download.cnet.com/Atmosphir/3000-7492_4-75335647.html "Atmosphir Installer v1.0.0 fixed.exe" 3ee46b45ea9a8e4a8888148556efb7e61882f7d0 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run Atmosphir Installer v1.0.0 fixed.exe winwait, Atmosphir Setup, Welcome @@ -12349,7 +12393,7 @@ load_avatar_demo() w_call vcrun2005 fi - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_unrar "$W_CACHE/$W_PACKAGE/Avatar_The_Game_Demo.exe" w_ahk_do " SetTitleMatchMode, 2 @@ -12404,7 +12448,7 @@ load_bttf101() { w_download_manual http://www.telltalegames.com/bttf bttf_101_setup.exe 9b15e26d9b4d454f714d6559efe509562df9c10b - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -12445,7 +12489,7 @@ load_bioshock_demo() w_info "Unzipping demo, installer will start in about 30 seconds." w_try unzip "$W_CACHE/$W_PACKAGE/nzd_BioShockPC.zip" -d "$W_TMP/$W_PACKAGE" - cd "$W_TMP/$W_PACKAGE/BioShock PC Demo" + w_try_cd "$W_TMP/$W_PACKAGE/BioShock PC Demo" w_ahk_do " SetTitleMatchMode, 2 @@ -12575,7 +12619,7 @@ load_bfbc2() w_warn "Patching to latest version..." - cd "$W_PROGRAMS_X86_UNIX/Electronic Arts/Battlefield Bad Company 2" + w_try_cd "$W_PROGRAMS_X86_UNIX/Electronic Arts/Battlefield Bad Company 2" w_ahk_do " SetTitleMatchMode, 2 run, BFBC2Updater.exe @@ -12590,7 +12634,7 @@ load_bfbc2() if w_workaround_wine_bug 22762 then # FIXME: does this directory name change in Windows 7? - cd "$W_DRIVE_C/users/$LOGNAME/My Documents" + w_try_cd "$W_DRIVE_C/users/$LOGNAME/My Documents" if test -f BFBC2/settings.ini then mv BFBC2/settings.ini BFBC2/oldsettings.ini @@ -12605,6 +12649,7 @@ load_bfbc2() if w_workaround_wine_bug 22961 then + # shellcheck disable=SC2016 w_warn 'If the game says "No CD/DVD error", try "sudo mount -o remount,unhide,uid=$(uid -u)". See http://bugs.winehq.org/show_bug.cgi?id=22961 for more info.' fi } @@ -12624,7 +12669,7 @@ load_bladekitten_demo() w_download_manual http://news.bigdownload.com/2010/09/23/download-blade-kitten-demo BladeKittenDemoInstall.exe d3568f94c1ce284b7381e457e9497065bd45001d cp "$W_CACHE/$W_PACKAGE"/BladeKittenDemoInstall.exe "$W_TMP" - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " ; This script always gives full window title, so no need to set a different title match mode run BladeKittenDemoInstall.exe @@ -12665,9 +12710,9 @@ w_metadata cnc_tiberian_sun games \ load_cnc_tiberian_sun() { - w_download http://lvlt.bioware.cdn.ea.com/u/f/eagames/cnc3/cnc3tv/Classic/$file1 591aabd639fb9f2d2476a2150f3c00b1162674f5 + w_download http://lvlt.bioware.cdn.ea.com/u/f/eagames/cnc3/cnc3tv/Classic/OfficialCnCTiberianSun.rar 591aabd639fb9f2d2476a2150f3c00b1162674f5 - cd "$W_PROGRAMS_X86_UNIX" + w_try_cd "$W_PROGRAMS_X86_UNIX" # FIXME: we need a progress indicator when unpacking large archives w_info "Unpacking rar file. This will take a minute." w_try_unrar "$W_CACHE/$W_PACKAGE/$file1" @@ -12687,7 +12732,7 @@ load_cnc3_demo() { w_download "http://largedownloads.ea.com/pub/demos/CommandandConquer3/CnC3Demo.exe" f6af21eba2d17eb6d8bb6a131b501b41c3a7eaf7 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, CnC3Demo.exe @@ -12730,10 +12775,10 @@ load_cnc_redalert3_demo() { w_download_manual 'http://www.fileplanet.com/194888/190000/fileinfo/Command-&-Conquer:-Red-Alert-3-Demo' RedAlert3Demo.exe f909b87cc12e386a51be51ede708634348c8af48 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test ! "$W_OPT_UNATTENDED" then - w_try "$WINE" $file1 + w_try "$WINE" "$file1" else w_ahk_do " SetWinDelay 1000 @@ -12794,7 +12839,7 @@ load_cim_demo() # 29 Mar 2011 d40408b59bc0e6e33b564e9bbb55dbab6c44c630, Inno Setup installer #w_download http://www.pcgamestore.com/games/cities-in-motion-nbsp/trial/cim-demo-1-0-8.exe d40408b59bc0e6e33b564e9bbb55dbab6c44c630 w_download_manual http://www.fileplanet.com/218762/210000/fileinfo/Cities-in-Motion-Demo cim-demo-1-0-8.exe d40408b59bc0e6e33b564e9bbb55dbab6c44c630 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" cim-demo-1-0-8.exe ${W_OPT_UNATTENDED:+ /sp- /silent /norestart} } @@ -12812,7 +12857,7 @@ load_cod_demo() { w_download_manual http://www.gamefront.com/files/968870/call_of_duty_demo_exe Call_Of_Duty_Demo.exe 1c480a1e64a80f7f97fd0acd9582fe190c64ad8e - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run Call_Of_Duty_Demo.exe @@ -12851,9 +12896,7 @@ load_cod_demo() if w_workaround_wine_bug 21558 then # Work around a buffer overflow - not really Wine's fault - setvar="@if not defined %__GL_ExtensionStringVersion% then echo \"If you get a buffer overflow error, set __GL_ExtensionStringVersion=17700 before starting Wine. See http://bugs.winehq.org/show_bug.cgi?id=21558.\"" - else - setvar= + w_warn "If you get a buffer overflow error, set __GL_ExtensionStringVersion=17700 before starting Wine. See http://bugs.winehq.org/show_bug.cgi?id=21558." fi } @@ -12877,11 +12920,11 @@ load_cod1() __GL_ExtensionStringVersion=17700 w_ahk_do " SetTitleMatchMode, 2 run ${W_ISO_MOUNT_LETTER}:setup.exe - WinWait, CD Key, enter + WinWait, w_try_cd Key, enter if ( w_opt_unattended > 0 ) { send {Raw}$W_KEY ControlClick Button1 - WinWait, CD Key, valid + WinWait, w_try_cd Key, valid ControlClick Button1 WinWait, Call of Duty, Welcome ControlClick Button1 @@ -12896,7 +12939,7 @@ load_cod1() WinWait, Call of Duty, Start ControlClick Button1 } - WinWait, Insert CD, Please insert the Call of Duty CD 2 + WinWait, Insert CD, Please insert the Call of Duty w_try_cd 2 " "$WINE" eject ${W_ISO_MOUNT_LETTER}: @@ -12907,7 +12950,7 @@ load_cod1() if ( w_opt_unattended > 0 ) { Send {Enter} ;continue installation } - WinWait, Insert CD, Please insert the Call of Duty CD 1 + WinWait, Insert CD, Please insert the Call of Duty w_try_cd 1 " "$WINE" eject ${W_ISO_MOUNT_LETTER}: @@ -12937,9 +12980,7 @@ load_cod1() if w_workaround_wine_bug 21558 then # Work around a buffer overflow - not really Wine's fault - setvar="@if not defined %__GL_ExtensionStringVersion% then echo \"If you get a buffer overflow error, set __GL_ExtensionStringVersion=17700 before starting Wine. See http://bugs.winehq.org/show_bug.cgi?id=21558.\"" - else - setvar= + w_warn "If you get a buffer overflow error, set __GL_ExtensionStringVersion=17700 before starting Wine. See http://bugs.winehq.org/show_bug.cgi?id=21558" fi w_warn "This game is copy-protected, and requires the real disc in a real drive to run." } @@ -12958,7 +12999,7 @@ load_cod4mw_demo() { w_download http://download.cnet.com/Call-of-Duty-4-Modern-Warfare/3000-7441_4-11277584.html CoD4MWDemoSetup_v2.exe 690a5f789a44437ed10784acfdd6418ca4a21886 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, CoD4MWDemoSetup_v2.exe @@ -13073,7 +13114,7 @@ load_cojbib_demo() { w_download_manual http://www.gamefront.com/files/14274183/CoJ2PC-20090713-DEMO-16-buy-now-INSTALLER.exe/ CoJ2PC_20090713_DEMO_16_buy_now_INSTALLER.exe 6426101f6c77bacd57c8449b12a3c76db7f761f0 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode 2 SetWinDelay 500 @@ -13113,7 +13154,7 @@ load_civ4_demo() w_download_manual http://download.cnet.com/Civilization-IV-demo/3000-7489_4-10465206.html Civilization4_Demo.zip b54f1e5d0a1c2d1ef456d0c20098c23bbb6a0ea7 w_try_unzip "$W_TMP" "$W_CACHE/$W_PACKAGE"/Civilization4_Demo.zip - cd "$W_TMP/$W_PACKAGE" + w_try_cd "$W_TMP/$W_PACKAGE" chmod +x setup.exe w_ahk_do " SetTitleMatchMode, 2 @@ -13233,7 +13274,7 @@ load_csi6_demo() { w_download_manual http://www.fileplanet.com/217175/download/CSI:-Fatal-Conspiracy-Demo CSI6_PC_Demo_05.exe 28473b4dc9760b659f24a397192b74d170b593bb - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -13272,7 +13313,7 @@ load_darknesswithin2_demo() { w_download_manual http://www.bigdownload.com/games/darkness-within-2-the-dark-lineage/pc/darkness-within-2-the-dark-lineage-demo DarknessWithin2Demo.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, DarknessWithin2Demo.exe @@ -13531,7 +13572,7 @@ load_deadspace2() # # Work around bug 25963 (fails to switch discs) w_warn "Copying discs to hard drive. This will take a few minutes." - cd "$W_TMP" + w_try_cd "$W_TMP" # Copy takes a LONG time, so offer a way to avoid copy while debugging verb # You'll need to comment out the five "rm -rf"'s, too. if test ! -f easetup.exe @@ -13605,7 +13646,7 @@ load_deadspace2() fi # Activate the game - cd "$W_PROGRAMS_X86/EA Games/Dead Space 2" + w_try_cd "$W_PROGRAMS_X86/EA Games/Dead Space 2" w_ahk_do " run activation.exe if ( w_opt_unattended > 0 ) { @@ -13640,7 +13681,7 @@ load_deusex2_demo() w_download_manual "http://www.techpowerup.com/downloads/1730/Deus_Ex:_Invisible_War_Demo.html" dxiw_demo.zip ccae48fb046d912b3714ea1b4be4294e74bb3092 w_try unzip "$W_CACHE/$W_PACKAGE/dxiw_demo.zip" -d "$W_TMP" - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " SetTitleMatchMode 2 SetWinDelay 500 @@ -13728,7 +13769,7 @@ load_diablo2() ControlClick &Cancel, Diablo II Setup - Video Test winclose, Diablo II Setup" - cd "$W_CACHE"/$W_PACKAGE + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" D2Patch_113c.exe w_ahk_do " winwait, Blizzard Updater v2.72, has completed @@ -13755,8 +13796,8 @@ load_digitanks_demo() # 8 june 2011: f204b13dc64c1a54fb1aaf27187c6083ebb16acf # 11 Nov 2011: e54ffb07232f434bcfaf7b3d43ddf9affa93ef15 w_download "http://static.digitanks.com/files/digitanks.exe" e54ffb07232f434bcfaf7b3d43ddf9affa93ef15 - cd "$W_CACHE/$W_PACKAGE" - w_try "$WINE" $file1 ${W_OPT_UNATTENDED:+ /S} + w_try_cd "$W_CACHE/$W_PACKAGE" + w_try "$WINE" "$file1" ${W_OPT_UNATTENDED:+ /S} if w_workaround_wine_bug 8060 "installing corefonts" then w_call corefonts @@ -13787,10 +13828,10 @@ load_dirt2_demo() w_call d3dx9_36 fi - cd "$W_TMP/$W_PACKAGE" + w_try_cd "$W_TMP/$W_PACKAGE" w_ahk_do " - Run, "Setup.exe" + Run, Setup.exe WinWait, Choose Setup Language, Select if ( w_opt_unattended > 0 ) { sleep 500 @@ -13834,10 +13875,10 @@ w_metadata divinity2_demo games \ load_divinity2_demo() { - w_download_manual "http://www.gamershell.com/download_54304.shtml" $file1 2a33670b705d4da89e1119d808cda64977bb6096 + w_download_manual "http://www.gamershell.com/download_54304.shtml" "$file1" 2a33670b705d4da89e1119d808cda64977bb6096 w_try unzip -d "$W_TMP" "$W_CACHE/$W_PACKAGE/$file1" - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " Run, Divinity2_DEMO_EN_US.exe @@ -13914,7 +13955,7 @@ load_demolition_company_demo() { w_download_manual http://www.demolitioncompany-thegame.com/demo.php DemolitionCompanyDemoENv2.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, DemolitionCompanyDemoENv2.exe @@ -14107,7 +14148,7 @@ load_dragonage2_demo() { w_download http://lvlt.bioware.cdn.ea.com/bioware/u/f/eagames/bioware/dragonage2/demo/DragonAge2Demo_F93M2qCj_EnEsItPlRu.exe a94715cd7943533a3cf1d84d40e667b04e1abc2e - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 500 SetTitleMatchMode, 2 @@ -14148,7 +14189,7 @@ load_eve() # http://www.eveonline.com/download/?fallback=1& w_download http://content.eveonline.com/561078/EVE_Online_Installer_561078.exe 5b5f0cd4fbd42f82b1d1cccb2e22ddeed97d1d3a - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run, $file1 WinWait, EVE Online @@ -14248,24 +14289,24 @@ load_fable_tlc() # Now tell game what the real disc is so user can insert disc 1 and run the game! # FIXME: don't guess it's D: - cat > "$W_TMP"/$W_PACKAGE.reg <<_EOF_ + cat > "$W_TMP/${W_PACKAGE}.reg" <<_EOF_ REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\D3BE9C3CAF4226447B48E06CAACF2DDD\InstallProperties] "InstallSource"="D:\\" _EOF_ - try_regedit "$W_TMP_WIN"\\$W_PACKAGE.reg + try_regedit "$W_TMP_WIN\\${W_PACKAGE}.reg" # Also accept EULA - cat > "$W_TMP"/$W_PACKAGE.reg <<_EOF_ + cat > "$W_TMP/${W_PACKAGE}.reg" <<_EOF_ REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Fable TLC] "FIRSTRUN"=dword:00000001 _EOF_ - try_regedit "$W_TMP_WIN"\\$W_PACKAGE.reg + try_regedit "$W_TMP_WIN\\${W_PACKAGE}.reg" if w_workaround_wine_bug 24912 then @@ -14306,7 +14347,7 @@ load_farmsim2011_demo() # From http://www.landwirtschafts-simulator.de/demo.php w_download_manual http://www.landwirtschafts-simulator.de/demo.php FarmingSimulator2011DemoEN.exe c1221110e55625a3e797a3060c4bf5e3219bf2f0 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 500 SetTitleMatchMode, 2 @@ -14345,7 +14386,7 @@ load_fifa11_demo() w_download "http://static.cdn.ea.com/fifa/u/f/fifa11_pc_demo_NA.zip" c3a66284bffb985f31b11e477dade50c0d4cac52 w_try unzip -d "$W_TMP" "$W_CACHE/$W_PACKAGE/fifa11_pc_demo_NA.zip" - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " SetTitleMatchMode, 2 @@ -14405,7 +14446,7 @@ load_hon() { w_download http://dl.heroesofnewerth.com/HoNClient-3.1.2.exe 49123d092f1fa75b8dddc20c817ab8addd5aee5f - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, $file1 @@ -14443,7 +14484,7 @@ load_hordesoforcs2_demo() { w_download_manual http://www.fileplanet.com/216619/download/Hordes-of-Orcs-2-Demo HoO2Demo.exe 1ba26d35697e359f89a30915140e471fadc675da - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -14496,12 +14537,12 @@ load_mfsxde() if w_workaround_wine_bug 25558 "Copying disc to hard drive. This will take a few minutes." then - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # Copy takes a LONG time, so offer a way to avoid copy while debugging verb if test ! -f bothdiscs/setup.exe then mkdir bothdiscs - cd bothdiscs + w_try_cd bothdiscs w_try cp -R "$W_ISO_MOUNT_ROOT"/* . # A few files are on both DVDs. Remove them manually so cp doesn't complain. @@ -14522,7 +14563,7 @@ load_mfsxde() # If you mount it without extracting though, the install fails. # Apparently it uses the files from the cache, but does a disk check. else - cd bothdiscs + w_try_cd bothdiscs fi else w_die "non-broken case not yet supported for this game" @@ -14572,7 +14613,7 @@ load_mfsx_demo() fi w_download http://download.microsoft.com/download/4/7/7/477dcc35-0b98-42c5-b06f-7ded38a40491/FSXDemo.exe cbb13d2a7918f409f224eab7d3a2014330fc87bc - cd "$W_TMP" + w_try_cd "$W_TMP" unzip "$W_CACHE/$W_PACKAGE"/FSXDemo.exe w_ahk_do " SetWinDelay 1000 @@ -14613,7 +14654,7 @@ load_gothic4_demo() { w_download_manual http://www.gamershell.com/download_63874.shtml ArcaniA_Gothic4_Demo_Setup.zip d36024c0235878c4589234a56cc8b6e05da5c593 - cd "$W_TMP" + w_try_cd "$W_TMP" w_try unzip "$W_CACHE/$W_PACKAGE"/ArcaniA_Gothic4_Demo_Setup.zip w_ahk_do " @@ -14751,7 +14792,7 @@ load_guildwars() { w_download "http://guildwars.com/download/" a7c4c8cb3b8cbee20707dcf8176d3da6a1686c05 GwSetup.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " Run, GwSetup.exe WinWait, ahk_class ArenaNet_Dialog_Class @@ -14791,7 +14832,7 @@ load_hegemonygold_demo() w_download "http://www.longbowgames.com/downloads/Hegemony%20Gold%20Installer.exe" 36634314f571e345d082bdefe1150c76ef5610a7 HegemonyGoldInstaller.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 500 @@ -14838,7 +14879,7 @@ load_hegemony_demo() # Feb 16 2011: 38e92e3e4d0f0d10393790bc37350a2094f60c37 w_download "http://www.longbowgames.com/downloads/Hegemony%20Philip%20of%20Macedon%20Installer.exe" 38e92e3e4d0f0d10393790bc37350a2094f60c37 Hegemony_Philip_of_Macedon_Installer.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -14901,7 +14942,7 @@ load_hphbp_demo() w_download http://largedownloads.ea.com/pub/demos/HarryPotter/Release_HBP_demo_PC_DD_DEMO_Final_348428.exe dadc1366c3b5e641454aa337ad82bc8c5082bad2 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, Release_HBP_demo_PC_DD_DEMO_FINAL_348428.exe @@ -14927,7 +14968,7 @@ load_hphbp_demo() # Work around locale issues by symlinking the app's directory to not have a funny char # Won't really work on Cygwin, but that's ok. - cd "$W_PROGRAMS_X86_UNIX/Electronic Arts" + w_try_cd "$W_PROGRAMS_X86_UNIX/Electronic Arts" ln -s "Harry Potter and the Half-Blood Prince"* "Harry Potter and the Half-Blood Prince Demo" } @@ -14945,7 +14986,7 @@ load_imvu() { w_download http://static-akm.imvu.com/imvufiles/installers/InstallIMVU_465.0_st_c.exe 3a5c6c335227a5709c5772f91d8407edd07d4012 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -15063,15 +15104,16 @@ load_losthorizon_demo() { w_download_manual http://www.fileplanet.com/215704/download/Lost-Horizon-Demo Lost_Horizon_Demo_EN.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run Lost_Horizon_Demo_EN.exe WinWait,Lost Horizon Demo, Destination + # shellcheck disable=SC2086 if ( w_opt_unattended > 0 ) { Sleep 500 - Send {RAW}"$W_TMP" + Send {RAW}${W_TMP} ControlClick Button2 ;Install WinWaitClose,Lost Horizon Demo,Installation Sleep 1000 @@ -15120,7 +15162,7 @@ w_metadata lego_potc_demo games \ load_lego_potc_demo() { w_download_manual http://www.gamershell.com/download_73976.shtml LPOTC_PC_Demo.zip 3025dcbbee9ff2d74d7837a78ef5b7aceae15d8f - cd "$W_TMP" + w_try_cd "$W_TMP" w_info "Unpacking $file1" w_try_unzip . "$W_CACHE/$W_PACKAGE/$file1" LPOTC_PC_Demo.exe w_ahk_do " @@ -15188,7 +15230,7 @@ load_lhp_demo() w_download "http://static.kidswb.com/legoharrypottergame/LEGOHarryPotterDEMO.exe" bb0a30ad9a7cc51c80e1bb1f3eec22e6ccc1a706 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, LEGOHarryPotterDEMO.exe @@ -15210,7 +15252,7 @@ load_lhp_demo() # Work around locale issues by symlinking the app's directory to not have a funny char # Won't really work on Cygwin, but that's ok. - cd "$W_PROGRAMS_X86_UNIX/WB Games" + w_try_cd "$W_PROGRAMS_X86_UNIX/WB Games" ln -s LEGO*Harry\ Potter*DEMO LEGO_Harry_Potter_DEMO } @@ -15439,7 +15481,7 @@ load_masseffect2_demo() *) ln -sf "$W_CACHE/$W_PACKAGE/MassEffect2DemoEN.exe" "$W_TMP" ;; esac - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " SetWinDelay 1000 SetTitleMatchMode, 2 @@ -15490,9 +15532,9 @@ load_maxmagicmarker_demo() { w_download http://www.maxandthemagicmarker.com/maxdemo/max_demo_pc.zip 1a79c583ff40e7b2cf05d18a89a806fd6b88a5d1 - w_try_unzip "$W_PROGRAMS_X86_UNIX"/$W_PACKAGE "$W_CACHE/$W_PACKAGE"/max_demo_pc.zip + w_try_unzip "$W_PROGRAMS_X86_UNIX/$W_PACKAGE" "$W_CACHE/$W_PACKAGE"/max_demo_pc.zip # Work around bug in game?! - cd "$W_PROGRAMS_X86_UNIX/$W_PACKAGE" + w_try_cd "$W_PROGRAMS_X86_UNIX/$W_PACKAGE" mv "max and the magic markerdemo pc" "max and the magic markerdemo pc"_Data } @@ -15514,7 +15556,7 @@ load_mdk() w_download http://www.falconfly.de/downloads/patch-mdk3dfx.zip edcff0160c62d23b00c55c0bdfa38a6e90d925b0 w_mount MDK - cd "$W_ISO_MOUNT_ROOT" + w_try_cd "$W_ISO_MOUNT_ROOT" w_ahk_do " SetTitleMatchMode, 2 SetTitleMatchMode, slow @@ -15554,7 +15596,7 @@ load_mdk() } WinWaitClose " - cd "$W_DRIVE_C/SHINY/MDK" + w_try_cd "$W_DRIVE_C/SHINY/MDK" w_try_unzip . "$W_CACHE/$W_PACKAGE"/patch-mdk3dfx.zip # TODO: Wine fails to install menu items, add a workaround for that @@ -15574,7 +15616,7 @@ load_menofwar() { w_mount "Men of War" - cd "$W_ISO_MOUNT_ROOT" + w_try_cd "$W_ISO_MOUNT_ROOT" w_ahk_do " SetTitleMatchMode, 2 SetTitleMatchMode, slow @@ -15616,7 +15658,7 @@ load_mise() w_download_manual "http://www.direct2drive.com/8241/product/Buy-The-Secret-of-Monkey-Island(R):-Special-Edition-Download" SecretOfMonkeyIslandSE_ddsetup.zip 2e32458698c9ec7ebce94ae5c57531a3fe1dbb9e mkdir -p "$W_TMP/$W_PACKAGE" - cd "$W_TMP/$W_PACKAGE" + w_try_cd "$W_TMP/$W_PACKAGE" # Don't extract DirectX/dotnet35 installers, they just take up extra time and aren't needed. Luckily, MISE copes well and just skips them if they are missing: w_try unzip "$W_CACHE/$W_PACKAGE"/SecretOfMonkeyIslandSE_ddsetup.zip -x DirectX* dotnet* @@ -15643,9 +15685,9 @@ load_mise() " # FIXME: This app has two different keys - you can use either one. How do we handle that with w_read_key? - if test -f "$W_CACHE"/$W_PACKAGE/activationcode.txt + if test -f "$W_CACHE/$W_PACKAGE/activationcode.txt" then - MISE_KEY=$(cat "$W_CACHE"/$W_PACKAGE/activationcode.txt) + MISE_KEY=$(cat "$W_CACHE/$W_PACKAGE/activationcode.txt") w_ahk_do " SetTitleMatchMode, 2 run, $W_PROGRAMS_X86_WIN\\LucasArts\\The Secret of Monkey Island Special Edition\\MISE.exe @@ -15658,9 +15700,9 @@ load_mise() sleep 1000 Process, Close, MISE.exe " - elif test -f "$W_CACHE"/$W_PACKAGE/unlockcode.txt + elif test -f "$W_CACHE/$W_PACKAGE/unlockcode.txt" then - MISE_KEY=$(cat "$W_CACHE"/$W_PACKAGE/unlockcode.txt) + MISE_KEY=$(cat "$W_CACHE/$W_PACKAGE/unlockcode.txt") w_ahk_do " SetTitleMatchMode, 2 run, $W_PROGRAMS_X86_WIN\\LucasArts\\The Secret of Monkey Island Special Edition\\MISE.exe @@ -15693,7 +15735,7 @@ load_myth2_demo() # 1 May 2011 1.7.2 sha1sum e0a8f707377e71314a471a09ad2a55179ea44588 w_download http://tain.totalcodex.net/items/download/myth-ii-demo-windows e0a8f707377e71314a471a09ad2a55179ea44588 Myth2_Demo_172.exe - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -15734,7 +15776,7 @@ load_nfsshift_demo() w_try cp "$W_CACHE/$W_PACKAGE/$file1" "$W_TMP" - cd "$W_TMP" + w_try_cd "$W_TMP" w_ahk_do " SetTitleMatchMode, 2 SetTitleMatchMode, slow @@ -15799,7 +15841,7 @@ w_metadata njcwp_trial apps \ load_njcwp_trial() { w_download http://www.njstar.com/download/njcwp.exe 006da155bad1ac4a73b953c98cb821eb7fd96507 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test "$W_OPT_UNATTENDED" then w_ahk_do " @@ -15817,7 +15859,7 @@ load_njcwp_trial() WinWaitClose " else - w_try "$WINE" $file1 + w_try "$WINE" "$file1" fi } @@ -15835,7 +15877,7 @@ w_metadata njjwp_trial apps \ load_njjwp_trial() { w_download http://www.njstar.com/download/njjwp.exe 363d22e4ca7b79d0290a8ccdb0fa99169971d418 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test "$W_OPT_UNATTENDED" then w_ahk_do " @@ -15853,7 +15895,7 @@ load_njjwp_trial() WinWaitClose " else - w_try "$WINE" $file1 + w_try "$WINE" "$file1" fi } @@ -15871,7 +15913,7 @@ load_oblivion() { w_mount "Oblivion" - cd "$W_ISO_MOUNT_ROOT" + w_try_cd "$W_ISO_MOUNT_ROOT" w_ahk_do " SetTitleMatchMode, 2 run, Setup.exe @@ -15922,7 +15964,7 @@ load_penpenxmas() W_BROWSERAGENT=1 \ w_download http://retrospec.sgn.net/download/files/PenPenXmasOlympics100.exe 36ec83cffa0ad3cc19dea33193b54bdaaea6db5b - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" "$WINE" PenPenXmasOlympics100.exe $W_UNATTENDED_SLASH_S } @@ -15940,7 +15982,7 @@ load_plantsvszombies() { w_download "http://downloads.popcap.com/www/popcap_downloads/PlantsVsZombiesSetup.exe" c46979be135ef1c486144fa062466cdc51b740f5 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run PlantsVsZombiesSetup.exe winwait, Plants vs. Zombies Installer @@ -16045,15 +16087,16 @@ load_qq() if w_workaround_wine_bug 38171 "Installing desktop file to work around bug" then - cd "$W_TMP/" + w_try_cd "$W_TMP/" tar -zxf "$W_CACHE/qq/QQ.tar.gz" - mkdir -p $HOME/.local/share/applications/wine/Programs/腾讯软件/QQ - mkdir -p $HOME/.local/share/icons/hicolor/48x48/apps - mkdir -p $HOME/.local/share/icons/hicolor/256x256/apps + mkdir -p "$HOME/.local/share/applications/wine/Programs/腾讯软件/QQ" + mkdir -p "$HOME/.local/share/icons/hicolor/48x48/apps" + mkdir -p "$HOME/.local/share/icons/hicolor/256x256/apps" w_try mv QQ/腾讯QQ.desktop ~/.local/share/applications/wine/Programs/腾讯软件/QQ w_try mv QQ/48x48/QQ.png ~/.local/share/icons/hicolor/48x48/apps w_try mv QQ/256x256/QQ.png ~/.local/share/icons/hicolor/256x256/apps - echo Exec=env WINEPREFIX="$WINEPREFIX" "$WINE" $W_PROGRAMS_X86_WIN\/Tencent\/QQ\/bin\/QQScLauncher.exe >> $HOME/.local/share/applications/wine/Programs/腾讯软件/QQ/腾讯QQ.desktop + # shellcheck disable=SC1001 + echo Exec=env WINEPREFIX="$WINEPREFIX" "$WINE" "$W_PROGRAMS_X86_WIN"\/Tencent\/QQ\/bin\/QQScLauncher.exe >> "$HOME/.local/share/applications/wine/Programs/腾讯软件/QQ/腾讯QQ.desktop" fi if w_workaround_wine_bug 39657 "Disable ntoskrnl.exe to work around can't be started bug" @@ -16066,7 +16109,7 @@ load_qq() w_override_dlls disabled txplatform.exe fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" "$file1" } @@ -16107,7 +16150,7 @@ load_qqintl() # wants mfc80u.dll w_call vcrun2005 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_try "$WINE" "$file1" } @@ -16132,7 +16175,7 @@ load_ragnarok() # BDA295E3A2A57CD02BD122ED7BF4836AC012369A w_download_manual http://www.playragnarok.com/downloads/clientdownload.aspx iRO-13.2.2-FullInstall-20110421-1717.msi bda295e3a2a57cd02bd122ed7bf4836ac012369a - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " Run, msiexec /i $file1 @@ -16225,7 +16268,7 @@ load_rayman2_demo() { w_download "ftp://ftp.ubisoft.com/Rayman2/rayman2high.zip" 14b2ad6f41e2e1358f3a4a5167d67a7111ea4fb5 - cd "$W_TMP" + w_try_cd "$W_TMP" w_try unzip "$W_CACHE/$W_PACKAGE/rayman2high.zip" w_ahk_do " @@ -16282,7 +16325,7 @@ load_riseofnations_demo() { w_download_manual http://download.cnet.com/Rise-of-Nations-Trial-Version/3000-7562_4-10730812.html RiseOfNationsTrial.exe 33cbf1ebc0a93cb840f6296d8b529f6155db95ee - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -16318,7 +16361,7 @@ load_secondlife() { w_download http://download.cloud.secondlife.com/Viewer-3/Second_Life_3-2-8-248931_Setup.exe e08c16edc4d2fb68bb6275bed11a259a74918da5 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -16391,7 +16434,7 @@ load_sims3() # FIXME: download appropriate one rather than just US version. w_download http://akamai.cdn.ea.com/eadownloads/u/f/sims/sims3/patches/TS3_1.19.44.010001_Update.exe 7d21a81aaea70bf102267456df4629ce68be0cc8 - cd "$W_CACHE"/$W_PACKAGE + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " run TS3_1.19.44.010001_Update.exe SetTitleMatchMode, 2 @@ -16483,7 +16526,7 @@ load_simsmed() # FIXME: download appropriate one rather than just US version. w_download http://akamai.cdn.ea.com/eadownloads/u/f/sims/sims/patches/TheSimsMedievalPatch_1.1.10.00001_Update.exe 7214ced8af7315741e05024faeacf9053b999b1b - cd "$W_CACHE"/$W_PACKAGE + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -16596,7 +16639,7 @@ load_splitsecond() w_mount SplitSecond # Aborts with dialog about FirewallInstallHelper.dll if that's not on the path (e.g. in current dir) - cd "$W_ISO_MOUNT_ROOT" + w_try_cd "$W_ISO_MOUNT_ROOT" w_ahk_do " SetTitleMatchMode, 2 run setup.exe @@ -16652,7 +16695,7 @@ load_splitsecond_demo() w_warn "On Wine, install takes an extra 7 minutes at the end, please be patient." fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 run, SplitSecondDemo_FilePlanet.exe @@ -16757,7 +16800,7 @@ load_spore_cc_demo() w_info "The installer runs on for about a minute after it's done." - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" if test "$W_OPT_UNATTENDED" then w_ahk_do " @@ -16782,7 +16825,7 @@ load_spore_cc_demo() send {SPACE}{DOWN}{SPACE}{ENTER} winwaitclose " - while ps | grep $file1 | grep -v grep > /dev/null + while pgrep -f "$file1" > /dev/null do w_info "Waiting for installer to finish." sleep 2 @@ -16806,7 +16849,7 @@ load_starcraft2_demo() { w_download_manual http://www.fileplanet.com/217982/210000/fileinfo/Starcraft-2-Demo SC2-WingsOfLiberty-enUS-Demo-Installer.zip 4c06ad755fbde73f135a7359bf6bfdbd2c6eb00e - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_unzip . "$W_CACHE/$W_PACKAGE"/SC2-WingsOfLiberty-enUS-Demo-Installer.zip w_ahk_do " @@ -16873,7 +16916,7 @@ load_theundergarden_demo() { w_download_manual http://www.bigdownload.com/games/the-undergarden/pc/the-undergarden-demo TheUnderGarden_PC_B34_SRTB.30_28OCT10.exe acf90c422ac2f2f242100f39bedfe7df0c95f7a - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -16953,7 +16996,7 @@ load_tmnationsforever() # 29 Mar 2011: 23388798d5c90ad4a233b4cd7e9fcafd69756978 w_download "http://files.trackmaniaforever.com/tmnationsforever_setup.exe" 23388798d5c90ad4a233b4cd7e9fcafd69756978 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -17012,7 +17055,7 @@ load_trainztcc_2004() w_read_key # yup, they got the volume name wrong w_mount TRS2006DVD - cd ${W_ISO_MOUNT_ROOT}/TRS2004_SP4_DVD_Installer_BUILD_2370/Installer/Disk1 + w_try_cd ${W_ISO_MOUNT_ROOT}/TRS2004_SP4_DVD_Installer_BUILD_2370/Installer/Disk1 w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -17043,7 +17086,7 @@ load_trainztcc_2004() " # And, while we're at it, also install the accompanying paint shed app - cd ${W_ISO_MOUNT_ROOT}/TRAINZ_PAINTSHED + w_try_cd ${W_ISO_MOUNT_ROOT}/TRAINZ_PAINTSHED w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -17081,7 +17124,7 @@ load_sammax301_demo() { w_download_manual "http://www.fileplanet.com/211314/210000/fileinfo/Sam-&-Max:-Devil's-Playhouse---Episode-One-Demo" SamMax301_PC_Setup.exe 83f47b7f3a5074a6e29bdc9b4f1fd2c4471d9641 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 SetWinDelay 500 @@ -17119,7 +17162,7 @@ load_sammax304_demo() { w_download_manual "http://www.fileplanet.com/214770/210000/fileinfo/Sam-&-Max:-The-Devi's-Playhouse---Beyond-the-Alley-of-the-Dolls-Demo" SamMax304_PC_setup.exe 1a385a1f1e83770c973e6457b923b7a44bbe44d8 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 Run, $file1 @@ -17154,7 +17197,7 @@ load_tropico3_demo() { w_download_manual "http://www.tropico3.com/?p=downloads" Tropico3Demo.exe e031749db346ac3a87a675787c81eb1ca8cb5909 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 1000 @@ -17241,7 +17284,7 @@ load_singularity() " # Clean up crap left over in c:\ when the installer runs the vc 2008 redistributable installer - cd "$W_DRIVE_C" + w_try_cd "$W_DRIVE_C" rm -f VC_RED.* eula.*.txt globdata.ini install.exe install.ini install.res.*.dll vcredist.bmp } @@ -17279,7 +17322,7 @@ load_stalker_pripyat_bench() w_download_manual http://www.bigdownload.com/games/stalker-call-of-pripyat/pc/stalker-call-of-pripyat-benchmark stkcop-bench-setup.exe 8691c3f289ecd0521bed60ffd46e65ad080206e0 #w_download http://files.gsc-game.com/st/bench/stkcop-bench-setup.exe 8691c3f289ecd0521bed60ffd46e65ad080206e0 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" # FIXME: a bit fragile, if you're browsing the web while installing, it sometimes gets stuck. w_ahk_do " @@ -17422,7 +17465,7 @@ load_twfc() " # Clean up crap left over in c:\ when the installer runs the vc 2008 redistributable installer - cd "$W_DRIVE_C" + w_try_cd "$W_DRIVE_C" rm -f VC_RED.* eula.*.txt globdata.ini install.exe install.ini install.res.*.dll vcredist.bmp } @@ -17439,7 +17482,7 @@ w_metadata typingofthedead_demo games \ load_typingofthedead_demo() { w_download "http://www.fileplanet.com/54947/50000/fileinfo/The-Typing-of-the-Dead-Demo" 96fe3edb2431210932af840e29c59bce6b7fc80f - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_unzip . "$W_CACHE/$W_PACKAGE/tod-demo.zip" w_ahk_do " SetTitleMatchMode, 2 @@ -17502,7 +17545,7 @@ load_ut3() WinWaitClose " - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetTitleMatchMode, 2 @@ -17539,14 +17582,14 @@ load_wog() then # Get temporary download location w_download "http://www.worldofgoo.com/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe" - URL=$(cat "$W_CACHE/wog/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe" | \ - grep WorldOfGooDemo.1.0.exe | sed 's,.*http,http,;s,".*,,') + URL=$(grep WorldOfGooDemo.1.0.exe "$W_CACHE/wog/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe" \ + | sed 's,.*http,http,;s,".*,,') w_try rm "$W_CACHE/wog/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe" w_download "$URL" e61d8253b9fe0663cb3c69018bb3d2ec6152d488 fi - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " SetWinDelay 500 run WorldOfGooDemo.1.0.exe @@ -17581,7 +17624,7 @@ load_zootycoon2_demo() { w_download "http://download.microsoft.com/download/9/f/6/9f6a95f0-f34a-4312-9749-77b81d3de245/Zoo2Trial.exe" 60ad1bb34351f97b579c58234b926055f7979126 - cd "$W_CACHE/$W_PACKAGE" + w_try_cd "$W_CACHE/$W_PACKAGE" w_ahk_do " ; Uses winwaitactive, because the windows appear and immediately after another window ; gets in the way, then disappears after a second or so @@ -17869,7 +17912,7 @@ w_metadata glsl=disabled settings \ load_glsl() { - winetricks_set_wined3d_var UseGLSL $1 + winetricks_set_wined3d_var UseGLSL "$1" } #---------------------------------------------------------------- @@ -17883,7 +17926,7 @@ w_metadata multisampling=disabled settings \ load_multisampling() { - winetricks_set_wined3d_var Multisampling $1 + winetricks_set_wined3d_var Multisampling "$1" } #---------------------------------------------------------------- @@ -17894,7 +17937,7 @@ w_metadata npm=repack settings \ load_npm() { - winetricks_set_wined3d_var NonPower2Mode $1 + winetricks_set_wined3d_var NonPower2Mode "$1" } #---------------------------------------------------------------- @@ -17908,7 +17951,7 @@ w_metadata orm=backbuffer settings \ load_orm() { - winetricks_set_wined3d_var OffscreenRenderingMode $1 + winetricks_set_wined3d_var OffscreenRenderingMode "$1" } #---------------------------------------------------------------- @@ -17922,7 +17965,7 @@ w_metadata strictdrawordering=disabled settings \ load_strictdrawordering() { - winetricks_set_wined3d_var StrictDrawOrdering $1 + winetricks_set_wined3d_var StrictDrawOrdering "$1" } #---------------------------------------------------------------- @@ -17948,7 +17991,7 @@ w_metadata rtlm=textex settings \ load_rtlm() { - winetricks_set_wined3d_var RenderTargetLockMode $1 + winetricks_set_wined3d_var RenderTargetLockMode "$1" } #---------------------------------------------------------------- @@ -17963,7 +18006,7 @@ w_metadata ao=disabled settings \ load_ao() { - winetricks_set_wined3d_var AlwaysOffscreen $1 + winetricks_set_wined3d_var AlwaysOffscreen "$1" } #---------------------------------------------------------------- @@ -17978,7 +18021,7 @@ w_metadata ddr=opengl settings \ load_ddr() { - winetricks_set_wined3d_var DirectDrawRenderer $1 + winetricks_set_wined3d_var DirectDrawRenderer "$1" } #---------------------------------------------------------------- @@ -17999,7 +18042,7 @@ load_mwo() # Filter out/correct bad or partial values # Confusing because dinput uses 'disable', but d3d uses 'disabled' # see alloc_device() in dlls/dinput/mouse.c - case $1 in + case "$1" in enable*) arg=enabled;; disable*) arg=disable;; force) arg=force;; @@ -18052,7 +18095,7 @@ w_metadata grabfullscreen=n settings \ load_grabfullscreen() { - case $1 in + case "$1" in y|n) arg=$1;; *) w_die "illegal value $1 for GrabFullscreen";; esac @@ -18077,7 +18120,7 @@ w_metadata windowmanagerdecorated=n settings \ load_windowmanagerdecorated() { - case $1 in + case "$1" in y|n) arg=$1;; *) w_die "illegal value $1 for Decorated";; esac @@ -18102,7 +18145,7 @@ w_metadata windowmanagermanaged=n settings \ load_windowmanagermanaged() { - case $1 in + case "$1" in y|n) arg=$1;; *) w_die "illegal value $1 for Managed";; esac @@ -18132,7 +18175,7 @@ w_metadata alldlls=builtin settings \ load_alldlls() { - case $1 in + case "$1" in default) w_override_no_dlls ;; builtin) w_override_all_dlls ;; esac @@ -18153,7 +18196,7 @@ w_metadata fontsmooth=gray settings \ load_fontsmooth() { - case $1 in + case "$1" in disable) FontSmoothing=0; FontSmoothingOrientation=1; FontSmoothingType=0;; gray|grey) FontSmoothing=2; FontSmoothingOrientation=1; FontSmoothingType=1;; bgr) FontSmoothing=2; FontSmoothingOrientation=0; FontSmoothingType=2;; @@ -18201,7 +18244,7 @@ w_metadata gsm=3 settings \ load_gsm() { - winetricks_set_wined3d_var MaxShaderModelGS $1 + winetricks_set_wined3d_var MaxShaderModelGS "$1" } #---------------------------------------------------------------- @@ -18319,7 +18362,7 @@ REGEDIT4 "ShowCrashDialog"=dword:00000000 _EOF_ - cd "$W_TMP" + w_try_cd "$W_TMP" w_try_regedit crashdialog.reg } @@ -18347,7 +18390,7 @@ w_metadata psm=3 settings \ load_psm() { - winetricks_set_wined3d_var MaxShaderModelPS $1 + winetricks_set_wined3d_var MaxShaderModelPS "$1" } #---------------------------------------------------------------- @@ -18364,7 +18407,7 @@ load_sandbox() rm -f "$WINEPREFIX/dosdevices/z:" _olddir="$(pwd)" - cd "$WINEPREFIX/drive_c/users/$USER" + w_try_cd "$WINEPREFIX/drive_c/users/$USER" for x in * do if test -h "$x" && test -d "$x" @@ -18373,7 +18416,7 @@ load_sandbox() mkdir -p "$x" fi done - cd "$_olddir" + w_try_cd "$_olddir" unset _olddir # Disable unixfs @@ -18439,7 +18482,7 @@ w_metadata vd=1440x900 settings \ load_vd() { - size=$1 + size="$1" case $size in off|disabled) cat > "$W_TMP"/vd.reg <<_EOF_ @@ -18487,7 +18530,7 @@ w_metadata videomemorysize=2048 settings \ load_videomemorysize() { - size=$1 + size="$1" echo "Setting video memory size to $size" case $size in @@ -18537,7 +18580,7 @@ w_metadata vsm=3 settings \ load_vsm() { - winetricks_set_wined3d_var MaxShaderModelVS $1 + winetricks_set_wined3d_var MaxShaderModelVS "$1" } #---------------------------------------------------------------- @@ -18971,11 +19014,11 @@ winetricks_stats_report() esac test -f "$WINETRICKS_WORKDIR"/breadcrumbs || return - WINETRICKS_STATS_BREADCRUMBS=$(cat "$WINETRICKS_WORKDIR"/breadcrumbs | tr '\012' ' ') + WINETRICKS_STATS_BREADCRUMBS=$(tr '\012' ' ' < "$WINETRICKS_WORKDIR"/breadcrumbs) echo "You opted in, so reporting '$WINETRICKS_STATS_BREADCRUMBS' to the winetricks maintainer so he knows which winetricks verbs get used and which don't. Use --optout to disable future reports." report="os=$(winetricks_os_description)&winetricks=$WINETRICKS_VERSION&breadcrumbs=$WINETRICKS_STATS_BREADCRUMBS" - report="$(echo $report | sed 's/ /%20/g')" + report="$(echo "$report" | sed 's/ /%20/g')" # Just do a HEAD request with the raw command line. # Yes, this can be fooled by caches. That's ok. if [ -x "$(which wget 2>/dev/null)" ] @@ -19009,7 +19052,7 @@ winetricks_stats_log_command() winetricks_shell() { ( - cd "$W_DRIVE_C" + w_try_cd "$W_DRIVE_C" export WINE case $WINETRICKS_GUI in @@ -19019,7 +19062,7 @@ winetricks_shell() *) for term in gnome-terminal konsole Terminal xterm do - if test $(which $term) 2> /dev/null + if test "$(which $term 2>/dev/null)" then $term break @@ -19034,7 +19077,7 @@ winetricks_shell() execute_command() { case "$1" in - *=*) arg=$(echo $1 | sed 's/.*=//'); cmd=$(echo $1 | sed 's/=.*//');; + *=*) arg=$(echo "$1" | sed 's/.*=//'); cmd=$(echo "$1" | sed 's/=.*//');; *) cmd="$1"; arg="" ;; esac @@ -19042,12 +19085,12 @@ execute_command() # FIXME: avoid duplicated code apps|benchmarks|dlls|fonts|games|prefix|settings) - WINETRICKS_CURMENU=$1 + WINETRICKS_CURMENU="$1" ;; # Late options -*) - if ! winetricks_handle_option $1 + if ! winetricks_handle_option "$1" then winetricks_usage exit 1 @@ -19095,12 +19138,12 @@ execute_command() strictdrawordering=disable*) w_call strictdrawordering=disabled ;; # Use winecfg if you want a GUI for plain old DLL overrides - alldlls=*) w_call $1 ;; - *=native) w_do_call native $cmd;; - *=builtin) w_do_call builtin $cmd;; - *=default) w_do_call default $cmd;; - *=disabled) w_do_call disabled $cmd;; - vd=*) w_do_call $cmd;; + alldlls=*) w_call "$1" ;; + *=native) w_do_call native "$cmd";; + *=builtin) w_do_call builtin "$cmd";; + *=default) w_do_call default "$cmd";; + *=disabled) w_do_call disabled "$cmd";; + vd=*) w_do_call "$cmd";; # Hacks for backwards compatibility cc580) w_call comctl32 ;; @@ -19128,11 +19171,11 @@ execute_command() # Normal verbs, with metadata and load_ functions *) - if winetricks_metadata_exists $1 + if winetricks_metadata_exists "$1" then w_call "$1" else - echo Unknown arg $1 + echo "Unknown arg $1" winetricks_usage exit 1 fi @@ -19164,7 +19207,7 @@ then # or # winetricks volnameof=foo.iso # This will read the volname from the given image and put it to stdout. - winetricks_volname ${1#volnameof=} + winetricks_volname "${1#volnameof=}" ;; "") if test x"$DISPLAY" = x"" @@ -19244,6 +19287,7 @@ then case $verb in *.verb) # Load the verb file + # shellcheck disable=SC1090 case $verb in */*) . $verb ;; *) . ./$verb ;; diff --git a/winetricks.1 b/winetricks.1 index e633b2e..e3d893c 100644 --- a/winetricks.1 +++ b/winetricks.1 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH WINETRICKS 1 "July 2016" "Winetricks 20160724" "Wine Package Manager" +.TH WINETRICKS 1 "October 2016" "Winetricks 20161012" "Wine Package Manager" .SH NAME winetricks \- manage virtual Windows environments using Wine .SH SYNOPSIS