From e29c086c13e5822af9023b1977b9c11fb16bf3fb Mon Sep 17 00:00:00 2001 From: Albert Starfield Wahyu Suryo S Date: Wed, 6 Mar 2024 16:25:17 +0700 Subject: [PATCH] Linux launcher builder added --- builder-tool/LinuxSpecificInstaller/exec_L0 | 44 +++++++++++++++++ .../linuxlauncherbuilder.sh | 10 ++++ .../Contents/Info.plist | 24 --------- .../MacOS/Adelaide Zephyrine Charlotte | 49 ------------------- .../adelaide-zephyrine-charlotte | 44 +++++++++++++++++ builder-tool/macOSdarwinBundle/exec_L0 | 8 +-- 6 files changed, 99 insertions(+), 80 deletions(-) create mode 100644 builder-tool/LinuxSpecificInstaller/exec_L0 create mode 100644 builder-tool/LinuxSpecificInstaller/linuxlauncherbuilder.sh delete mode 100644 builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Info.plist delete mode 100755 builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte create mode 100644 builder-tool/autoEasySetup/adelaide-zephyrine-charlotte diff --git a/builder-tool/LinuxSpecificInstaller/exec_L0 b/builder-tool/LinuxSpecificInstaller/exec_L0 new file mode 100644 index 000000000..3ebde4e14 --- /dev/null +++ b/builder-tool/LinuxSpecificInstaller/exec_L0 @@ -0,0 +1,44 @@ +#!/bin/bash +appName = "adelaide-zephyrine-charllote" +install_dependencies_linux() { + # Detect package manager + if command -v apt-get &> /dev/null; then + # Install required packages using apt-get + sudo apt-get update + sudo apt-get install -y git + elif command -v dnf &> /dev/null; then + # Install required packages using dnf (Fedora) + sudo dnf install -y git + elif command -v yum &> /dev/null; then + # Install required packages using yum (CentOS) + sudo yum install -y git + elif command -v zypper &> /dev/null; then + # Install required packages using zypper (openSUSE) + sudo zypper install -y git + elif command -v swupd &> /dev/null; then + sudo swupd bundle-add git + else + echo "Unsupported package manager or unable to install dependencies. Exiting." + exit 1 + fi + +} + +install_dependencies_linux + +# Check if run.sh script exists, if not, clone the repository +if [ ! -f "\$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then + echo "Cloning repository..." + git clone --depth=1 https://github.com/albertstarfield/alpaca-electron-zephyrine "\$HOME/adelaide-zephyrine-charlotte-assistant" +fi + +# Launch terminal and execute run.sh script +echo "Launching terminal..." +bash $HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh +echo "Copying to /usr/bin" +content="$(cat ${0})" +cat "${content}" > /usr/bin/${appName} +chmod +x /usr/bin/${appName} + +echo "Your program is now installed you can execute it again on the shell" +echo "$ ${appName}" diff --git a/builder-tool/LinuxSpecificInstaller/linuxlauncherbuilder.sh b/builder-tool/LinuxSpecificInstaller/linuxlauncherbuilder.sh new file mode 100644 index 000000000..92b6de9f7 --- /dev/null +++ b/builder-tool/LinuxSpecificInstaller/linuxlauncherbuilder.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Check if the necessary directories exist +if [ ! -d "usr" ] || [ ! -d "launchcontrol" ]; then + echo "Error: Make sure you are on the root directory of the project and you can launch like bash ./builder-tool/macOSdarwinBundle/maclauncherbuilder.sh" + exit 1 +fi + +echo "Bruh Linux is just as easy as launching it through the terminal and all is done! :D" +cp ./builder-tool/LinuxSpecificInstaller/exec_L0 ./builder-tool/autoEasySetup/adelaide-zephyrine-charlotte \ No newline at end of file diff --git a/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Info.plist b/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Info.plist deleted file mode 100644 index 2b8bb28fb..000000000 --- a/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Adelaide Zephyrine Charlotte - CFBundleIconFile - icon.icns - CFBundleIdentifier - com.example.Adelaide-Zephyrine-Charlotte - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Adelaide Zephyrine Charlotte - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte b/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte deleted file mode 100755 index fba9f0464..000000000 --- a/builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -#Wrapper to launch exec_L1 from osascript Launching Terminal -echo "Extracting Wrapper L1" -cat > /tmp/exec_L1 << EOL -#!/bin/bash - -# Check if brew command is detected, if not, install Homebrew -if ! command -v brew &> /dev/null; then - echo "Installing Homebrew..." - /bin/bash -c "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -fi - -# Update Homebrew -echo "Updating Homebrew..." -brew update - -# Upgrade installed packages -echo "Upgrading installed packages..." -brew upgrade - -# Update Homebrew -echo "Updating Homebrew..." -brew update - -# Check if git command is detected, if not, install it using brew -if ! command -v git &> /dev/null; then - echo "Installing git..." - brew install git -fi - -# Check if run.sh script exists, if not, clone the repository -if [ ! -f "\$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then - echo "Cloning repository..." - git clone --depth=1 https://github.com/albertstarfield/alpaca-electron-zephyrine "\$HOME/adelaide-zephyrine-charlotte-assistant" -fi - -# Launch terminal and execute run.sh script -echo "Launching terminal..." -osascript -e 'tell application "Terminal" to do script "bash \$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh"' - -# Sleep for 15 seconds -echo "Waiting for 15 seconds..." -sleep 15 - -open -a safari - -EOL -osascript -e 'tell application "Terminal" to do script "/bin/bash -c \"bash /tmp/exec_L1 ; rm /tmp/exec_L1 ; exit\"'\" -sleep 60 \ No newline at end of file diff --git a/builder-tool/autoEasySetup/adelaide-zephyrine-charlotte b/builder-tool/autoEasySetup/adelaide-zephyrine-charlotte new file mode 100644 index 000000000..3ebde4e14 --- /dev/null +++ b/builder-tool/autoEasySetup/adelaide-zephyrine-charlotte @@ -0,0 +1,44 @@ +#!/bin/bash +appName = "adelaide-zephyrine-charllote" +install_dependencies_linux() { + # Detect package manager + if command -v apt-get &> /dev/null; then + # Install required packages using apt-get + sudo apt-get update + sudo apt-get install -y git + elif command -v dnf &> /dev/null; then + # Install required packages using dnf (Fedora) + sudo dnf install -y git + elif command -v yum &> /dev/null; then + # Install required packages using yum (CentOS) + sudo yum install -y git + elif command -v zypper &> /dev/null; then + # Install required packages using zypper (openSUSE) + sudo zypper install -y git + elif command -v swupd &> /dev/null; then + sudo swupd bundle-add git + else + echo "Unsupported package manager or unable to install dependencies. Exiting." + exit 1 + fi + +} + +install_dependencies_linux + +# Check if run.sh script exists, if not, clone the repository +if [ ! -f "\$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then + echo "Cloning repository..." + git clone --depth=1 https://github.com/albertstarfield/alpaca-electron-zephyrine "\$HOME/adelaide-zephyrine-charlotte-assistant" +fi + +# Launch terminal and execute run.sh script +echo "Launching terminal..." +bash $HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh +echo "Copying to /usr/bin" +content="$(cat ${0})" +cat "${content}" > /usr/bin/${appName} +chmod +x /usr/bin/${appName} + +echo "Your program is now installed you can execute it again on the shell" +echo "$ ${appName}" diff --git a/builder-tool/macOSdarwinBundle/exec_L0 b/builder-tool/macOSdarwinBundle/exec_L0 index fba9f0464..e57c87770 100644 --- a/builder-tool/macOSdarwinBundle/exec_L0 +++ b/builder-tool/macOSdarwinBundle/exec_L0 @@ -1,5 +1,5 @@ #!/bin/bash -#Wrapper to launch exec_L1 from osascript Launching Terminal +#Wrapper to launch exec_L1 from osascript Launching Terminal so its viewable echo "Extracting Wrapper L1" cat > /tmp/exec_L1 << EOL #!/bin/bash @@ -38,12 +38,6 @@ fi echo "Launching terminal..." osascript -e 'tell application "Terminal" to do script "bash \$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh"' -# Sleep for 15 seconds -echo "Waiting for 15 seconds..." -sleep 15 - -open -a safari - EOL osascript -e 'tell application "Terminal" to do script "/bin/bash -c \"bash /tmp/exec_L1 ; rm /tmp/exec_L1 ; exit\"'\" sleep 60 \ No newline at end of file