【发布时间】:2018-02-24 10:22:33
【问题描述】:
我开发了一个 Electron 应用程序,并使用 eletron-packager 和 electron-squirrel-startup 创建了 .exe 和 .msi 安装程序文件。 .exe 文件工作正常,但 .msi 不是。看起来它只是在某个时候停止并关闭。在控制面板中我可以看到“my_app Machine-Wide Installer”,我不确定这是否是预期的效果,但仍然没有安装 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;
}
这有点牵强,但也许它与数字签名有关?
【问题讨论】:
-
我们能看到这个 MSI 吗?如果可以的话,我相信我们可以弄清楚发生了什么。如果它很大,您可以在其上运行 admin install 并仅在某处上传基本 MSI(不带嵌入式 cab)。这意味着它无法安装,但可以查看。在上面的链接中阅读有关管理员安装的信息,或者只是尝试运行(在标准命令提示符中 - 根据需要调整路径):
msiexec /a File.msi TARGETDIR=C:\MyInstallPoint /qn来创建一个。 -
我没有意识到 Squirrel 制作了 MSI。我以为我上次检查时只制作了 EXE(每用户自动更新)
-
@SteinÅsmul 感谢您的回答!我不确定你的意思。我运行了你提到的
cmd命令,它创建了一个.exe文件,效果很好(尽管我仍在试图找出.msi有什么问题)。我不知道你希望我上传。
标签: windows-installer electron electron-packager squirrel.windows