From 412a2a11c6ffbb125c2116ea1f712f1eb6eaf2d7 Mon Sep 17 00:00:00 2001 From: maronmi Date: Mon, 22 Sep 2025 09:33:50 +0200 Subject: [PATCH] Implemented control flow in build.sh to check for dependencies, destination folder and installation file --- build.sh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 2487d74..36363a0 100644 --- a/build.sh +++ b/build.sh @@ -1,9 +1,29 @@ desktop=$(xdg-user-dir DESKTOP) -mkdir ~/wol/Guitar_Pro_8 -cp ~/wol/Downloads/Guitar_Pro_8/icon.png ~/wol/Downloads/Guitar_Pro_8/startup.sh ~/wol/Guitar_Pro_8 -cp ~/wol/Downloads/Guitar_Pro_8/guitarpro.desktop $desktop -echo "Downloading Guitar Pro 8..." -wget https://download-fr-3.guitar-pro.com/gp8/stable/guitar-pro-8-setup.exe + +if ! dpkg -s wine wine64 winetricks ttf-mscorefonts-installer winehq-stable &> /dev/null; then + sudo apt install --install-recommends wine wine64 winetricks ttf-mscorefonts-installer winehq-stable +fi + +if [ -d "~/wol/Guitar_Pro_8" ]; then + read -p "The directory ~/wol/Guitar_Pro_8 already exists. Do you want to delete it? (y/n) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + rm -rf ~/wol/Guitar_Pro_8 + fi +else + mkdir ~/wol/Guitar_Pro_8 + cp ~/wol/Downloads/Guitar_Pro_8/icon.png ~/wol/Downloads/Guitar_Pro_8/startup.sh ~/wol/Guitar_Pro_8 + cp ~/wol/Downloads/Guitar_Pro_8/guitarpro.desktop $desktop +fi + + +if [ ! -f "guitar-pro-8-setup.exe" ]; then + echo "Downloading Guitar Pro 8..." + wget https://download-fr-3.guitar-pro.com/gp8/stable/guitar-pro-8-setup.exe +else + echo "File already exists, skipping download." +fi + echo "Preparing Wineprefix enviroment..." WINEARCH=win64 WINEPREFIX=~/wol/Guitar_Pro_8/ winetricks win7 WINEARCH=win64 WINEPREFIX=~/wol/Guitar_Pro_8/ winetricks corefonts