Add sat package --build_msi to build a Windows MSI installer#6
Open
mariam-simvia wants to merge 1 commit into
Open
Add sat package --build_msi to build a Windows MSI installer#6mariam-simvia wants to merge 1 commit into
mariam-simvia wants to merge 1 commit into
Conversation
Add a generic MSI builder (src/msi.py) and a --build_msi option to the package command. On Windows, it assembles a staging tree from the application install output plus the project's installer resources, runs an optional project staging script, generates a WiX v4 source (one Component per directory, to stay under MSI's 65536-component limit), and invokes 'wix build'. The builder is project-agnostic: all project-specific data (WiX Package.wxs, branding, launchers, product->ComponentGroup map, product exclusions) comes from an APPLICATION.installer config section provided by the project (e.g. sat_salome/installer/windows for SALOME).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@mohd-afeef-badri @nitawa as discussed during our video call a few weeks ago, here are the changes needed in SAT to implement a Windows build mechanism.
What it does
Adds a
--build_msioption to thepackagecommand. On Windows, it builds an MSI installer of an application from its compiled files:The code added to SAT is generic: it knows nothing about SALOME. Everything specific to SALOME (the WiX files, the launchers, the icon, the product list) is provided by the project in an
installersection of its config. So this can build an MSI for any project, not just SALOME.Files
commands/package.py--build_msioption and calls the buildersrc/msi.pywix build)How it works
One component per folder (not per file): SALOME has about 156,000 files. With one component per file the MSI would go over its hard limit of 65,536 components. Grouping files by folder keeps it around 10,000.
The
installerconfig sectionThe project provides it (for SALOME it is in
salome-W10.pyconf). SAT reads it; nothing is hard-coded in SAT. It contains:resources_dir: where the WiX files and launchers arewxs_sources: the WiX source files to compile (Package.wxs,shortcuts.wxs)pre_build_script: an optional script SAT runs before buildingwix_arch,wix_extensions: the architecture and the WiX extensions passed towix buildgenerated_wxs,guid_namespace,staging_dir: name of the generated file, GUID namespace, and (optional) where to buildtree: the rules to walk the install: which top-level files/folders to include (root_install_files,install_dirs), which folders/products to skip (skip_dirs,skip_products), and how each product folder maps to a WiX component group (product_groups)SAT looks for this section first on the application, then on the project, so one definition can serve all the project's applications.
Usage
Result:
<workdir>\MSI\build\<app>-win64.msi. Use--nameto change the file name.Requirements
Windows, WiX Toolset v4 or higher on PATH, and a project that defines the
installersection. If something is missing, the command stops with a clear message (no half-built output).Testing
Impact
Optional and additive. Without
--build_msi,packagebehaves exactly as before. On non-Windows it just prints a "Windows only" message. No SALOME-specific data is added to SAT.