mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fix: change artifact names (#2589)
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/client_scripts">
|
<qresource prefix="/client_scripts">
|
||||||
<file>linux_installer.sh</file>
|
|
||||||
<file>mac_installer.sh</file>
|
<file>mac_installer.sh</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
EXTRACT_DIR="$1"
|
|
||||||
INSTALLER_PATH="$2"
|
|
||||||
|
|
||||||
# Create and clean extract directory
|
|
||||||
rm -rf "$EXTRACT_DIR"
|
|
||||||
mkdir -p "$EXTRACT_DIR"
|
|
||||||
|
|
||||||
# Extract TAR archive
|
|
||||||
tar -xf "$INSTALLER_PATH" -C "$EXTRACT_DIR"
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo 'Failed to extract TAR archive'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find and run installer
|
|
||||||
INSTALLER=$(find "$EXTRACT_DIR" -type f -executable)
|
|
||||||
if [ -z "$INSTALLER" ]; then
|
|
||||||
echo 'Installer not found'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$INSTALLER"
|
|
||||||
EXIT_CODE=$?
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
rm -rf "$EXTRACT_DIR"
|
|
||||||
exit $EXIT_CODE
|
|
||||||
@@ -21,14 +21,14 @@ namespace
|
|||||||
Logger logger("UpdateController");
|
Logger logger("UpdateController");
|
||||||
|
|
||||||
#if defined(Q_OS_WINDOWS)
|
#if defined(Q_OS_WINDOWS)
|
||||||
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_x64.exe");
|
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN-%1-win64.exe");
|
||||||
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN_installer.exe";
|
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN_installer.exe";
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_macos.pkg");
|
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN-%1-Darwin.pkg");
|
||||||
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.pkg";
|
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.pkg";
|
||||||
#elif defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
#elif defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
||||||
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_linux_x64.tar");
|
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN-%1-Linux.run");
|
||||||
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.tar";
|
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.run";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,36 +346,10 @@ int UpdateController::runMacInstaller(const QString &installerPath)
|
|||||||
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
||||||
int UpdateController::runLinuxInstaller(const QString &installerPath)
|
int UpdateController::runLinuxInstaller(const QString &installerPath)
|
||||||
{
|
{
|
||||||
// Create temporary directory for extraction
|
QFile::setPermissions(installerPath, QFile::permissions(installerPath) | QFile::ExeUser);
|
||||||
QTemporaryDir extractDir;
|
|
||||||
extractDir.setAutoRemove(false);
|
|
||||||
if (!extractDir.isValid()) {
|
|
||||||
logger.error() << "Failed to create temporary directory";
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
logger.info() << "Temporary directory created:" << extractDir.path();
|
|
||||||
|
|
||||||
// Create script file in the temporary directory
|
|
||||||
QString scriptPath = extractDir.path() + "/installer.sh";
|
|
||||||
QFile scriptFile(scriptPath);
|
|
||||||
if (!scriptFile.open(QIODevice::WriteOnly)) {
|
|
||||||
logger.error() << "Failed to create script file";
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get script content from registry
|
|
||||||
QString scriptContent = amnezia::scriptData(amnezia::ClientScriptType::linux_installer);
|
|
||||||
scriptFile.write(scriptContent.toUtf8());
|
|
||||||
scriptFile.close();
|
|
||||||
logger.info() << "Script file created:" << scriptPath;
|
|
||||||
|
|
||||||
// Make script executable
|
|
||||||
QFile::setPermissions(scriptPath, QFile::permissions(scriptPath) | QFile::ExeUser);
|
|
||||||
|
|
||||||
// Start detached process
|
|
||||||
qint64 pid;
|
qint64 pid;
|
||||||
bool success =
|
bool success = QProcess::startDetached(installerPath, QStringList(), QString(), &pid);
|
||||||
QProcess::startDetached("/bin/bash", QStringList() << scriptPath << extractDir.path() << installerPath, extractDir.path(), &pid);
|
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
logger.info() << "Installation process started with PID:" << pid;
|
logger.info() << "Installation process started with PID:" << pid;
|
||||||
@@ -387,5 +361,3 @@ int UpdateController::runLinuxInstaller(const QString &installerPath)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ QString amnezia::scriptName(ProtocolScriptType type)
|
|||||||
QString amnezia::scriptName(ClientScriptType type)
|
QString amnezia::scriptName(ClientScriptType type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ClientScriptType::linux_installer: return QLatin1String("linux_installer.sh");
|
|
||||||
case ClientScriptType::mac_installer: return QLatin1String("mac_installer.sh");
|
case ClientScriptType::mac_installer: return QLatin1String("mac_installer.sh");
|
||||||
default: return QString();
|
default: return QString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ enum ProtocolScriptType {
|
|||||||
|
|
||||||
enum ClientScriptType {
|
enum ClientScriptType {
|
||||||
// Client-side scripts
|
// Client-side scripts
|
||||||
linux_installer,
|
|
||||||
mac_installer
|
mac_installer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user