| 1 | #!/usr/bin/env bash
|
| 2 | #
|
| 3 | # Testing batch files
|
| 4 |
|
| 5 | set -o nounset
|
| 6 | set -o pipefail
|
| 7 | set -o errexit
|
| 8 |
|
| 9 | # several hundred megs
|
| 10 |
|
| 11 | # weird error:
|
| 12 | # it looks like wine32 is missing, you should install it.
|
| 13 | # multiarch needs to be enabled first. as root, please
|
| 14 | # execute "dpkg --add-architecture i386 && apt-get update &&
|
| 15 | # apt-get install wine32:i386"
|
| 16 |
|
| 17 | BAD-install-wine() {
|
| 18 | #sudo apt-get update
|
| 19 | sudo apt-get install wine wine64 #winetricks
|
| 20 | }
|
| 21 |
|
| 22 | # OK let's fix it.
|
| 23 | # This is hundreds of megabytes on top
|
| 24 |
|
| 25 | BAD-install-wine-2() {
|
| 26 | dpkg --add-architecture i386
|
| 27 | apt-get update
|
| 28 | apt-get install wine32:i386
|
| 29 | }
|
| 30 |
|
| 31 |
|
| 32 | readonly DIR=_tmp/wine
|
| 33 |
|
| 34 | batch() {
|
| 35 | mkdir -p $DIR
|
| 36 | echo 'echo hello world' > $DIR/hi.bat
|
| 37 |
|
| 38 | echo "
|
| 39 | @echo off
|
| 40 | :: echo off is global
|
| 41 |
|
| 42 | :: call is required
|
| 43 | CALL $DIR/hi.bat
|
| 44 |
|
| 45 | dir $DIR | find .bat
|
| 46 |
|
| 47 | CALL $DIR/hi.bat
|
| 48 |
|
| 49 | " > $DIR/invoke.bat
|
| 50 |
|
| 51 | #echo 'dir' > $DIR/test.bat
|
| 52 | #echo 'dir | find ".bat"' > $DIR/test.bat
|
| 53 |
|
| 54 | # woah this brings up a GUI?
|
| 55 | wine cmd /c $DIR/invoke.bat
|
| 56 | }
|
| 57 |
|
| 58 | # doesn't work?
|
| 59 |
|
| 60 | # $ wine cmd /c echo "hello world"
|
| 61 | # wine: could not load kernel32.dll, status c0000135
|
| 62 |
|
| 63 |
|
| 64 | # OK these instructions work:
|
| 65 | #
|
| 66 | # https://gitlab.winehq.org/wine/wine/-/wikis/Debian-Ubuntu
|
| 67 |
|
| 68 | wine-key() {
|
| 69 | wget -O - https://dl.winehq.org/wine-builds/winehq.key |
|
| 70 | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
|
| 71 | }
|
| 72 |
|
| 73 | add-wine-repo() {
|
| 74 | # for Debian 12
|
| 75 | sudo wget -NP /etc/apt/sources.list.d/ \
|
| 76 | https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
|
| 77 | }
|
| 78 |
|
| 79 | install() {
|
| 80 | sudo apt install --install-recommends winehq-stable
|
| 81 | }
|
| 82 |
|
| 83 | # Hm this has a whole GUI installer, weird
|
| 84 |
|
| 85 | download-mingw() {
|
| 86 | wget --no-clobber \
|
| 87 | https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download -O mingw-get-setup.exe
|
| 88 | }
|
| 89 |
|
| 90 | "$@"
|