Skip to content

Commit

Permalink
Merge pull request #6009 from BOINC/vko_fix_win_installer_for_pr
Browse files Browse the repository at this point in the history
[windows] Fix and optimize Windows installer
  • Loading branch information
AenBleidd authored Jan 15, 2025
2 parents 0e2cd22 + 9136f5e commit 8114159
Show file tree
Hide file tree
Showing 98 changed files with 3,743 additions and 510 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ jobs:
run: |
python ./ci_tools/create_signing_metadata.py "${{ env.DMDF }}" "${{ env.AZURE_ENDPOINT }}" "${{ env.AZURE_CODE_SIGNING_NAME }}" "${{ env.AZURE_CERT_PROFILE_NAME }}"
- name: Install MsiVal2 and Orca tools
if: success() && matrix.type == 'msbuild' && !startsWith(github.ref, 'refs/tags/')
shell: powershell
run: |
md -Force ./temp
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\MsiVal2-x86_en-us.msi' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\8e4755178e6b5bcba8d3538c3630b7a5.cab' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\b80b7321357f7c9f281536f9440dfe68.cab' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\c2aabf6ea5c1d348ec22f3aeb92f8656.cab' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\Orca-x86_en-us.msi' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\838060235bcd28bf40ef7532c50ee032.cab' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\a35cd6c9233b6ba3da66eecaa9190436.cab' ./temp/
cp 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\fe38b2fd0d440e3c6740b626f51a22fc.cab' ./temp/
Start-Process "msiexec.exe" -ArgumentList "/i temp\MsiVal2-x86_en-us.msi" -Wait
Start-Process "msiexec.exe" -ArgumentList "/i temp\Orca-x86_en-us.msi" -Wait
- name: Build
if: success() && matrix.type == 'msbuild'
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
Expand All @@ -119,6 +135,10 @@ jobs:
working-directory: win_build\Build\${{matrix.platform}}\${{matrix.configuration}}
run: ${{github.workspace}}\temp\OpenCppCoverage\OpenCppCoverage-x64\OpenCppCoverage.exe --cover_children --optimized_build --sources ${{github.workspace}} --export_type=cobertura:cobertura.xml -- unittests.exe --gtest_output=xml:gtest.xml

- name: Verify MSI file
if: success() && matrix.type == 'msbuild' && !startsWith(github.ref, 'refs/tags/')
run: python ./tests/msi_validation.py "C:\Program Files (x86)\MsiVal2\MsiVal2.exe" "${{github.workspace}}\win_build\Build\${{matrix.platform}}\${{matrix.configuration}}\boinc.msi" "${{github.workspace}}\installer\darice.cub"

