Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSI building process fails when build.productName contains hyphen #6488

Closed
kazuhitoyokoi opened this issue Dec 10, 2021 · 2 comments
Closed

Comments

@kazuhitoyokoi
Copy link

While upgrading the version of the electron-builder for our project, I found that the MSI building process fails as follows.

c:\node-red-desktop>npm run build

> [email protected] build
> electron-builder

  • electron-builder  version=22.14.5 os=10.0.19042
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist\builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=win32 arch=x64
  • packaging       platform=win32 arch=x64 electron=16.0.4 appOutDir=dist\win-unpacked
  • building        target=MSI arch=x64 file=dist\Node-RED 2.1.4.msi
  ⨯ Exit code: 14. Command failed: C:\Users\<username>\AppData\Local\electron-builder\Cache\wix\wix-4.0.0.5512.2\candle.exe -arch x64 -dappDir=c:\node-red-desktop\dist\win-unpacked -pedantic -wx project.wxs
c:\node-red-desktop\dist\__msi-x64\project.wxs(23) : error CNDL0010 : The Icon/@Id attribute was not found; it is required.
c:\node-red-desktop\dist\__msi-x64\project.wxs(72) : error CNDL0014 : The Shortcut/@Icon attribute's value, 'Node-REDIcon.exe', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore.
c:\node-red-desktop\dist\__msi-x64\project.wxs(73) : error CNDL0014 : The Shortcut/@Icon attribute's value, 'Node-REDIcon.exe', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore.

The problem occurs from electron-builder v22.14.3 when build.productName in package.json contains a hyphen, "-".
I think that the regular expressions in the 1st code and 2nd code should be .replace(/\s|-/g, "") instead of .replace(/\s/g, "") to convert build.productName to appropriate ID.

  • Electron-Builder Version: 22.14.5
  • Node Version: 16.13.0
  • Electron Version: 16.0.4
  • Electron Type (current, beta, nightly): current
  • Target: msi
@github-actions github-actions bot added the msi label Dec 10, 2021
aplum added a commit to aplum/electron-builder that referenced this issue Jan 6, 2022
Also fix iconId sometimes containing invalid characters, and iconId config option being ignored.

Closes electron-userland#3694, electron-userland#6488
aplum added a commit to aplum/electron-builder that referenced this issue Jan 12, 2022
Also fix iconId sometimes containing invalid characters, and iconId config option being ignored.

Closes electron-userland#3694, electron-userland#6488
@stale
Copy link

stale bot commented Apr 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Apr 16, 2022
@stale stale bot closed this as completed Apr 30, 2022
@kazuhitoyokoi
Copy link
Author

I tried [email protected]. The problem is solved. Thank you!

jyyi1 added a commit to Jigsaw-Code/outline-apps that referenced this issue Sep 24, 2024
This commit reverts the product name from "outline-client" back to "Outline".

This also fixed the reinstallation issue. Though I'm still not sure about the root cause, it could be that electron-builder failed to handle the '-' character (similar to electron-userland/electron-builder#6488, but not exactly the same).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant