'Compiling an installer with Electron-Winstaller fails
While trying to compile an installer for my Electron App, I get the following error :
Failed with exit code: 4294967295
System.Exception: Failed to compile WiX template, command invoked was: 'candle.exe -nologo -ext WixNetFxExtension -out
error CNDL0108 : The Product/@Version attribute's value, '!(bind.FileVersion.my-app.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.*
error CNDL0010 : The Product/@Version attribute was not found; it is required.
Here is my build.js file :
var electronInstaller = require('electron-winstaller');
var settings = {
appDirectory: './my-app-win32-x64',
outputDirectory: './my-app-built-installers',
authors: 'Valentin Ruiz',
version: '1.0.0',
exe: './my-app.exe'
};
resultPromise = electronInstaller.createWindowsInstaller(settings);
resultPromise.then(() => {
console.log("The installers of your application were succesfully created !");
}, (e) => {
console.log(`Well, sometimes you are not so lucky: ${e.message}`)
});
There is no dash in title or in name in package.json
So i change version to 1.0.0.0 to fit the x.x.x.x example, but I get the error :
System.Exception: Your package version is currently 1.0.0.0, which is not SemVer-compatible, change this to be a SemVer version number
And according to internet a SemVer number is a X.Y.Z layout, I do not understand...
Solution 1:[1]
This is a bug in Squirrel, the library that electron uses for installing and updating on windows. It fails to build the MSI.
To fix this, exe name must not have dashes or spaces, and possibly even the app/output file path. Start removing dashes and spaces from your file paths, and you can read more here https://github.com/electron/windows-installer/issues/187.
Alternatively, you could just disable the MSI compilation with the noMsi: true option, if you don't need this.
Solution 2:[2]
Change:
var settings = {
appDirectory: './my-app-win32-x64',
outputDirectory: './my-app-built-installers',
authors: 'Valentin Ruiz',
version: '1.0.0',
exe: './my-app.exe'
};
To this:
var settings = {
appDirectory: './my-app-win32-x64',
outputDirectory: './my-app-built-installers',
authors: 'Valentin Ruiz',
exe: './my-app.exe'
};
for it to accept the version number.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | caesay |
| Solution 2 |