- name: Run installation
if: success() && matrix.platform == 'x64' && matrix.type == 'msbuild'
shell: powershell
Expand Down
1 change: 1 addition & 0 deletions ci_tools/source_code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def check(directory, bytes_to_check, exclude_dirs, exclude_extensions, exclude_f
exclude_extensions = [
".a",
".bmp",
".cub",
".dll",
".exe",
".gif",
Expand Down
1 change: 1 addition & 0 deletions ci_tools/trailing_whitespaces_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def check(directory, exclude_dirs, exclude_extensions, exclude_files, fix_errors
exclude_extensions = [
".a",
".bmp",
".cub",
".dll",
".exe",
".gif",
Expand Down
7 changes: 6 additions & 1 deletion clientsetup/win/boinccas.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Berkeley Open Infrastructure for Network Computing
// http://boinc.berkeley.edu
// Copyright (C) 2005 University of California
// Copyright (C) 2025 University of California
//
// This is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -841,6 +841,11 @@ UINT BOINCCABase::GetComponentKeyFilename(
// Save the string
strComponentKeyFilename = szBuffer;

// strComponentKeyFilename format is [strComponentName]_[filename]
// Remove the component name from the string
strComponentKeyFilename =
strComponentKeyFilename.substr(strComponentName.size() + 1);

strMessage = _T("The key filename for component '");
strMessage += strComponentName;
strMessage += _T("' is '");
Expand Down
4 changes: 1 addition & 3 deletions installer/ActionText.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
// Copyright (C) 2025 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -15,8 +15,6 @@
// 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 <sstream>

#include "ActionText.h"
#include "MsiHelper.h"
#include "JsonHelper.h"
Expand Down
49 changes: 47 additions & 2 deletions installer/ActionTextTable.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
// Copyright (C) 2025 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -20,11 +20,56 @@
#include "ActionTextTable.h"

ActionTextTable::ActionTextTable(const nlohmann::json& json,
InstallerStrings& installerStrings) {
InstallerStrings& installerStrings,
std::shared_ptr<ValidationTable> validationTable) {
std::cout << "Loading ActionTextTable..." << std::endl;
for (const auto& item : json) {
values.emplace_back(item, installerStrings);
}
const auto tableName = std::string("ActionText");
const auto url = "https://learn.microsoft.com/en-us/windows/win32/msi/actiontext-table";
if (validationTable != nullptr) {
validationTable->add(Validation(
tableName,
"Action",
false,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryIdentifier,
"",
DescriptionWithUrl("Name of the action.", url)
));
validationTable->add(Validation(
tableName,
"Description",
true,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryText,
"",
DescriptionWithUrl("Localized description that is displayed in "
"the progress dialog box, or written to the log when the "
"action is executing.", url)
));
validationTable->add(Validation(
tableName,
"Template",
true,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryTemplate,
"",
DescriptionWithUrl("A localized format template that is used to "
"format action data records to display during action "
"execution.", url)
));
}
}

bool ActionTextTable::generate(MSIHANDLE hDatabase) {
Expand Down
6 changes: 4 additions & 2 deletions installer/ActionTextTable.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
// Copyright (C) 2025 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -22,11 +22,13 @@
#include "ActionText.h"
#include "InstallerStrings.h"
#include "Generator.h"
#include "ValidationTable.h"

class ActionTextTable : public Generator<ActionText>{
public:
explicit ActionTextTable(const nlohmann::json& json,
InstallerStrings& installerStrings);
InstallerStrings& installerStrings,
std::shared_ptr<ValidationTable> validationTable);
~ActionTextTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
Expand Down
47 changes: 45 additions & 2 deletions installer/AdminExecuteSequenceTable.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
// Copyright (C) 2025 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -18,12 +18,55 @@
#include "AdminExecuteSequenceTable.h"

AdminExecuteSequenceTable::AdminExecuteSequenceTable(
const nlohmann::json& json) {
const nlohmann::json& json,
std::shared_ptr<ValidationTable> validationTable) {
std::cout << "Loading AdminExecuteSequenceTable..." << std::endl;

for (const auto& value : json) {
actions.emplace_back(value);
}

const auto tableName = std::string("AdminExecuteSequence");
const auto url = "https://learn.microsoft.com/en-us/windows/win32/msi/adminexecutesequence-table";
if (validationTable != nullptr) {
validationTable->add(Validation(
tableName,
"Action",
false,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryIdentifier,
"",
DescriptionWithUrl("Name of the action to execute.", url)
));
validationTable->add(Validation(
tableName,
"Condition",
true,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryCondition,
"",
DescriptionWithUrl("Logical expression.", url)
));
validationTable->add(Validation(
tableName,
"Sequence",
true,
-4,
32767,
"",
MSI_NULL_INTEGER,
"",
"",
DescriptionWithUrl("A positive value indicates the "
"sequence position of the action.", url)
));
}
}

bool AdminExecuteSequenceTable::generate(MSIHANDLE hDatabase) {
Expand Down
6 changes: 4 additions & 2 deletions installer/AdminExecuteSequenceTable.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
// Copyright (C) 2025 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -22,10 +22,12 @@

#include "Action.h"
#include "Generator.h"
#include "ValidationTable.h"

class AdminExecuteSequenceTable : public Generator<Action>{
public:
explicit AdminExecuteSequenceTable(const nlohmann::json& json);
explicit AdminExecuteSequenceTable(const nlohmann::json& json,
std::shared_ptr<ValidationTable> validationTable);
~AdminExecuteSequenceTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
Expand Down
47 changes: 46 additions & 1 deletion installer/AdminUISequenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,56 @@

#include "AdminUISequenceTable.h"

AdminUISequenceTable::AdminUISequenceTable(const nlohmann::json& json) {
AdminUISequenceTable::AdminUISequenceTable(const nlohmann::json& json,
std::shared_ptr<ValidationTable> validationTable) {
std::cout << "Loading AdminUISequenceTable..." << std::endl;
for (const auto& value : json) {
actions.emplace_back(value);
}

const auto tableName = std::string("AdminUISequence");
const auto url = "https://learn.microsoft.com/en-us/windows/win32/msi/adminuisequence-table";
if (validationTable != nullptr) {
validationTable->add(Validation(
tableName,
"Action",
false,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryIdentifier,
"",
DescriptionWithUrl("Name of the action to execute.", url)
));
validationTable->add(Validation(
tableName,
"Condition",
true,
MSI_NULL_INTEGER,
MSI_NULL_INTEGER,
"",
MSI_NULL_INTEGER,
ValidationCategoryCondition,
"",
DescriptionWithUrl("Logical expression.", url)
));
validationTable->add(Validation(
tableName,
"Sequence",
true,
-4,
32767,
"",
MSI_NULL_INTEGER,
"",
"",
DescriptionWithUrl("A positive value indicates the sequence "
"position of the action. The negative values indicate that "
"the action is called if the installer returns the "
"termination flag.", url)
));
}
}

bool AdminUISequenceTable::generate(MSIHANDLE hDatabase) {
Expand Down
4 changes: 3 additions & 1 deletion installer/AdminUISequencetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@

#include "Action.h"
#include "Generator.h"
#include "ValidationTable.h"

class AdminUISequenceTable : public Generator<Action> {
public:
explicit AdminUISequenceTable(const nlohmann::json& json);
explicit AdminUISequenceTable(const nlohmann::json& json,
std::shared_ptr<ValidationTable> validationTable);
~AdminUISequenceTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
Expand Down
Loading

0 comments on commit 8114159

Please sign in to comment.