Skip to content
Draft
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
9286100
Add AnnounceUpgrade test to the module boinccas module tests.
AenBleidd Nov 1, 2025
2795f4f
Fix issues
AenBleidd Nov 1, 2025
c9292c1
Add debug logic
AenBleidd Nov 1, 2025
b0b37ff
Fix unit tests
AenBleidd Nov 1, 2025
bcba607
debug
AenBleidd Nov 1, 2025
0e69878
fix
AenBleidd Nov 2, 2025
74c71ec
Fix test
AenBleidd Nov 2, 2025
d857b99
Revert debug changes
AenBleidd Nov 2, 2025
61a5987
Fix test
AenBleidd Nov 2, 2025
c754f2f
Test fix?
AenBleidd Nov 2, 2025
5629c57
Try to fix the test
AenBleidd Nov 2, 2025
ff99c7c
Fix tests
AenBleidd Nov 2, 2025
958a916
Fix test split
AenBleidd Nov 2, 2025
5ef88a2
Refactoring CAAnnounceUpgrade class
AenBleidd Nov 2, 2025
e34873c
Reenable test
AenBleidd Nov 2, 2025
577a442
Fix tests
AenBleidd Nov 2, 2025
f629d56
Optimize tests
AenBleidd Nov 2, 2025
1d806a4
Add CACleanupOldBinaries test
AenBleidd Nov 3, 2025
1c8c299
Refactor CACleanupOldBinaries class
AenBleidd Nov 3, 2025
d8b39a3
Small refactoring, add tinyxml2 library to the vcpkg list for Windows…
AenBleidd Nov 4, 2025
28c1668
Add CACreateAcctMgrLoginFile tests
AenBleidd Nov 4, 2025
5a8d1f2
Refactor CACreateAcctMgrLoginFile class
AenBleidd Nov 4, 2025
8bf9368
Enable CreateAcctMgrLoginFile tests
AenBleidd Nov 5, 2025
18c8124
Add empty CACreateBOINCAccounts test class
AenBleidd Nov 12, 2025
2e88116
Add first CACreateBOINCAccounts test
AenBleidd Dec 8, 2025
9572723
Fix properties insert to opened msi
AenBleidd Dec 8, 2025
54f75c8
Fix set msi property
AenBleidd Dec 8, 2025
a07276f
Remove code that doesn't work
AenBleidd Dec 8, 2025
aae0ef3
Fix tests
AenBleidd Dec 8, 2025
4a87fe2
Actually run tests
AenBleidd Dec 8, 2025
60f32d6
Test general user management
AenBleidd Dec 9, 2025
a4d0f8b
Try debug
AenBleidd Dec 9, 2025
84fd11d
Try to fix test helper functions
AenBleidd Dec 9, 2025
8cc1390
Fix test
AenBleidd Dec 9, 2025
3cf121b
Fix test
AenBleidd Dec 9, 2025
1cfa8b7
First real test for BOINC Accounts class
AenBleidd Dec 10, 2025
3a0279e
Check why tests freeze
AenBleidd Dec 10, 2025
4cfce4a
Fix test
AenBleidd Dec 10, 2025
aad550b
Try to fix the test
AenBleidd Dec 10, 2025
2ade033
Try to fix data reading
AenBleidd Dec 10, 2025
eeb4156
Try fixing helper function
AenBleidd Dec 10, 2025
64a498f
Fix
AenBleidd Dec 10, 2025
dc033b6
Fix
AenBleidd Dec 10, 2025
9a53b50
Add more tests
AenBleidd Dec 10, 2025
769089f
Fix tests
AenBleidd Dec 10, 2025
2c10f83
Test parametrized tests
AenBleidd Dec 11, 2025
39c1f85
Try to fix the test
AenBleidd Dec 11, 2025
398ab6d
Fix tests
AenBleidd Dec 11, 2025
1cb6b36
Enable tests
AenBleidd Dec 11, 2025
dfab523
Fix tests
AenBleidd Dec 11, 2025
673ca9f
Fix test
AenBleidd Dec 11, 2025
e38ba84
Fix test
AenBleidd Dec 11, 2025
6827abb
Refactor CACreateBOINCAccounts class
AenBleidd Dec 11, 2025
a7ca3f6
Small refactoring
AenBleidd Dec 11, 2025
193d81b
Add CACreateBOINCGroups test template
AenBleidd Dec 12, 2025
30b65d6
Refactoring
AenBleidd Dec 13, 2025
0c3eb7b
Verify generated password length
AenBleidd Dec 13, 2025
02716b0
Fix typo
AenBleidd Dec 13, 2025
478ef95
Add CACreateBOINCGroups tests
AenBleidd Dec 16, 2025
dd14142
Fix
AenBleidd Dec 16, 2025
14a60d7
Fix
AenBleidd Dec 16, 2025
1211d50
Don't reboot during the testing
AenBleidd Dec 16, 2025
d813dec
Fix tests
AenBleidd Dec 16, 2025
665349b
Fix tests
AenBleidd Dec 16, 2025
64553ef
Fix tests
AenBleidd Dec 16, 2025
a11576d
Fix tests
AenBleidd Dec 17, 2025
f86ef01
Enable tests
AenBleidd Dec 17, 2025
88eef93
Refactor CreateBOINCGroups class
AenBleidd Dec 17, 2025
c04cbf0
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Jan 18, 2026
d224816
Small improvements
AenBleidd Jan 19, 2026
7823918
Add pch
AenBleidd Jan 20, 2026
2660151
Add test_boinccas_CACreateClientAuthFile.cpp
AenBleidd Jan 20, 2026
dca1b4c
Add test_boinccas_CACreateClientAuthFile.cpp
AenBleidd Jan 20, 2026
7758478
Add test_boinccas_CACreateProjectInitFile
AenBleidd Jan 22, 2026
13398f9
Enable disabled tests
AenBleidd Jan 22, 2026
0b8b533
Add test_boinccas_CADeleteBOINCAccounts
AenBleidd Jan 23, 2026
044d192
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Jan 26, 2026
1c8aa6e
Add test_boinccas_CADeleteBOINCGroups
AenBleidd Jan 29, 2026
043d4f6
Enable disabled tests
AenBleidd Jan 29, 2026
5314872
Remove obsolete CAGetAdministratorsGroupName
AenBleidd Jan 29, 2026
ee64443
Fix msi_validation script
AenBleidd Jan 29, 2026
b86dae1
Fix CACreateClientAuthFile
AenBleidd Feb 6, 2026
fd8c0ae
Revert "Fix CACreateClientAuthFile"
AenBleidd Feb 6, 2026
c8e3a54
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 6, 2026
2257121
Debug generating password
AenBleidd Feb 6, 2026
e2476f6
Debug
AenBleidd Feb 6, 2026
4697837
Debug
AenBleidd Feb 6, 2026
203a635
Might this be a fix?
AenBleidd Feb 6, 2026
ba69666
This is the fix?
AenBleidd Feb 7, 2026
1f05c5e
Build fix
AenBleidd Feb 7, 2026
7b1d322
Refactor
AenBleidd Feb 7, 2026
09fbe66
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 7, 2026
ff1d2f8
Remove temporary workaround from the test
AenBleidd Feb 7, 2026
17f721a
Fix test
AenBleidd Feb 7, 2026
8451c5e
Fix test
AenBleidd Feb 7, 2026
b042446
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 10, 2026
b73f2f5
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 10, 2026
d75de6d
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 11, 2026
76eec20
Remove redundant CAGetUsersGroupName class and merge its functionalit…
AenBleidd Feb 12, 2026
0292644
Small refactoring
AenBleidd Feb 14, 2026
cc3741f
Put back accidentally deleted lines
AenBleidd Feb 14, 2026
c7450f8
Refactoring
AenBleidd Feb 14, 2026
5a141a4
Fix
AenBleidd Feb 14, 2026
f1c70a6
Fix tests
AenBleidd Feb 14, 2026
fc517f3
Add test_boinccas_CAGrantBOINCAdminsRights
AenBleidd Feb 16, 2026
30ec729
Try to fix the crash
AenBleidd Feb 16, 2026
4703343
Try to fix the crash
AenBleidd Feb 16, 2026
914219e
Debug the crash
AenBleidd Feb 16, 2026
4c1bfb8
Possible fix
AenBleidd Feb 16, 2026
eaa83da
Possible fix
AenBleidd Feb 16, 2026
7255010
Possible fix
AenBleidd Feb 16, 2026
cceaddd
Possible fix
AenBleidd Feb 16, 2026
36812ff
Debug
AenBleidd Feb 16, 2026
4ff9db0
More debugging...
AenBleidd Feb 16, 2026
0b227c5
More debugging...
AenBleidd Feb 16, 2026
3d7aee5
This might be a fix...
AenBleidd Feb 16, 2026
fe7e8a9
This might be a fix...
AenBleidd Feb 16, 2026
08fee26
Build fix
AenBleidd Feb 16, 2026
77d8d7b
Possible fix
AenBleidd Feb 16, 2026
788120c
Build fix
AenBleidd Feb 16, 2026
52c646c
Fix test
AenBleidd Feb 16, 2026
010119c
Refactoring
AenBleidd Feb 17, 2026
84c1a46
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Feb 20, 2026
32ce363
Add test_boinccas_CAGrantBOINCAdminsVirtualBoxRights
AenBleidd Mar 2, 2026
b926403
Merge remote-tracking branch 'origin/master' into vko_boinccas_refact…
AenBleidd Mar 2, 2026
1a97e05
Add test_boinccas_CAGrantBOINCMasterRights
AenBleidd Mar 3, 2026
a93d139
Enable disabled tests
AenBleidd Mar 3, 2026
60293de
Add test_boinccas_CAGrantBOINCProjectRights
AenBleidd Mar 4, 2026
486fd20
Add test_boinccas_CAGrantBOINCProjectsRights
AenBleidd Mar 4, 2026
31c694b
Add test_boinccas_CAGrantBOINCProjectsVirtualBoxRights
AenBleidd Mar 4, 2026
3357923
Add test_boinccas_CAGrantBOINCUsersRights
AenBleidd Mar 4, 2026
ae451cb
Add test_boinccas_CALaunchBOINCManager
AenBleidd Mar 5, 2026
d55ca6f
Add test_boinccas_CALaunchBOINCTray
AenBleidd Mar 5, 2026
f5c314f
Add test_boinccas_CARestoreExecutionState
AenBleidd Mar 7, 2026
0a509ac
Add test_boinccas_CARestorePermissionBOINCData
AenBleidd Mar 13, 2026
f50d9d7
Add test_boinccas_CARestoreSetupState
AenBleidd Mar 15, 2026
1f2ee94
Add test_boinccas_CARevokeBOINCAdminsRights
AenBleidd Mar 15, 2026
ef77752
Add test_boinccas_CARevokeBOINCMasterRights
AenBleidd Mar 15, 2026
95a269a
Add test_boinccas_CARevokeBOINCProjectRights
AenBleidd Mar 15, 2026
cbd3590
Add test_boinccas_CARevokeBOINCProjectsRights
AenBleidd Mar 15, 2026
fb1efa5
Add test_boinccas_CARevokeBOINCUsersRights
AenBleidd Mar 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,18 @@ jobs:

