windows-installer icon indicating copy to clipboard operation
windows-installer copied to clipboard

Error: Building .msi installers fails when exe has dash (-) in the name

Open guydav opened this issue 8 years ago • 4 comments

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.<createMsiPackage>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!

guydav avatar Jun 28 '17 12:06 guydav

The same problem seems to occur when the source .exe or folder contains spaces.

KammererTob avatar Apr 10 '18 11:04 KammererTob

Having the same issue, dash or spaces. When will this get fixed, seems likes it has been here a while.

I have an admin that produces electron apps for all platforms, the names are constantly different and contains spaces and dashes. Never had this problem until we needed an msi installer, we had it disabled from the start.

markmorris avatar Oct 09 '18 13:10 markmorris

The same seems to be true for the name field.

When I let it default to the name from project.json (which did have dashes), I received this error.

0livare avatar Aug 03 '20 06:08 0livare

remove dashes & spaces from your title & name

electronInstaller.createWindowsInstaller({
    .......
    title:"app name without dashes & spaces",
    name:"package id without dashes & spaces",
    .....
  });

geek-ibrar avatar Jan 21 '21 18:01 geek-ibrar