feat(install): generate WiX sources for MSI packaging
This commit is contained in:
1 parent
e63ec85809
commit
fd9e8673c0
7 files changed
+182
-25
No files matched your search
+25
-3
@@ -1068,6 +1068,29 @@ void build(Void::Build::Project &p) {
|
||||
Void::Testing::expect(sign_res.has_value() && !sign_res->succeeded());
|
||||
}
|
||||
|
||||
// WiX source generator for MSI packaging on Windows.
|
||||
const auto wix_source = tmp / "cli_hi.wxs";
|
||||
auto wix_req = inst_req;
|
||||
for (auto &arg : wix_req.arguments) {
|
||||
if (arg == installer_archive.string()) {
|
||||
arg = wix_source.string();
|
||||
}
|
||||
}
|
||||
wix_req.arguments.push_back("--archive-format");
|
||||
wix_req.arguments.push_back("wix");
|
||||
auto wix_res = Platform::run_supervised(wix_req);
|
||||
Void::Testing::expect(wix_res.has_value() && wix_res->succeeded());
|
||||
auto wix_text = Void::FileSystem::read_file(wix_source);
|
||||
Void::Testing::require(wix_text.has_value());
|
||||
Void::Testing::expect(wix_text->starts_with("<?xml"));
|
||||
Void::Testing::expect(wix_text->find("<Product Id=") != std::string::npos);
|
||||
Void::Testing::expect(wix_text->find("Name=\"CliHiPkg\"") != std::string::npos);
|
||||
Void::Testing::expect(wix_text->find("Version=\"0.1.0\"") != std::string::npos);
|
||||
Void::Testing::expect(wix_text->find("UpgradeCode=") != std::string::npos);
|
||||
Void::Testing::expect(wix_text->find("Source=\"bin/cli_hi\"") != std::string::npos);
|
||||
Void::Testing::expect(wix_text->find("ComponentGroup Id=\"ProductComponents\"") !=
|
||||
std::string::npos);
|
||||
|
||||
// RPM package generator: lead + header magic + newc cpio payload.
|
||||
const auto rpm_archive = tmp / "cli_hi.rpm";
|
||||
auto rpm_req = inst_req;
|
||||
@@ -1161,9 +1184,8 @@ VOID_TEST(FullV1Tests, ide_plugin_assets_export_vscode_extension) {
|
||||
auto clion_report = Editor::generate_ide_plugin_assets(clion_options);
|
||||
Void::Testing::require(clion_report.has_value());
|
||||
Void::Testing::expect_eq(clion_report->written_files.size(), std::size_t{4});
|
||||
auto plugin_xml =
|
||||
Void::FileSystem::read_file(clion_options.output_dir / "src" / "main" / "resources" /
|
||||
"META-INF" / "plugin.xml");
|
||||
auto plugin_xml = Void::FileSystem::read_file(clion_options.output_dir / "src" / "main" /
|
||||
"resources" / "META-INF" / "plugin.xml");
|
||||
Void::Testing::require(plugin_xml.has_value());
|
||||
Void::Testing::expect(plugin_xml->find("<id>com.faumaray.vbs</id>") != std::string::npos);
|
||||
Void::Testing::expect(std::filesystem::exists(clion_options.output_dir / "build.gradle.kts"));
|
||||
|
||||
Reference in new issue
Block a user