- name: Build
if: success()
run: msbuild win_build\boinc.sln -p:Configuration=${{matrix.configuration}} -p:Platform=${{matrix.platform}} -p:VcpkgTripletConfig=ci -p:DLIB=${{ env.DLIB }} -p:DMDF=${{ env.DMDF }} -m
run: msbuild win_build\boinc.sln -p:Configuration=${{matrix.configuration}} -p:Platform=${{matrix.platform}} -p:VcpkgTripletConfig=ci -p:DLIB=${{ env.DLIB }} -p:DMDF=${{ env.DMDF }} -p:BOINCCAS_TEST=true -m
Comment on lines 124 to +126
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change enables BOINCCAS_TEST for every Windows build configuration/platform. Since these tests create/delete local users/groups and write HKLM registry keys, consider gating this define (and/or test execution) to a dedicated job or only the configurations intended for these integration-style tests to reduce CI fragility and side effects.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow enables BOINCCAS_TEST for every Windows build. The BOINCCAS unit tests add/remove local users/groups, change account rights, and write/delete HKLM registry keys; running them unconditionally can destabilize the runner and is risky for contributor forks. Consider gating BOINCCAS_TEST (and/or the destructive tests) behind a dedicated job/label, or adding additional isolation/sandboxing so the tests can’t affect the host system outside the job.

