Cleanup berfore uninstall, post-uninstall refactoring

This commit is contained in:
pokamest 2022-01-31 00:10:51 +03:00
parent d24f6ae064
commit 1269114074
10 changed files with 18 additions and 47 deletions

View file

@ -2,5 +2,5 @@ TEMPLATE = subdirs
SUBDIRS = client
!ios:!android {
SUBDIRS += service platform
SUBDIRS += service
}

View file

@ -70,7 +70,6 @@ rem if not exist "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%" break
echo "Deploying..."
copy "%WORK_DIR:"=%\service\server\release\%APP_NAME:"=%-service.exe" %OUT_APP_DIR%
copy "%WORK_DIR:"=%\platform\post-uninstall\release\post-uninstall.exe" %OUT_APP_DIR%
echo "Signing exe"
cd %OUT_APP_DIR%
@ -84,8 +83,6 @@ echo "Copying deploy data..."
xcopy %DEPLOY_DATA_DIR% %OUT_APP_DIR% /s /e /y /i /f
copy "%WORK_DIR:"=%\service\wireguard-service\release\wireguard-service.exe" %OUT_APP_DIR%\wireguard\
del %OUT_APP_DIR%\botand.dll
cd %SCRIPT_DIR%
xcopy %SCRIPT_DIR:"=%\installer %RELEASE_DIR:"=%\installer /s /e /y /i /f
mkdir %INSTALLER_DATA_DIR%

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
set AmneziaPath=%~dp0
echo %AmneziaPath%
"%AmneziaPath%\AmneziaVPN.exe" -c
timeout /t 1
sc stop AmneziaVPN-service
sc delete AmneziaVPN-service

View file

@ -0,0 +1,7 @@
set AmneziaPath=%~dp0
echo %AmneziaPath%
"%AmneziaPath%\AmneziaVPN.exe" -c
timeout /t 1
sc stop AmneziaVPN-service
sc delete AmneziaVPN-service

View file

@ -84,10 +84,11 @@ Component.prototype.createOperations = function()
console.log("Microsoft Visual C++ 2017 Redistributable already installed");
}
let pu_path = installer.value("TargetDir").replace(/\//g, '\\') + "\\"
component.addElevatedOperation("Execute",
["sc", "create", serviceName(), "binpath=", installer.value("TargetDir").replace(/\//g, '\\') + "\\" + serviceName() + ".exe",
["sc", "create", serviceName(), "binpath=", pu_path + serviceName() + ".exe",
"start=", "auto", "depend=", "BFE/nsi"],
"UNDOEXECUTE", ["post-uninstall.exe"]);
"UNDOEXECUTE", "cmd", "/c", pu_path + "post_uninstall.cmd");
} else if (runningOnMacOS()) {
component.addElevatedOperation("Execute", "@TargetDir@/post_install.sh", "UNDOEXECUTE", "@TargetDir@/post_uninstall.sh");

View file

@ -1,4 +0,0 @@
TEMPLATE = subdirs
win32 {
SUBDIRS += post-uninstall
}

View file

@ -1,21 +0,0 @@
#include <QCoreApplication>
#include <QProcess>
#include "defines.h"
bool executeProcess(const QString& cmd, const QStringList& args)
{
QProcess process;
process.start(cmd, args);
return process.waitForFinished();
}
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
executeProcess("sc", QStringList() << "stop" << SERVICE_NAME);
executeProcess("sc", QStringList() << "delete" << SERVICE_NAME);
return 0;
}

View file

@ -1,16 +0,0 @@
TARGET = post-uninstall
TEMPLATE = app
CONFIG += console qt
QT = core
SOURCES = \
main.cpp
#CONFIG(release, debug|release) {
# DESTDIR = $$PWD/../../../AmneziaVPN-build/post-uninstall/release
# MOC_DIR = $$DESTDIR
# OBJECTS_DIR = $$DESTDIR
# RCC_DIR = $$DESTDIR
#}
INCLUDEPATH += "$$PWD/../../client"