AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
870 stars 149 forks source link

OS detection fails in packaged/production builds, causing `undefined` instead of menu icons #244

Open mikeseese opened 1 year ago

mikeseese commented 1 year ago

Problem Description

After packaging my Electron app for production, the min/max/close buttons show as undefined due to

Steps to Reproduce

  1. Integrate custom-electron-titlebar into https://github.com/electron-react-boilerplate/electron-react-boilerplate
  2. Run npm run package
  3. Run the installer in the release/build directory
  4. Installed app should have the noticed issues

Expected Behavior

The icons should display correctly.

Current Behavior

image

Additional Information

This is running on Windows 11.

Tentative Solution Steps

This seems to be due to incorrect OS detection in src/base/common/platform.ts. I was able to resolve this issue myself with this commit: https://github.com/IncantaGames/custom-electron-titlebar/commit/ba16f796694f418f0d2dee80d550a11b9cdac5da