我开发了一个Electron应用程序并使用了eletron-packager
,然后electron-squirrel-startup
我创建了.exe
和.msi
安装程序文件。 .exe
文件工作正常,但.msi
不是。它看起来只是在某个点停下来并关闭。在控制面板中,我可以看到“my_app机器范围安装程序”,我不确定这是否是所需的效果,但是,my_app未安装。Electron Squirrel.Windows:.msi无法正常工作
我有一个非常基本的功能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吗?如果我们能够确信我们可以弄清楚发生了什么事情。如果它很大,你可以在其上运行一个[**管理安装**](https://stackoverflow.com/questions/1547809/extract-msi-from-exe/24987512#24987512)并且只上载基本MSI(没有嵌入式驾驶室)的地方。这意味着它无法安装,但可以查看。在上面的链接中阅读关于管理员安装的信息,或者尝试运行(在标准命令提示符下 - 根据需要调整路径):''msiexec/a File.msi TARGETDIR = C:\ MyInstallPoint/qn''来创建一个。 –
我没有意识到松鼠制造MSI。我以为我最后一次检查它只是使EXE(每用户autoupdating) –
@SteinÅsmul感谢您的回答!我不确定你的意思。我运行了你提到的'cmd'命令,它创建了一个'.exe'文件,这个文件效果很好(尽管我仍然试图找出'.msi'的错误)。我不完全知道你会喜欢我上传。 – madasionka