MSI: Add support for installer branding#1235
Conversation
| def write_images(info, dir_path, os="windows"): | ||
| if os == "windows": | ||
| def write_images(info, dir_path, installer_type="exe"): | ||
| if installer_type == "exe": |
There was a problem hiding this comment.
I also learnt today that _schema.py defines class InstallerTypes(StrEnum), I think we should expose this class in constructor and update all the installer type checks to use this.
| If the installer is for Windows EXE and the welcome file type is nsi, | ||
| it will use the nsi script to add in extra pages before the installer | ||
| begins the installation process. | ||
| begins the installation process. (Not supported for MSI installers.) |
There was a problem hiding this comment.
I don't think we need to add all the items that are not supported for MSI installers. You are being explicit with the supported formats already.
| # The following EXE branding options are not supported for MSI installers | ||
| # because they require modifications to the WiX template in briefcase-windows-app-template: | ||
| # - welcome_file / welcome_text (custom welcome page text) | ||
| # - readme_file / readme_text (readme page) |
There was a problem hiding this comment.
I think the readme file is for PKG installers only anyway.
| ( | ||
| "welcome", | ||
| welcome_size_msi, | ||
| lambda info: mk_welcome_image(info, welcome_size_msi), |
There was a problem hiding this comment.
Should the EXE installers also use lambda functions so that we have more explicit names for variables?
There was a problem hiding this comment.
The lambdas are only needed for MSI because it passes sizes different from default. EXE uses default parameters, so lambdas would be redundant. I could change it just for consistency but provides with no functional benefit, let me know what you think.
Description
Add branding image support (
welcome_image,header_image,icon_image) to MSI installers.MSI installers now generate branded dialog images and icons, matching the existing EXE behavior. Users can provide custom images or rely on auto-generation.
Key changes:
imaging.py: Added MSI image dimensions (493x312 welcome, 493x58 header, 256x256 icon) and refactoredosparameter toinstaller_typefor clarity ("exe", "pkg", "msi")briefcase.py: Integratedwrite_images()to generate branding files and configuredpyproject.tomlwithinstaller_background,installer_banner, andiconpathsosxpkg.py: Updated to use newinstaller_type="pkg"parameter_schema.py: Added "(Not supported for MSI installers.)" to text branding options (welcome_file,welcome_text,readme_file,readme_text,conclusion_file,conclusion_text)if __name__ == "__main__"block fromimaging.pyand deletedexamples/miniconda/directoryNote on image dimensions: MSI welcome/header images have different aspect ratios than EXE (landscape vs portrait). Auto-resize will stretch images. I added a TODO because I will likely need to revisit this (hence also why it's opened as a Draft for now).
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?