Initial commit

This commit is contained in:
AlphaX-Projects
2021-12-25 14:39:47 +01:00
commit 2f823927a5
3687 changed files with 37381 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# Make necessary config and add LOTW Softwares apt repo
# SCript to run UI without sandbox
echo \'/opt/${productFilename}/qortal-ui\' --no-sandbox > '/opt/${productFilename}/run-ui'
chmod +x '/opt/${productFilename}/run-ui'
# Link to run-ui
ln -sf '/opt/${productFilename}/run-ui' '/usr/bin/${executable}'
# SUID chrome-sandbox for Electron 5+
sudo chown root '/opt/${productFilename}/chrome-sandbox' || true
sudo chmod 4755 '/opt/${productFilename}/chrome-sandbox' || true
update-mime-database /usr/share/mime || true
update-desktop-database /usr/share/applications || true
# Install curl if not installed on the system
if ! which curl; then sudo apt-get --yes install curl; fi
# Install apt repository source list if it does not exist
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep qortal.list; then
curl -sS https://lotw.qortal.org/lotw_pub.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://lotw.qortal.org/debian stable main" \
| sudo tee /etc/apt/sources.list.d/qortal.list
fi

45
scripts/afterPack.js Normal file
View File

@@ -0,0 +1,45 @@
const path = require('path')
const shell = require("shelljs");
const runShellCommand = (appOutDir) => {
shell.exec(
`chmod 4755 ${path.join(appOutDir, "chrome-sandbox")}`,
function (code, stdout, stderr) {
console.log('runShellCommand ==> Exit code:', code);
if (stderr) {
console.log('runShellCommand ==> Program stderr:', stderr);
}
});
}
async function doLinux(context) {
console.log("Running doLinux ==> ");
const { targets, appOutDir } = context
targets.forEach(async target => {
if (!["appimage", "snap"].includes(target.name.toLowerCase())) {
await runShellCommand(appOutDir)
}
});
}
async function afterPack(context) {
console.log("Running AfterPack");
const electronPlatformName = context.electronPlatformName.toLowerCase();
if (electronPlatformName.includes("linux")) {
await doLinux(context);
return;
}
}
module.exports = afterPack

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# Remove all conf made by the the software
# Remove apt repository source list when user uninstalls app
if grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep qortal.list; then
sudo apt-key del 5025E50F;
sudo rm /etc/apt/sources.list.d/qortal.list;
fi
# Get the root user
if [ $SUDO_USER ];
then getSudoUser=$SUDO_USER;
else getSudoUser=`whoami`;
fi
getDesktopEntry=/home/$getSudoUser/.config/autostart/qortal.desktop;
# Remove desktop entry if exists
if [ -f $getDesktopEntry ]; then
sudo rm $getDesktopEntry;
fi
# App directory which contains all the config, setting files
appDirectory=/home/$getSudoUser/.config/qortal-ui/;
if [ -d $appDirectory ]; then
sudo rm -rf $appDirectory;
fi
# Delete the link to the binary
rm -f '/usr/bin/${executable}'
# Delete run-ui
rm -f '/opt/${productFilename}/run-ui'