-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller_linux.sh
More file actions
executable file
·71 lines (60 loc) · 1.67 KB
/
installer_linux.sh
File metadata and controls
executable file
·71 lines (60 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
set -e
set -o pipefail
if command -v zenity &> /dev/null; then
gui_mode=true
else
gui_mode=false
echo "Zenity not found. Running in text mode."
fi
progress() {
local percent=$1
local message=$2
if [ "$gui_mode" = true ]; then
echo "$percent"
echo "# $message"
else
echo "[$percent%] $message"
fi
}
install_steps() {
progress 10 "Initializing..."
VST3_DIR="$HOME/.vst3"
CLAP_DIR="$HOME/.clap"
mkdir -p "$VST3_DIR" "$CLAP_DIR"
local count=0
if [ -d "TrebleMaker.vst3" ]; then
progress 30 "Installing VST3..."
rm -rf "$VST3_DIR/TrebleMaker.vst3"
cp -r "TrebleMaker.vst3" "$VST3_DIR/"
((count++))
fi
if [ -f "TrebleMaker.clap" ]; then
progress 80 "Installing CLAP..."
cp "TrebleMaker.clap" "$CLAP_DIR/"
((count++))
fi
progress 100 "Finishing..."
if [ "$count" -eq 0 ]; then
echo "ERR:NO_FILES"
return 1
fi
}
if [ "$gui_mode" = true ]; then
if output=$(install_steps | zenity --progress --title="Installing TrebleMaker" --auto-close --no-cancel 2>&1); then
if [[ "$output" == *"ERR:NO_FILES"* ]]; then
zenity --error --text="No plugin files found.\nRun this script from the released folder."
exit 1
else
zenity --info --text="Installation Complete!\nYou may need to rescan plugins in your DAW." --title="Success"
fi
else
exit 1
fi
else
if ! install_steps | grep -v "ERR:NO_FILES"; then
echo "Error: No plugin files found. Check your directory."
exit 1
fi
echo "Success! Installation Complete."
fi