【问题标题】:Compiling an installer with Electron-Winstaller fails使用 Electron-Winstaller 编译安装程序失败
【发布时间】:2022-01-18 20:48:23
【问题描述】:

在尝试为我的 Electron 应用程序编译安装程序时,我收到以下错误:

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.

这是我的 build.js 文件:

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}`)
});

package.json 的标题或名称中没有破折号

所以我将版本更改为 1.0.0.0 以适应 x.x.x.x 示例,但出现错误:

System.Exception: Your package version is currently 1.0.0.0, which is not SemVer-compatible, change this to be a SemVer version number 

根据互联网,SemVer 编号是 X.Y.Z 布局,我不明白...

【问题讨论】:

    标签: electron


    【解决方案1】:

    变化:

    var settings = {
        appDirectory: './my-app-win32-x64',
        outputDirectory: './my-app-built-installers',
        authors: 'Valentin Ruiz',
        version: '1.0.0',
        exe: './my-app.exe'
    };
    

    到这里:

    var settings = {
        appDirectory: './my-app-win32-x64',
        outputDirectory: './my-app-built-installers',
        authors: 'Valentin Ruiz',
        exe: './my-app.exe'
    };
    

    让它接受版本号。

    【讨论】:

    • 你的意思是把'1.0.0'改成'1.0.0.0
    • 是的,因为它说“合法版本值应该看起来像 'x.x.x.x',其中 x 是从 0 到 65534 的整数。”
    • 现在我收到错误:System.Exception: 您的包版本当前是 1.0.0.0, SemVer 兼容,请将其更改为 SemVer 版本号
    • 尝试删除版本字段,也许?
    猜你喜欢
    • 2017-03-11
    • 2022-01-16
    • 1970-01-01
    • 2022-01-19
    • 1970-01-01
    • 2012-11-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多