Suggested change
run: msbuild win_build\boinc.sln -p:Configuration=${{matrix.configuration}} -p:Platform=${{matrix.platform}} -p:VcpkgTripletConfig=ci -p:DLIB=${{ env.DLIB }} -p:DMDF=${{ env.DMDF }} -p:BOINCCAS_TEST=true -m
env:
BOINCCAS_TEST: ${{ github.event_name != 'pull_request' && github.repository == 'BOINC/boinc' && 'true' || 'false' }}
run: msbuild win_build\boinc.sln -p:Configuration=${{matrix.configuration}} -p:Platform=${{matrix.platform}} -p:VcpkgTripletConfig=ci -p:DLIB=${{ env.DLIB }} -p:DMDF=${{ env.DMDF }} -p:BOINCCAS_TEST=%BOINCCAS_TEST% -m

Copilot uses AI. Check for mistakes.

- name: Run unit tests
if: success() && matrix.platform == 'x64' && matrix.configuration == 'Release'
working-directory: win_build\Build\${{matrix.platform}}\${{matrix.configuration}}
run: |
${{github.workspace}}\temp\OpenCppCoverage\OpenCppCoverage.exe --cover_children --optimized_build --sources ${{github.workspace}} --export_type=binary:gtest.cov -- unittests.exe --gtest_output=xml:gtest.xml

