WheezyE

Winlink & VARA Installer for RPi 4B - testing version

Sep 25th, 2020 (edited)
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###############################################################################
  2. ########### Winlink & VARA Installer Script for the Raspberry Pi 4B ###########
  3. # Author: Eric Wiessner (KI7POL)                                              #
  4. # Version: 0.45 (work in progress 01/31/2021)                                 #
  5. # Credits:                                                                    #
  6. #   The Box86 team                                                            #
  7. #      (ptitSeb, pale, chills340, phoenixbyrd, Botspot, !FlameKat53, epychan, #
  8. #       Heasterian, monkaBlyat, SpacingBat3, #lukefrenner, Icenowy, Longhorn, #
  9. #       #MonthlyDoseOfRPi, luschia, Binay Devkota, hacker420, et.al.)         #
  10. #   K6ETA & DCJ21's Winlink on Linux guides                                   #
  11. #   KM4ACK & OH8STN for inspiration                                           #
  12. #   N7ACW & AD7HE for getting me started in ham radio                         #
  13. #                                                                             #
  14. #    "My humanity is bound up in yours, for we can only be human together"    #
  15. #                                                - Nelson Mandela             #
  16. ###############################################################################
  17.  
  18. # About:
  19. #    This script will help you install Box86, Wine, winetricks, Windows DLL's, Winlink (RMS Express) & VARA.  You will then need to configure RMS Express & VARA to send/receive audio from a USB sound card plugged into your Pi.  This installer will only work on the Raspberry Pi 4B for now.  If you would like to use an older Raspberry Pi (3B+, 3B, 2B, Zero, for example), software may run very slow and you may need to compile a custom 2G/2G split memory kernel before installing.
  20. #
  21. # Distribution:
  22. #    This script is free to use, open-source, and should not be monetized.  If you use this script in your project (or are inspired by it) just please be sure to mention ptitSeb, Box86, and myself (KI7POL).
  23. #
  24. # Legal:
  25. #    All software used by this script is free and legal to use (with the exception of VARA, of course, which is shareware).  Box86 and Wine are both open-source (which avoids the legal problems of use & distribution that ExaGear had - ExaGear also ran much slower than Box86 and is no-longer maintained, despite what Huawei says these days).  All proprietary Windows DLL files required by Wine are downloaded directly from Microsoft and installed according to their redistribution guidelines.
  26. #
  27. # Donations:
  28. #    If you feel that you are able and would like to support this project, please consider sending donations to ptitSeb or KM4ACK - without whom, this script would not exist.
  29. #        - Sebastien "ptitSeb" Chevalier - author of "Box86": paypal.me/0ptitSeb
  30. #        - Jason Oleham (KM4ACK) - inspiration & Linux elmer: paypal.me/km4ack
  31. #
  32.  
  33.  
  34. # NOTE: Pastebin may create DOS line endings to this script and make the script crash on Linux.  Try downloading this script, then running the script through dos2unix (sudo apt-get install dos2unix).
  35.  
  36.  
  37. ############  Setup the RPi4 to run Windows .exe files ############
  38. # To run Windows .exe files on RPi4, we need an x86 emulator (box86) and a Windows API Call interpreter (wine)
  39. # Box86 is opensource and runs about 10x faster than ExaGear or Qemu.  It's much smaller and easier to install too.
  40.  
  41. ### Install Box86
  42. sudo apt-get install cmake -y
  43.  
  44. cd ~/Downloads
  45. mkdir box86-installer && cd box86-installer
  46. git clone https://github.com/ptitSeb/box86
  47. cd box86/
  48. git checkout db5efa89085a085d733c859662799ebcf4e5c3c2 # this version of box86 installs dotnet35sp1 but doesn't run RMS Express
  49. mkdir build; cd build; cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
  50. make -j4
  51. sudo make install # copies box86 files to /usr/local/bin/box86
  52. sudo systemctl restart systemd-binfmt # essentially initializes box86
  53. git checkout master
  54.  
  55.  
  56. ### Download and install Wine 5.21 devel buster for i386
  57. # Backup old wine
  58. wineserver -k # stop any old wine installations from running
  59. sudo mv ~/wine ~/wine-old
  60. sudo mv ~/.wine ~/.wine-old
  61. sudo mv /usr/local/bin/wine /usr/local/bin/wine-old
  62. sudo mv /usr/local/bin/winecfg /usr/local/bin/winecfg-old
  63. sudo mv /usr/local/bin/wineserver /usr/local/bin/wineserver-old
  64. # Download wine
  65. cd ~/Downloads
  66. wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-devel-i386_5.21~buster_i386.deb
  67. wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-devel_5.21~buster_i386.deb
  68. dpkg-deb -xv wine-devel-i386_5.21~buster_i386.deb wine-installer
  69. dpkg-deb -xv wine-devel_5.21~buster_i386.deb wine-installer
  70. rm wine-devel-i386_5.21~buster_i386.deb # clean up
  71. rm wine-devel_5.21~buster_i386.deb # clean up
  72. # Install wine
  73. sudo mv wine-installer/opt/wine-devel ~/wine
  74. rm -rf wine-installer # clean up
  75. sudo ln -s ~/wine/bin/wine /usr/local/bin/wine
  76. sudo ln -s ~/wine/bin/winecfg /usr/local/bin/winecfg
  77. sudo ln -s ~/wine/bin/wineserver /usr/local/bin/wineserver
  78. # Initialize wine silently
  79. rm -rf ~/.cache/wine # make sure we don't install mono or gecko (if their msi files are in wine cache)
  80. DISPLAY=0 wine wineboot # silently makes a fresh wineprefix in ~/.wine and skips installation of mono & gecko
  81.  
  82.  
  83. ### Download & install winetricks
  84. sudo mv /usr/local/bin/winetricks /usr/local/bin/winetricks-old # backup old winetricks
  85. cd ~/Downloads
  86. wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks # download
  87. sudo chmod +x winetricks
  88. sudo cp winetricks /usr/local/bin # install
  89. rm winetricks # clean up
  90. sudo apt-get install cabextract -y # winetricks needs this
  91.  
  92.  
  93. ### Setup Wine (install system requirements into our wineprefix for Winlink & VARA)
  94. BOX86_NOBANNER=1 winetricks -q corefonts dotnet35sp1 vb6run win7 sound=alsa # for RMS Express
  95. BOX86_NOBANNER=1 winetricks -q vcrun2015 pdh # for VARA (run pdh here just for the winecfg dll override)
  96. BOX86_NOBANNER=1 winetricks -q riched30 richtx32 crypt32 comctl32ocx comdlg32ocx # for Box86 compatibility (to cover any wine libraries that aren't wrapped in Box86 yet)
  97. # NOTE: This command needs testing - vcrun2015, crypt32, and the ocx components may not install properly
  98. # Notes: Does Winlink HF Channel Selector (ITS) need ie6 or gecko?
  99.  
  100. # Install an older pdh.dll (the pdh.dll from "winetricks pdh" is too new for VARA)
  101. sudo apt-get install zip -y
  102. cd ~/Downloads && mkdir pdhNT40 && cd pdhNT40
  103. wget http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/en-us/nt4pdhdll.exe
  104. unzip -o nt4pdhdll.exe
  105. cp pdh.dll ~/.wine/drive_c/windows/system32
  106.  
  107.  
  108.  
  109.  
  110.  
  111. # NOTE: THIS IS A KLUDGE!!
  112. # dotnet35sp1 installer needs an old box86, but our programs need the latest box86. Update box86 with these commands.
  113. cd ~/Downloads/box86-installer
  114. cd box86/
  115. git checkout cad160205fd9a267e6c3d9d784fbef72b1c68dde # freeze box86 version on a commit known to work
  116. cd build
  117. make -j4
  118. sudo make install
  119.  
  120. rm -rf ~/Downloads/box86-installer # clean up
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. ############  Install Winlink and VARA (into our configured wineprefix) ############
  129. sudo apt-get install p7zip-full -y
  130. sudo apt-get install megatools -y
  131.  
  132. # Download/extract/install Winlink Express (formerly RMS Express) [https://downloads.winlink.org/User%20Programs/]
  133. cd ~/Downloads
  134. wget -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winlink.org/User%20Programs # Download Winlink no matter its version number
  135. 7z x Winlink_Express_install_*.zip -o"WinlinkExpressInstaller"
  136. wine ~/Downloads/WinlinkExpressInstaller/Winlink_Express_install.exe /SILENT
  137.  
  138. # Download/extract/install VARA HF (or newer) [https://rosmodem.wordpress.com/]
  139. cd ~/Downloads
  140. VARALINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?<=<a href=").*?(?=" target="_blank" rel="noopener noreferrer">VARA HF v)') # Find the mega.nz link from the rosmodem website no matter its version, then store it as a variable
  141. megadl ${VARALINK}
  142. 7z x VARA*.zip -o"VARAInstaller"
  143. wine ~/Downloads/VARAInstaller/VARA\ setup*.exe /SILENT
  144. # NOTE: VARA prompts user to hit 'ok' after install even if silent install.  We could skip it with wine AHK, but since the next step is user configuration and involves user input anyway, we can just have the user click ok here.
  145. # Inno Setup Installer commandline commands: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
  146.  
  147.  
  148.  
  149. ###### Configure Winlink and VARA ######
  150. echo "In winecfg, go to the Audio tab to set up your default in/out soundcards."
  151. wine winecfg
  152.  
  153. echo "In VARA, set up your soundcard input and output (go to Settings ... Soundcard)"
  154. wine ~/.wine/drive_c/VARA/VARA.exe
  155.  
  156. echo "In RMS Express, enter your callsign, password, gridsquare, and soundcard in/out, then close the program.  Ignore any errors for now."
  157. wine ~/.wine/drive_c/RMS\ Express/RMS\ Express.exe
  158.  
  159. ### end ###
  160.  
  161.  
  162. #############  Known bugs #############
  163. # The Channel Selector is functional, it just takes about 5 minutes to update its propagation indices and sometimes crashes the first time it's loaded.  Just restart it if it crashes.  If you let it run for 5 minutes, then you shouldn't have to do that again - just don't hit the Update Table Via Internet button.  I'm currently experimenting with ITS HF: http://www.greg-hand.com/hfwin32.html
  164. # VARA has some graphics issues for now.  This is an issue with Wine, not box86
  165. # RMS Express internet may not work on the first run for some reason. Maybe due to vbrun6 being installed with old box86?
  166.  
  167. ############# Other Ham Software ##############
  168. ### Xnec2c - Antenna Modeling Software for Linux (needs .nec input files or examples - such as from nec2.org)
  169. # sudo apt install xnec2c
  170.  
  171. ### EZNEC 6.0 - Antenna Modeling Software for Windows which mostly works with box86 (no near-field plots)
  172. #cd ~/Downloads
  173. #wget https://www.eznec.com/DemoEXE/EZWDemo60Inst.exe
  174. #wine EZWDemo60Inst.exe /SILENT
  175. #wine ~/.wine/drive_c/Program\ Files/EZNEC\ 6.0/EZWdemo60.exe
  176.  
  177.  
  178. ############# Future work - other software ##############
  179. ### HRD 5.24.38 (last freeware version)
  180. ## https://ham-radio-deluxe.informer.com/versions/
  181. ## Notes: 5.0.2893 Last freeware version of HRD
  182. ## Behavior: Runs, but no FT-891 (6.1.4.189 also does not have FT-891)
  183. # winetricks jet40 mdac28 art2kmin
  184. # winetricks vcrun2010
  185. # wget https://pastebin.com/raw/W6DPz6PR && mv W6DPz6PR hrdwine.reg && wine regedit hrdwine.reg
  186. # wget https://madexp.com/wp-content/uploads/2018/05/HRD_5.0.2893.zip
  187. # 7z x HRD_5.0.2893.zip -o"HRD_502893"
  188. # wine HRD_502893/HRDv050b2893.exe /SILENT
  189.  
  190. ## HRD 5.2.202
  191. # https://ham-radio-deluxe.informer.com/versions/
  192. # wget https://download.informer.com/win-1192998216-47c93aa7-6fa5c53a/setuphrd52202.exe <- link is not persistent
  193. # winetricks -q vcrun2010
  194. # BOX86_DYNAREC=0 wine setuphrd52202.exe /SILENT
  195. ## Opcode 0F 3F 07 0B C7 45 E4 01
  196.  
  197. ## HRD 6.4.0.647 <--- latest version which has the best compatability so far
  198. # https://ham-radio-deluxe.informer.com/versions/
  199. # Untested on box86
  200. ## Behavior: Runs & includes the FT-891
  201. # winetricks jet40 mdac28 art2kmin
  202. # winetricks vcrun2010
  203. # wget https://pastebin.com/raw/W6DPz6PR && mv W6DPz6PR hrdwine.reg && wine regedit hrdwine.reg
  204.  
  205. ## HRD 6.6.0.236
  206. # Untested on box86
  207. # Requires Visual C++ 2017
  208.  
  209. ## HRD 6.7.0.244
  210. # Behavior: Doesn't install in wine for exagear
  211.  
  212. ### DSDPlus
  213. #cd ~/Downloads
  214. #wget https://www.dsdplus.com/dl/DSDPlus1p101.zip
  215. #wget https://www.dsdplus.com/dl/DSDPlusDLLs.zip
  216. #7z x DSDPlus1p101.zip -o"DSDPlus1101"
  217. #7z x DSDPlusDLLs.zip -o"DSDPlus1101"
  218. #cd DSDPlus1101
  219. #wine DSDPlus.exe
  220.  
  221. ### WinRPR
  222. #cd ~/Downloads
  223. #wget -r -l1 -np -nd -A "WinRPR_*.zip" https://www.hamradio.me/graphs/WinRPR_Alpha_Software/
  224. #7z x WinRPR_*.zip -o"WinRPR"
  225. #wine WinRPR/WinRPR_10.exe
  226.  
  227. ### MMANA-GAL - Antenna Modeling Software : http://gal-ana.de/basicmm/en/ [crashes]
  228. #cd ~/Downloads
  229. #wget  http://gal-ana.de/basicmm/download/mmanabasic.zip
  230. #7z x mmanabasic.zip -o"mmanabasic"
  231. #wine mmanabasic/MMBasicSetup.exe /SILENT
  232. #wine ~/.wine/drive_c/MMANA-GAL_Basic/MMANAGAL_Basic.exe
  233.  
  234. ### 4nec2 - Antenna Modeling Software [crashes]
  235. #cd ~/Downloads
  236. #wget https://qsl.net/4nec2/4nec2.zip
  237. #7z x 4nec2.zip -o"4nec2"
  238. #wine 4nec2/Setup_4nec2.exe /SILENT
  239. #wine ~/.wine/drive_c/4nec2/exe/4nec2.exe
  240.  
  241. ### N3FJP's logging software
  242. # wget http://www.n3fjp.com/programs/ACLOGINST.exe
  243. # wget http://n3fjp.com/programs/FIELDDAY.exe
  244. #
  245. # Fix errors with .mdb files not opening or being created?
  246. # winetricks dotnet45 # this will uninstall mono?
  247. # Note: After .NET 4.0 installs, wine will appear to be erroring in a loop.  Let it loop run its weird error loops for about 15 minutes.  After this time a .NET 4.5 installer will pop up.  Install goes much faster on a Pi 4B (about 30 minutes) than on a Pi 3B+ (about 2 hours), the Pi will overheat a few times and kick you out of any VNC remote connections - just let it keep running.
  248.  
  249. ### List of other Windows ham radio programs compatible with Wine: https://appdb.winehq.org/objectManager.php?sClass=category&iId=125&sAction=view&sTitle=Browse+Applications
Add Comment
Please, Sign In to add comment