build - Electron 应用程序: control squirrel install event

标签 build electron squirrel.windows

我构建了一个 Electron 应用程序,将应用程序与 Electron 打包程序一起打包,并使用Windows-installer构建了安装程序。

去做:
我想在安装应用程序时运行一些命令。

我试过的

将代码放入松鼠事件中以执行命令:

case '--squirrel-install':
  const exec = require('child_process).exec;
  exec(...); // run command here to execute commands inside batch file
  if (error) {make installation fail} // if there is an error during exec(), fail the installation

如果命令可以成功运行,它将很好地工作。但是,我还需要处理命令失败的情况。在这种情况下,我想停止安装该应用程序,但不能。

有人有什么主意吗?

最佳答案

您是否尝试抛出异常?那不会中止安装吗?

关于build - Electron 应用程序: control squirrel install event,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39258721/

相关文章:

android-studio - 无法构建 android apk 错误 : ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor. 类

javascript - 如何在 Electron 桌面应用程序中管理表单提交?

c# - Squirrel.windows 在桌面上创建多个快捷方式

Python 构建失败

java - Ant 构建文件和库

electron - 有没有办法创建连接超时来激活服务人员?

html - 无法读取未定义的Electronjs错误的属性 'send'

.net - Squirrel.Windows 的好替代品

windows - 如何使用 Squirrel.Windows 注册应用程序以在 Windows 启动时运行?

java - IntelliJ : Maven: Build Artifact to Jar but cant execute jar