Electron Squirrel.Windows:.msi无法正常工作



我开发了一个电子应用,然后使用eletron-packager,然后electron-squirrel-startup我创建了.exe.msi安装程序文件。.exe文件工作正常,但.msi不工作。看起来它只是在某个时候停止并关闭。在控制面板中,我可以看到" my_app机器范围内的安装程序",我不确定这是否是所需的效果,但是,my_app尚未安装。

我有一个相当基本的handlesquirrelevents函数:

switch (squirrelEvent) {
    case '--squirrel-install':
    case '--squirrel-updated':
        // Optionally do things such as:
        // - Add your .exe to the PATH
        // - Write to the registry for things like file associations and
        //   explorer context menus
        // Install desktop and start menu shortcuts
        spawnUpdate(['--createShortcut', exeName]);
        setTimeout(application.quit, 1000);
        return true;
    case '--squirrel-uninstall':
        // Undo anything you did in the --squirrel-install and
        // --squirrel-updated handlers
        // Remove desktop and start menu shortcuts
        spawnUpdate(['--removeShortcut', exeName]);
        setTimeout(application.quit, 1000);
        return true;
    case '--squirrel-obsolete':
        // This is called on the outgoing version of your app before
        // we update to the new version - it's the opposite of
        // --squirrel-updated
        application.quit();
        return true;
}

这有点牵强,但也许与数字签名有关?

只是一个第一个建议 - 这不是一个真正的答案。我将在获取更多信息时进行更新:如果您安装了Windows SDK,则可以搜索Orca-x86_en-us.msi。安装此MSI,您将可以访问" Orca" - MSI文件查看器。在ORCA中打开MSI,并通过工具 -> Validate运行验证。单击GO(也许取消选中tick框以获取信息消息)。在您的开始菜单中应该有一个捷径的快捷方式。请使用任何错误消息更新您的答案。

我找到了这个:https://github.com/squirrel/squirrel.windows/blob/master/master/docs/using/machine-wide-installs.mds.mds.mds.md

它说:

机器范围内安装Squirrel的发行命令生成MSI 适用于通过小组策略安装的文件。这个MSI不是 通用安装程序,这意味着一旦您运行MSI,用户 从现在开始,将在下一个登录处安装应用程序。

因此,大多数普通用户应该继续运行setup.exe的生成 通过发行,但是如果您想拥有IT管理员友好版本, 您可以移交MSI

大多数松鼠用户不必做任何新的事情来启用此事 行为,尽管某些Nuget软件包ID/名称可能会导致 MSI的问题。

看来我的.msi工作正常,只有我期望不同的结果。

最新更新