Skip to content

Commit

Permalink
Windows MobaXTerm installation option (#275)
Browse files Browse the repository at this point in the history
* Windows MobyXTerm installation option

A new way to install D-Rats on Windows using MobyXterm

* Add lzhuf to MobaXterm install script

d-rats_in_mobaxterm_install.sh: (new)
  Script to install d-rats in a MobaXterm localhost window.
  • Loading branch information
wb8tyw authored Nov 15, 2023
1 parent 4f95627 commit 09626a3
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,50 @@ See also <https://github.com/ham-radio-software/D-Rats/wiki>
You must have a compatible python3 and GTK 3 installed on the system to run
D-Rats as listed above.

The MobaXterm package contains a local Cygwin environment that is good
enough to run D-Rats.

The free MobaXterm can be download from <https://mobaxterm.mobatek.net/download.html>
and then installed on a Microsoft Windows system.

If you already have a copy of the install script downloaded then you need
to delete it:

> rm -f d-rats_in_mobaxterm_install.sh
From the local terminal use the wget command to fetch the install script.

> wget https://github.com/ham-radio-software/D-Rats/blob/master/d-rats_in_mobaxterm_install.sh
If you are testing a github Pull Request for a new copy of this script, they you need to look
up the "raw" URL for the script or you will be getting

The permission of the script may need to be fixed.
> chmod 0755 d-rats_in_mobaxterm_install.sh
Then run the script. It will run for a bit and install everything needed to run
D-Rats
> ./d-rats_in_mobaxterm_install.sh
Then to run use:

> ./d-rats
The MobaXterm installs or updates d-rats from the master branch of the git repository.
The MobaXterm is a new install and will not use any pre-existing D-Rats configuration.
In MobaXterm, files in your windows drives can be accessed by starting the path with
/drives, as in /drives/c/ instead of c:\.

Cygwin install has not yet been tested. MobaXterm uses Cygwin for some of its Linux emulation,
with a few changes. MobaXterm uses a program named busybox instead of the separate programs
that Cygwin and Linux use and then creates aliases to make it appear that the separate programs
are installed. Those can not be used in the install script and busybox must be used instead,
and Cygwin does not use an apt installer.

In theory with Cygwin, you can install all the packages that the MobaXterm script installs
with the Cygwin Gui installer and then use the commands from the script for PIP installs,
D-Rats should install on Cygwin.

For msys2, the script msys2_packages.sh will hopefully install all the
needed packages after you have installed msys2. The "dev" parameter
is passed to install extra images needed for development, or installing
Expand Down Expand Up @@ -173,7 +217,6 @@ suffix.

You may need to install additional locales on your system.


Debian packages needed for running or development.

Below if you are not in a locale that is english, you will probably want the
Expand Down
86 changes: 86 additions & 0 deletions d-rats_in_mobaxerm_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/bash

set -uex
# MobaXterm has some of these packages built in.
# curl git wget

# MobaXterm uses aliases which are needed in a setup script
apt_get='/bin/MobaBox.exe apt-get'
mkdir='/usr/bin/busybox mkdir'

# This is needed to prevent pop ups that pause the install
DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND
# Update to current and add packages
# apt-get --assume-yes update
$apt_get -y upgrade
$apt_get -y install \
aspell aspell-de aspell-en aspell-es aspell-it \
ffmpeg \
gedit gettext git gcc-core \
libgtk3_0 libjpeg-devel libportaudio-devel \
python39 python39-devel python39-gi python39-lxml \
python3-pip python39-sphinx \
zlib-devel

pypi_dir=/usr/local/lib/pypi
$mkdir -p "$pypi_dir"


if [ -e "$pypi_dir/bin/pip3" ]; then
echo 'Pip already updated'
else
# Pip always complains if a newer version is available until
# you upgrade to it.
echo "upgrading pip, this will warn that pip needs upgrading"
pip3 install --upgrade --target="$pypi_dir" pip
ls "$pypi_dir/bin"
fi
# Need to set PYTHONPATH to use the PyPi packages
PYTHONPATH="$pypi_dir"
export PYTHONPATH
ls "$pypi_dir/bin"
# If we do not include pip here, for some reason pip removes the
# binary for it. Why???
"$pypi_dir/bin"/pip3 install --upgrade --target="$pypi_dir" \
feedparser \
geopy \
pip \
Pillow \
pyaudio \
pydub \
pycountry \
pyserial

if [ ! -e "$HOME/d-rats-git" ]; then
git clone https://github.com/ham-radio-software/D-Rats.git \
"$HOME/d-rats-git"
else
pushd "$HOME/d-rats-git"
git pull
popd
fi

# Handle lzhuf
if [ ! -e /usr/bin/lzhuf ]; then
lzexe="/drives/c/Program Files/lzhuf/lzhuf.exe"
if [ -e "$lzexe" ]; then
ln -s "$lzexe" /usr/bin/lzhuf
else
echo "lzhuf is not installed! Install from"
echo "https://groups.io/g/d-rats/files/D-Rats/Windows"
echo "groups.io d-rats free membership required"
echo "Then re-run this script."
fi
fi


if [ ! -e "$HOME/d-rats" ]; then
cat << 'EOF' > "$HOME/d-rats"
#!/bin/bash
PYTHONPATH=/usr/local/lib/pypi
export PYTHONPATH
$HOME/d-rats-git/d-rats.py "$@"
EOF
chmod 755 "$HOME/d-rats"
fi

0 comments on commit 09626a3

Please sign in to comment.