- name: Run crypt_prog tests
if: success() && matrix.platform == 'x64' && matrix.configuration == 'Release'
working-directory: win_build\Build\${{matrix.platform}}\${{matrix.configuration}}
run: |
${{github.workspace}}\temp\OpenCppCoverage\OpenCppCoverage.exe --cover_children --optimized_build --modules ${{github.workspace}} --sources ${{github.workspace}} --input_coverage=gtest.cov --export_type=cobertura:cobertura.xml -- python ${{github.workspace}}\tests\crypt_prog_tests.py ${{github.workspace}}\win_build\Build\x64\${{matrix.configuration}}\crypt_prog.exe
Comment on lines +134 to 138
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Run crypt_prog tests' step appears to be misplaced in this PR. The PR title indicates it's about adding boinccas module tests, but this change adds a separate crypt_prog test step that seems unrelated to the boinccas tests. This step should either be removed or explained in the PR description.

Suggested change
- name: Run crypt_prog tests
if: success() && matrix.platform == 'x64' && matrix.configuration == 'Release'
working-directory: win_build\Build\${{matrix.platform}}\${{matrix.configuration}}
run: |
${{github.workspace}}\temp\OpenCppCoverage\OpenCppCoverage.exe --cover_children --optimized_build --modules ${{github.workspace}} --sources ${{github.workspace}} --input_coverage=gtest.cov --export_type=cobertura:cobertura.xml -- python ${{github.workspace}}\tests\crypt_prog_tests.py ${{github.workspace}}\win_build\Build\x64\${{matrix.configuration}}\crypt_prog.exe

Copilot uses AI. Check for mistakes.

- name: Verify MSI file
Expand Down
4 changes: 3 additions & 1 deletion 3rdParty/vcpkg_ports/configs/msbuild/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
{
"name": "libzip",
"default-features": false
}
},
"wil",
"tinyxml2"
]
}
116 changes: 43 additions & 73 deletions clientsetup/win/CAAnnounceUpgrade.cpp
Original file line number Diff line number Diff line change
@@ -1,84 +1,54 @@
// Berkeley Open Infrastructure for Network Computing
// http://boinc.berkeley.edu
// Copyright (C) 2005 University of California
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2026 University of California
//
// This is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation;
// either version 2.1 of the License, or (at your option) any later version.
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// To view the GNU Lesser General Public License visit
// http://www.gnu.org/copyleft/lesser.html
// or write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#include "stdafx.h"
#include "boinccas.h"
#include "CAAnnounceUpgrade.h"

