fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Add support for zip files as Windows FMAs

Open allenhouchins opened this issue 1 month ago • 2 comments

Summary

This PR adds support for .zip files as Windows Fleet Managed Apps (FMAs). Zip files on Windows are treated similarly to .exe files and require custom install/uninstall scripts, typically used for AppX/MSIX packages that are distributed as zip archives.

Changes

Backend:

  • Added .zip as a supported Windows package type in SoftwareInstallerPlatformFromExtension
  • Updated validation to require install/uninstall scripts for zip files (similar to .exe files)
  • Added addZipPackageMetadata function to handle zip file metadata extraction
  • Updated error messages to include .zip in the list of supported file types
  • Enhanced appExists validation to detect provisioned AppX packages (packages that are provisioned for all users but don't show up in the programs table until a user logs in)
  • Added version normalization logic to handle version string differences (e.g., "11.2.1495.0" vs "11.2.1495")
  • Updated winget ingester to recognize zip files and default to user scope for MSIX/zip installers

Frontend:

  • Added .zip to windowsPackageTypes in package_type.ts
  • Updated PackageAdvancedOptions component to require install/uninstall scripts for zip files
  • Added validation rules for zip files in PackageForm/helpers.tsx
  • Updated help text and tooltips to indicate script requirements for zip packages
  • Updated software_install_scripts.ts to include zip in default script handling

Maintained Apps:

  • Added Microsoft Company Portal as a maintained app example using zip files
  • Created install/uninstall PowerShell scripts that:
    • Extract zip files containing AppX packages
    • Provision packages for all future users (works in headless environments)
    • Install packages for the current user
    • Handle both provisioned and installed package detection

Tests:

  • Updated integration tests to include .zip in supported file type error messages
  • Updated unit tests for SoftwareInstallerPlatformFromExtension and SofwareInstallerSourceFromExtensionAndName

Use Case

This enables distribution of Windows AppX/MSIX packages that are packaged as zip files (common for Microsoft Store apps like Company Portal). The implementation handles both provisioned packages (for all users) and user-installed packages, ensuring detection works in both headless and interactive environments.

Testing

  • Updated existing tests to include zip file support
  • Added Microsoft Company Portal as a maintained app example with full install/uninstall scripts

Note: This PR follows the same pattern as .exe file support, requiring custom install/uninstall scripts since zip files can contain various content types that need custom handling.

allenhouchins avatar Dec 07 '25 02:12 allenhouchins

Codecov Report

:x: Patch coverage is 19.64286% with 45 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 65.89%. Comparing base (bc7de89) to head (214ed6e). :warning: Report is 80 commits behind head on main.

Files with missing lines Patch % Lines
ee/server/service/software_installers.go 18.00% 39 Missing and 2 partials :warning:
ee/maintained-apps/ingesters/winget/ingester.go 0.00% 4 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #36841      +/-   ##
==========================================
- Coverage   65.90%   65.89%   -0.02%     
==========================================
  Files        2327     2327              
  Lines      184827   184874      +47     
  Branches     7764     7663     -101     
==========================================
+ Hits       121818   121819       +1     
- Misses      51870    51913      +43     
- Partials    11139    11142       +3     
Flag Coverage Δ
backend 67.71% <19.64%> (-0.02%) :arrow_down:
frontend 54.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 07 '25 02:12 codecov[bot]

@cdcme -- qq: This does not include letting the user upload a custom package .zip file, correct?

RachelElysia avatar Dec 09 '25 16:12 RachelElysia