Skip to content

Commit

Permalink
[Windows] Create new installer.
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Koshura <[email protected]>
Co-authored-by: Vittorio Parrella <[email protected]>
Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd and parvit committed Nov 19, 2024
1 parent a63fad3 commit dde82da
Show file tree
Hide file tree
Showing 198 changed files with 23,028 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,4 @@ parts/
prime/
stage/
*.snap
*.msi
3 changes: 2 additions & 1 deletion 3rdParty/vcpkg_ports/configs/msbuild/ARM64/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"default-features": false
},
"gtest",
"opencl"
"opencl",
"nlohmann-json"
]
}
3 changes: 2 additions & 1 deletion 3rdParty/vcpkg_ports/configs/msbuild/x64/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"gtest",
"ftgl",
"opencl"
"opencl",
"nlohmann-json"
]
}
8 changes: 8 additions & 0 deletions deploy/prepare_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@
windows_installer_list = [
'./win_build/Build/x64/Release/boinccas.dll',
'./win_build/Build/ARM64/Release/boinccas.dll',
'./win_build/Build/x64/Release/installer_icon.exe',
'./win_build/Build/ARM64/Release/installer_icon.exe',
'./win_build/Build/x64/Release/installer.exe',
'./win_build/Build/ARM64/Release/installer.exe',
'./win_build/Build/x64/Release/boinc.msi',
'./win_build/Build/ARM64/Release/boinc.msi',
'./win_build/Build/x64/Release/installer_setup.exe',
'./win_build/Build/ARM64/Release/installer_setup.exe',
]

wasm_client_list = [
Expand Down
32 changes: 32 additions & 0 deletions installer/Action.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// 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 "Action.h"
#include "MsiHelper.h"
#include "JsonHelper.h"

Action::Action(const nlohmann::json& json) {
JsonHelper::get(json, "Action", action);
JsonHelper::get(json, "Condition", condition);
JsonHelper::get(json, "Sequence", sequence);
}

MSIHANDLE Action::getRecord() const {
return MsiHelper::MsiRecordSet({ action, condition, sequence });
}
34 changes: 34 additions & 0 deletions installer/Action.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <sstream>
#include <nlohmann/json.hpp>

#include "Record.h"

class Action : public Record {
public:
explicit Action(const nlohmann::json& json);
~Action() = default;
MSIHANDLE getRecord() const override;
private:
std::string action{};
std::string condition{};
int sequence = 0;
};
33 changes: 33 additions & 0 deletions installer/ActionText.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// 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"

ActionText::ActionText(const nlohmann::json& json,
const InstallerStrings& installerStrings) {
JsonHelper::get(json, "Action", action);
JsonHelper::get(json, "Description", description, installerStrings);
JsonHelper::get(json, "Template", tmplt, installerStrings);
}

MSIHANDLE ActionText::getRecord() const {
return MsiHelper::MsiRecordSet({ action, description, tmplt });
}
35 changes: 35 additions & 0 deletions installer/ActionText.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <nlohmann/json.hpp>

#include "Record.h"
#include "InstallerStrings.h"

class ActionText : public Record {
public:
explicit ActionText(const nlohmann::json& json,
const InstallerStrings& installerStrings);
~ActionText() = default;
MSIHANDLE getRecord() const override;
private:
std::string action{};
std::string description{};
std::string tmplt{};
};
40 changes: 40 additions & 0 deletions installer/ActionTextTable.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// 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 <iostream>

#include "ActionTextTable.h"

ActionTextTable::ActionTextTable(const nlohmann::json& json,
const InstallerStrings& installerStrings) {
std::cout << "Loading ActionTextTable..." << std::endl;
for (const auto& item : json) {
values.emplace_back(item, installerStrings);
}
}

bool ActionTextTable::generate(MSIHANDLE hDatabase) {
std::cout << "Generating ActionTextTable..." << std::endl;

const auto sql_create = "CREATE TABLE `ActionText` "
"(`Action` CHAR(72) NOT NULL, `Description` LONGCHAR LOCALIZABLE, "
"`Template` LONGCHAR LOCALIZABLE PRIMARY KEY `Action`)";
const auto sql_insert = "INSERT INTO `ActionText` "
"(`Action`, `Description`, `Template`) VALUES (?, ?, ?)";

return Generator::generate(hDatabase, sql_create, sql_insert, values);
}
35 changes: 35 additions & 0 deletions installer/ActionTextTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <nlohmann/json.hpp>

#include "ActionText.h"
#include "InstallerStrings.h"
#include "Generator.h"

class ActionTextTable : public Generator<ActionText>{
public:
explicit ActionTextTable(const nlohmann::json& json,
const InstallerStrings& installerStrings);
~ActionTextTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
std::vector<ActionText> values{};
};

39 changes: 39 additions & 0 deletions installer/AdminExecuteSequenceTable.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// 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 "AdminExecuteSequenceTable.h"

AdminExecuteSequenceTable::AdminExecuteSequenceTable(
const nlohmann::json& json) {
std::cout << "Loading AdminExecuteSequenceTable..." << std::endl;

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

bool AdminExecuteSequenceTable::generate(MSIHANDLE hDatabase) {
std::cout << "Generating AdminExecuteSequenceTable..." << std::endl;

const auto sql_create = "CREATE TABLE `AdminExecuteSequence` "
"(`Action` CHAR(72) NOT NULL, `Condition` CHAR(255), "
"`Sequence` SHORT PRIMARY KEY `Action`)";
const auto sql_insert = "INSERT INTO `AdminExecuteSequence` "
"(`Action`, `Condition`, `Sequence`) VALUES (?, ?, ?)";

return Generator::generate(hDatabase, sql_create, sql_insert, actions);
}
34 changes: 34 additions & 0 deletions installer/AdminExecuteSequenceTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <vector>
#include <nlohmann/json.hpp>

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

class AdminExecuteSequenceTable : public Generator<Action>{
public:
explicit AdminExecuteSequenceTable(const nlohmann::json& json);
~AdminExecuteSequenceTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
std::vector<Action> actions{};
};

37 changes: 37 additions & 0 deletions installer/AdminUISequenceTable.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// 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 "AdminUISequenceTable.h"

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

bool AdminUISequenceTable::generate(MSIHANDLE hDatabase) {
std::cout << "Generating AdminUISequenceTable..." << std::endl;

const auto sql_create = "CREATE TABLE `AdminUISequence` "
"(`Action` CHAR(72) NOT NULL, `Condition` CHAR(255), "
"`Sequence` SHORT PRIMARY KEY `Action`)";
const auto sql_insert = "INSERT INTO `AdminUISequence` "
"(`Action`, `Condition`, `Sequence`) VALUES (?, ?, ?)";

return Generator::generate(hDatabase, sql_create, sql_insert, actions);
}
30 changes: 30 additions & 0 deletions installer/AdminUISequencetable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2024 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
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

#pragma once

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

class AdminUISequenceTable : public Generator<Action> {
public:
explicit AdminUISequenceTable(const nlohmann::json& json);
~AdminUISequenceTable() = default;
bool generate(MSIHANDLE hDatabase) override;
private:
std::vector<Action> actions{};
};
Loading

0 comments on commit dde82da

Please sign in to comment.