#define CUSTOMACTION_NAME _T("CAAnnounceUpgrade")
#define CUSTOMACTION_PROGRESSTITLE _T("Announce the new BOINC version to all components.")


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
CAAnnounceUpgrade::CAAnnounceUpgrade(MSIHANDLE hMSIHandle) :
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
{}


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
CAAnnounceUpgrade::~CAAnnounceUpgrade()
{
BOINCCABase::~BOINCCABase();
}


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
UINT CAAnnounceUpgrade::OnExecution()
{
return SetUpgradeParameters();
class CAAnnounceUpgrade : public BOINCCABase {
public:
virtual ~CAAnnounceUpgrade() = default;

explicit CAAnnounceUpgrade(MSIHANDLE hMSIHandle) :
BOINCCABase(hMSIHandle, _T("CAAnnounceUpgrade"),
_T("Announce the new BOINC version to all components.")) {
}

UINT OnExecution() override final {
tstring strCurrentProductVersion;

auto uiReturnValue = GetProperty(_T("ProductVersion"),
strCurrentProductVersion);
if (uiReturnValue) {
return uiReturnValue;
}
if (strCurrentProductVersion.empty()) {
return ERROR_INSTALL_FAILURE;
}

uiReturnValue = SetRegistryValue(_T("UpgradingTo"),
strCurrentProductVersion);
if (uiReturnValue) {
return uiReturnValue;
}

return ERROR_SUCCESS;
}
};

UINT __stdcall AnnounceUpgrade(MSIHANDLE hInstall) {
return CAAnnounceUpgrade(hInstall).Execute();
}


/////////////////////////////////////////////////////////////////////
//
// Function: AnnounceUpgrade
//
// Description:
//
/////////////////////////////////////////////////////////////////////
UINT __stdcall AnnounceUpgrade(MSIHANDLE hInstall)
{
UINT uiReturnValue = 0;

CAAnnounceUpgrade* pCA = new CAAnnounceUpgrade(hInstall);
uiReturnValue = pCA->Execute();
delete pCA;

return uiReturnValue;
}

36 changes: 0 additions & 36 deletions clientsetup/win/CAAnnounceUpgrade.h

This file was deleted.

150 changes: 58 additions & 92 deletions clientsetup/win/CACleanupOldBinaries.cpp
Original file line number Diff line number Diff line change
@@ -1,103 +1,69 @@
// Berkeley Open Infrastructure for Network Computing
// http://boinc.berkeley.edu
// Copyright (C) 2005 University of California
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2026 University of California
//
// This is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation;
// either version 2.1 of the License, or (at your option) any later version.
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// To view the GNU Lesser General Public License visit
// http://www.gnu.org/copyleft/lesser.html
// or write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#include "stdafx.h"
#include "boinccas.h"
#include "CACleanupOldBinaries.h"

#define CUSTOMACTION_NAME _T("CACleanupOldBinaries")
#define CUSTOMACTION_PROGRESSTITLE _T("Cleanup any old binaries that were left lying around from some other install.")


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
CACleanupOldBinaries::CACleanupOldBinaries(MSIHANDLE hMSIHandle) :
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
{}


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
CACleanupOldBinaries::~CACleanupOldBinaries()
{
BOINCCABase::~BOINCCABase();
}


/////////////////////////////////////////////////////////////////////
//
// Function:
//
// Description:
//
/////////////////////////////////////////////////////////////////////
UINT CACleanupOldBinaries::OnExecution()
{
tstring strInstallDirectory;
UINT uiReturnValue;


uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );
if ( uiReturnValue ) return uiReturnValue;

DeleteFile(tstring(strInstallDirectory + _T("\\boinc.exe")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\boincmgr.exe")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\boinccmd.exe")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\boinc.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\libcurl.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\libeay32.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\ssleay32.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\zlib1.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\dbghelp.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\dbghelp95.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\srcsrv.dll")).c_str());
DeleteFile(tstring(strInstallDirectory + _T("\\symsrv.dll")).c_str());

return ERROR_SUCCESS;
}


/////////////////////////////////////////////////////////////////////
//
// Function: CleanupOldBinaries
//
// Description:
//
/////////////////////////////////////////////////////////////////////
UINT __stdcall CleanupOldBinaries(MSIHANDLE hInstall)
{
UINT uiReturnValue = 0;

CACleanupOldBinaries* pCA = new CACleanupOldBinaries(hInstall);
uiReturnValue = pCA->Execute();
delete pCA;

return uiReturnValue;
class CACleanupOldBinaries : public BOINCCABase {
public:
virtual ~CACleanupOldBinaries() = default;

explicit CACleanupOldBinaries(MSIHANDLE hMSIHandle) :
BOINCCABase(hMSIHandle, _T("CACleanupOldBinaries"),
_T("Cleanup any old binaries that were left lying around from "
"some other install.")) {
}

UINT OnExecution() override final {
tstring strInstallDirectory;

const auto uiReturnValue =
GetProperty(_T("INSTALLDIR"), strInstallDirectory);
if (uiReturnValue != ERROR_SUCCESS) {
return uiReturnValue;
}
if (strInstallDirectory.empty()) {
return ERROR_INSTALL_FAILURE;
}

constexpr std::array<std::wstring_view, 12> filesToDelete = {
_T("boinc.exe"),
_T("boincmgr.exe"),
_T("boinccmd.exe"),
_T("boinc.dll"),
_T("libcurl.dll"),
_T("libeay32.dll"),
_T("ssleay32.dll"),
_T("zlib1.dll"),
_T("dbghelp.dll"),
_T("dbghelp95.dll"),
_T("srcsrv.dll"),
_T("symsrv.dll")
};

for (auto file : filesToDelete) {
DeleteFile(
(strInstallDirectory + _T("\\") + file.data()).c_str());
}

return ERROR_SUCCESS;
}
};

UINT __stdcall CleanupOldBinaries(MSIHANDLE hInstall) {
return CACleanupOldBinaries(hInstall).Execute();
}
37 changes: 0 additions & 37 deletions clientsetup/win/CACleanupOldBinaries.h

This file was deleted.

Loading
Loading