From bc04447ffad1d13ede6df84c8938fcc2599de74b Mon Sep 17 00:00:00 2001 From: SimplestStudio Date: Tue, 24 Oct 2023 07:10:33 +0300 Subject: [PATCH 1/3] [win] delete update folder when uninstalling application --- win-linux/package/windows/common.iss | 1 + win-linux/package/windows/defines.iss | 1 + 2 files changed, 2 insertions(+) diff --git a/win-linux/package/windows/common.iss b/win-linux/package/windows/common.iss index 64eb55b61..676269224 100644 --- a/win-linux/package/windows/common.iss +++ b/win-linux/package/windows/common.iss @@ -1044,6 +1044,7 @@ Root: HKLM; Subkey: "SOFTWARE\Classes\{#sAppProtocol}\Shell\Open\Command"; Value [UninstallDelete] Type: filesandordirs; Name: {commonappdata}\{#APP_PATH}\*; AfterInstall: RefreshEnvironment; +Type: filesandordirs; Name: "{app}\..\{#UPD_PATH}"; Type: files; Name: "{app}\new_word.bat"; Type: files; Name: "{app}\new_cell.bat"; Type: files; Name: "{app}\new_slide.bat"; diff --git a/win-linux/package/windows/defines.iss b/win-linux/package/windows/defines.iss index 36ddc2e5b..0b2050308 100644 --- a/win-linux/package/windows/defines.iss +++ b/win-linux/package/windows/defines.iss @@ -14,6 +14,7 @@ #define sAppProtocol 'oo-office' #define APP_PATH str(sIntCompanyName + "\" + sIntProductName) +#define UPD_PATH str(sIntProductName + "Updates") #define APP_REG_PATH str("Software\" + APP_PATH) #ifndef DEPLOY_PATH #define DEPLOY_PATH str("..\..\..\..\build_tools\out\" + sPlatformFull + "\" + APP_PATH) From 4eec1e8364af105212b29429243d79c8eb832e78 Mon Sep 17 00:00:00 2001 From: SimplestStudio Date: Tue, 24 Oct 2023 07:11:17 +0300 Subject: [PATCH 2/3] [win-linux] delete outdated update folder --- win-linux/extras/update-daemon/src/classes/csvcmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp b/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp index 54e603fcd..3a1fa9757 100644 --- a/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp +++ b/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp @@ -441,6 +441,9 @@ void CSvcManager::clearTempFiles(const tstring &prefix, const tstring &except) NS_File::removeFile(filePath); } } + tstring updPath = NS_File::parentPath(NS_File::appPath()) + UPDATE_PATH; + if (except.empty() && NS_File::dirExists(updPath)) + NS_File::removeDirRecursively(updPath); }); } From a80fbe48abbe26adda3b0682c22c27b5652765db Mon Sep 17 00:00:00 2001 From: SimplestStudio Date: Tue, 24 Oct 2023 07:23:56 +0300 Subject: [PATCH 3/3] [win-linux] speed up application restart after update --- win-linux/extras/update-daemon/src/classes/csvcmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp b/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp index 3a1fa9757..1ca369426 100644 --- a/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp +++ b/win-linux/extras/update-daemon/src/classes/csvcmanager.cpp @@ -595,15 +595,15 @@ void CSvcManager::startReplacingFiles(const tstring &packageType, const bool res } } - // Remove Backup dir - NS_File::removeDirRecursively(tmpPath); - // Restart program if (restartAfterUpdate) { if (!NS_File::runProcess(appPath + APP_LAUNCH_NAME, _T(""))) NS_Logger::WriteLog(_T("An error occurred while restarting the program!"), true); } + // Remove Backup dir + NS_File::removeDirRecursively(tmpPath); + // Restart service #ifdef _WIN32 restartService();