electron / electron/windows-installer
Error: Building .msi installers fails when exe has dash (-) in the name
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 267
- Avg merge
- 5h 38m
- Merged PRs (30d)
- 1
Description
Hello,
I ran into an issue, which I believe should at least be better documented, if not somehow worked around.
Building an MSI installer fails of the project name (as defined in the `package.json` file, I believe) has a dash in the name. For example, my-project.exe fails, and MyProject.exe succeeds.
I believe this is because of the parameter value used in the `template.wxs` file, particularly the injection into the version attribute in the product tag. The error was as follows:
```
Output was:
Setup.wxs
C:\Users\Testing\Documents\my-project\installer\Setup.wxs(2) : error CNDL0108 : The Product/@Version attribute's value, '!(bind.FileVersion.my-project.exe)', is not a valid version. Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534.
C:\Users\Testing\Documents\my-project\installer\Setup.wxs(2) : error CNDL0010 : The Product/@Version attribute was not found; it is required.
at Squirrel.Update.Program.d__21.MoveNext()<---
at ChildProcess.proc.on.code (C:\Users\Testing\Documents\my-project\node_modules\electron-winstaller\lib\spawn-promise.js:62:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
```
This is probably because in the `template.wxs` file, the injection into the version looks like `Version="!(bind.FileVersion.{{Id}}.exe)"`, and having a dash in the Id creates a dash in the variable definition, breaking it.
I would suggest either building a workaround (I admit to knowing nothing about these wxs files), or at least, documenting this behavior somewhere.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.