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

@ -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");