Fixed tlauncher not launching and added a warning at the README.md

This commit is contained in:
MatheusTT
2024-11-16 21:57:42 -03:00
parent 5839bd58d4
commit f8dfcc96b6
3 changed files with 41 additions and 35 deletions

View File

@@ -1,28 +1,27 @@
# TLauncher # TLauncher
This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/). This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/).
### Warning !
This script is only a tool to facilitate the download of TLauncher. The use of TLauncher is entirely at your own risk. I am not responsible for any issues that may arise from the use of TLauncher. If you are curious about why this warning even exists, see [this](https://github.com/MatheusTT/tlauncher-arch/issues/1) issue.
## How to install ## How to install
1. Clone and enter the repo 1. Clone and enter the repo
```c ```bash
git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch
``` ```
2. Change the permissions of the script 2. Change the permissions of the script
```c ```bash
chmod +x ./install.sh chmod +x ./install.sh
``` ```
3. Install tlauncher 3. Install tlauncher
```c ```bash
./install.sh ./install.sh
``` ```
## Or you can simply do this:
```c
wget https://pastebin.com/raw/TUgwsQdx -O - | tr -d '\r' | sh
```
## Usage ## Usage
After the installation, you can just type `tlauncher` in the terminal to launch tlauncher. After the installation, you can just type `tlauncher` in the terminal to launch tlauncher.
If you wanna update type `tlauncher --update` or `tlauncher -u`, for downloading the last version of tlauncher _(It's not the best way of doing this, but it will do it for now)_. If you wanna update type `tlauncher --update` or `tlauncher -u`, for downloading the last version of tlauncher _(It's not the best way of doing this, but it will do it for now)_.
If you wanna remove TLauncher from your system type `tlauncher --remove` or `tlauncher -r`, and then the tlauncher files will be removed and you can opt to remove the java packages, and/or the $HOME/.tlauncher dir. If you wanna remove TLauncher from your system type `tlauncher --remove` or `tlauncher -r`, and then the tlauncher files will be removed and you can opt to remove the java packages, and/or the $HOME/.tlauncher dir.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
[[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit [[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit
@@ -11,13 +11,13 @@ END="\033[0m"
## (They use java 8, but instead i'm installing the most recent java version). ## (They use java 8, but instead i'm installing the most recent java version).
# Downloading packages # Downloading packages
pkgs=( pkgs=(
wget wget
jdk-openjdk jdk-openjdk
jre-openjdk jre-openjdk
jre-openjdk-headless jre-openjdk-headless
java-openjfx java-openjfx
) )
sudo pacman -S --noconfirm --needed "${pkgs[@]}" sudo pacman -Sy --noconfirm --needed "${pkgs[@]}"
# Downloading TLauncher # Downloading TLauncher
echo -e "\n${GREEN}Downloading TLauncher...${END}" echo -e "\n${GREEN}Downloading TLauncher...${END}"
@@ -35,4 +35,4 @@ sudo mv src/tlauncher /usr/bin/
sudo mv src/tlauncher.png /usr/share/icons sudo mv src/tlauncher.png /usr/share/icons
sudo mv src/tlauncher.desktop /usr/share/applications sudo mv src/tlauncher.desktop /usr/share/applications
echo -e "\n${GREEN}Installation Complete!${END}" echo -e "\n${GREEN}Installation Complete!${END}"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
[[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit [[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit
@@ -7,6 +7,16 @@ RED="\033[1;31m"
GREEN="\033[1;32m" GREEN="\033[1;32m"
END="\033[0m" END="\033[0m"
usage() {
echo "
Usage:
-h, --help, help | Print this message
-u, --update, update | Update tlauncher.jar
-r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
nothing | Launch TLauncher
"
}
update() { update() {
echo -e "\n${GREEN}Downloading the latest version...${END}" echo -e "\n${GREEN}Downloading the latest version...${END}"
wget https://tlauncher.org/jar -P /tmp wget https://tlauncher.org/jar -P /tmp
@@ -17,15 +27,6 @@ update() {
echo -e "\n${GREEN}Done!${END}" echo -e "\n${GREEN}Done!${END}"
} }
usage() {
echo "
Usage:
--update, update | Update tlauncher.jar
--remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
nothing | Launch TLauncher
"
}
remove() { remove() {
SYSTEM_FILES=( SYSTEM_FILES=(
/usr/share/tlauncher /usr/share/tlauncher
@@ -41,15 +42,21 @@ remove() {
[[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher" [[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher"
} }
launch() {
java -jar /usr/share/tlauncher/tlauncher.jar
}
case "$1" in case "$1" in
-u|--update|update) -u | --update | update)
update ; exit ;; update && exit
-r|--remove|remove) ;;
remove ; exit ;; -r | --remove | remove)
*) remove && exit
usage ; exit ;; ;;
-h | --help | help)
usage && exit
;;
*)
launch
;;
esac esac
java -jar /usr/share/tlauncher/tlauncher.jar