Skip to content

Instantly share code, notes, and snippets.

@randomchars42
Last active April 3, 2023 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomchars42/a13db217a49f1af25b6aac4df66f058e to your computer and use it in GitHub Desktop.
Save randomchars42/a13db217a49f1af25b6aac4df66f058e to your computer and use it in GitHub Desktop.
Dateimanager und SoftwareUpdater für BookII von Tessloff unter (Ubuntu) Linux mit WINE
#!/bin/bash
path_working_dir="$HOME"
prefix="bookii"
# in diesem Verzeicnis soll die neue Bottle (=Prefix) entstehen
path_bottles="$path_working_dir/Bottles"
# in diesen Verzeichnissen liegen die benötigten Dateien
# - winetricks.sh (wird heruntergelade
# - BOOKiiSoftwareInstaller.exe (https://www.bookii.de/site/uploads/2019/03/BOOKiiSoftwareInstaller.zip)
# - BOOKii.exe (auf dem Stift oder [hier](blog.pixelwoelkchen.de/assets/Bookii.zip))
path_lib="$path_working_dir/bookii"
path_bookii_installer="$path_lib/BOOKiiSoftwareInstaller.exe"
path_bookii_manager="$path_lib/Bookii.exe"
path_winetricks="$path_lib/winetricks.sh"
# setzt das WINEPREFIX (= Bottle) für die Dauer des Skripts
export WINEPREFIX="$path_bottles/$prefix"
# vermeidet Probleme mit dotnet, Dank an @der-martin85
export WINEARCH=win32
# neues Prefix erstellen und .NET installieren
function install_dependencies {
# wenn noch kein Prefix vorhanden ist
if [[ ! -e "$path_wine/$prefix" ]]
then
# wird es erstellt und die Konfiguration aufgerufen
# hier wird windows 8.1 eingestellt, Dank an @der-martin85
winecfg -v win81
# "Neustart" des Systems
wine wineboot
# .NET 4.6 mit Winetricks installieren
# ! akzeptiert automatisch die EULA !
"$path_winetricks" -q dotnet46
fi
}
# Winetricks bereitstellen
function install_winetricks {
if [[ ! -e "$path_winetricks" ]]
then
path="$(dirname $path_winetricks)"
echo "$path"
# erstelle das Verzeichnis falls nötig
[[ ! -e "$path" ]] && mkdir -p "$path"
# Winetricks herunterladen
wget -r -c -N https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O "$path_winetricks"
chmod +x "$path_winetricks"
fi
}
# startet den Updater
function update_bookii {
# checke ob das Verzeichnis existiert
path="$(dirname $path_bookii_installer)"
[[ ! -e "$path" ]] && mkdir -p "$path"
# lade die Datei herunter
[[ ! -e "$path_bookii_installer" ]] &&
wget https://www.bookii.de/site/uploads/2019/03/BOOKiiSoftwareInstaller.zip -O "$path_bookii_installer.zip" &&
unzip "$path_bookii_installer.zip" -d "$path" &&
rm "$path_bookii_installer.zip"
wine "$path_bookii_installer"
}
# startet den Dateimanager
function run_bookii {
# checke ob das Verzeichnis existiert
path="$(dirname $path_bookii_manager)"
[[ ! -e "$path" ]] && mkdir -p "$path"
# lade die Datei herunter
[[ ! -e "$path_bookii_manager" ]] &&
wget -r -c -N http://blog.pixelwoelkchen.de/assets/Bookii.zip -O "$path_bookii_manager.zip" &&
unzip "$path_bookii_manager.zip" -d "$path" &&
rm "$path_bookii_manager.zip"
wine "$path_bookii_manager"
}
# der erste Parameter, der diesem Skript übergeben wird bestimmt, was ausgeführt wird
action="$1"
[[ -z "$action" ]] && echo "Was soll gemacht werden (start|update|install)" && exit 1
case "$action" in
start)
run_bookii
;;
update)
update_bookii
;;
tricks)
install_winetricks
"$path_winetricks"
;;
install)
install_winetricks
install_dependencies
;;
esac
@der-martin85
Copy link

der-martin85 commented Apr 3, 2023

Jetzt hab ichs. Ich hab das virtuelle CD ROM Laufwerk doch noch gefunden und mounten können. Mit der Bookii.exe von dem Gerät funktioniert es jetzt.
Vielen Dank dir nochmal!

P.S.: Für alle die an das gleiche Problem stoßen, ich hab eine Zusätzliche Funktion in das Script eingearbeitet:
`
function copy_bookii {
[[ ! -e "$path_mount" ]] && mkdir -p "$path_mount"

checke ob das Verzeichnis existiert

path="$(dirname $path_bookii_manager)"
[[ ! -e "$path" ]] && mkdir -p "$path"

sudo mount -o ro LABEL=BOOKII_APP "$path_mount" &&
cp -uR "$path_mount"/* "$path" &&
sudo umount "$path_mount" &&
chmod 755 -R "$path"/*
}
`

Dafür muss der path_mount natürlich gesetzt sein. Ich habe am Anfang path_mount="$path_bottles/BOOKII_APP" gesetzt.
Außerdem noch folgendes in die case Anweisung am Ende eingefügt:

copy) copy_bookii ;;
Dann ist die Herangehensweise quasi erst
bookii.sh install
bookii.sh copy

und dann mit bookii.sh start

Man muss einmal das Passwort eingeben, damit das CD-ROM Laufwerk gemountet werden kann. Natürlich muss der Stift auch angeschlossen sein, wenn bookii.sh copy aufgerufen wird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment