-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·76 lines (64 loc) · 2.05 KB
/
install
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
72
73
74
75
76
#!/bin/bash
echo "Welcome to LinStore."
# Check if git and yad are installed
missing_dependencies=false
if ! command -v git &>/dev/null; then
echo "Git is not installed. Please install Git and rerun the installation."
missing_dependencies=true
fi
if ! command -v yad &>/dev/null; then
echo "YAD (Yet Another Dialog) is not installed."
read -rp "Do you want to install YAD? (Y/N): " choice
if [[ $choice =~ ^[Yy]$ ]]; then
echo "Installing YAD..."
sudo apt update
sudo apt install yad
else
echo "YAD is required for LinStore installation. Exiting."
missing_dependencies=true
fi
fi
if [ "$missing_dependencies" = true ]; then
exit 1
fi
# LinStore installation process
temp_dir=$(mktemp -d) || {
echo "Failed to create a temporary directory. Exiting installation."
exit 1
}
# Clone repository to the temporary directory
echo "Cloning necessary files from the repository..."
if ! git clone https://github.com/techguy16/linstore "$temp_dir"; then
echo "Failed to clone repository. Exiting installation."
rm -rf "$temp_dir" # Clean up temporary directory
exit 1
fi
# Copy necessary files to ~/.linstore
echo "Copying files to the installation directory..."
install_dir="$HOME/.linstore"
mkdir -p "$install_dir"
cp -r "$temp_dir"/* "$install_dir"
cd "$install_dir"
chmod +x *
rm -r "$temp_dir" # Clean up temporary directory
# Create a bin directory if it doesn't exist
sudo mkdir -p /usr/local/bin
# Copy files to /usr/local/bin
echo "Copying executable files to /usr/local/bin..."
sudo cp "$install_dir"/tools/*_package /usr/local/bin/
# Create a desktop shortcut for GUI
desktop_file="$HOME/.local/share/applications/LinStore.desktop"
echo "Creating desktop shortcut..."
cat <<EOF >"$desktop_file"
[Desktop Entry]
Name=LinStore
Comment=The lightest and fastest Linux app store.
Exec=$HOME/.linstore/gui
Type=Application
Version=1.0
Terminal=false
StartupWMClass=LinStore
Icon=$HOME/.linstore/images/logo/logo.png
Categories=Utility;System;PackageManager;
EOF
echo "LinStore installed successfully!"