From 71dc18aaa2a57531c95465dbab302987d6562e76 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 1 Sep 2024 17:20:01 +0200 Subject: Windows: Fix MSI not installing all new documentation file. Remove old files left from old versions. Increment version to 1.26.15. --- src/Setup/Setup.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/Setup/Setup.c') diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index dc8c8ccc..43ea971b 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -2016,6 +2016,37 @@ error: return bOK; } +void RemoveLegacyFiles (wchar_t *szDestDir) +{ + const wchar_t* oldFileNames[] = { + L"docs\\html\\en\\BCH_Logo_48x30.png", + L"docs\\html\\en\\LinuxPrepAndBuild.sh", + L"docs\\html\\en\\LinuxPrepAndBuild.zip", + L"docs\\html\\en\\RIPEMD-160.html", + L"docs\\html\\en\\ru\\BCH_Logo_48x30.png", + L"Languages\\Language.ru - Copy.xml", + }; + wchar_t szDir[TC_MAX_PATH]; + wchar_t oldPath[TC_MAX_PATH]; + BOOL bSlash; + size_t x, i; + + StringCbCopyW (szDir, sizeof(szDir), szDestDir); + x = wcslen (szDestDir); + if (szDestDir[x - 1] == L'\\') + bSlash = TRUE; + else + bSlash = FALSE; + + if (bSlash == FALSE) + StringCbCatW (szDir, sizeof(szDir), L"\\"); + + for (i = 0; i < ARRAYSIZE(oldFileNames); i++) + { + StringCbPrintfW (oldPath, sizeof(oldPath), L"%s%s", szDestDir, oldFileNames[i]); + StatDeleteFile (oldPath, FALSE); + } +} void OutcomePrompt (HWND hwndDlg, BOOL bOK) { @@ -2199,7 +2230,6 @@ void DoInstall (void *arg) HWND hwndDlg = (HWND) arg; BOOL bOK = TRUE; wchar_t path[MAX_PATH]; - BootEncryption bootEnc (hwndDlg); // Refresh the main GUI (wizard thread) @@ -2343,6 +2373,12 @@ void DoInstall (void *arg) bRestartRequired = TRUE; // Restart is required to apply the new memory protection settings } + if (bOK && bUpgrade) + { + // delete legacy files + RemoveLegacyFiles (InstallationPath); + } + if (bOK) { UpdateProgressBarProc(100); -- cgit v1.2.3