我构建了一个电子应用程序,使用电子打包程序打包应用程序,并使用windows-installer构建安装程序。
Todo:我想在安装应用程序的过程中运行一些命令。
我尝试过的:
将代码放在squirrel事件中以执行命令:
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如果命令可以成功运行,它将工作得很好。但是,我还需要处理命令失败的情况。在这种情况下,我想停止安装应用程序,但它不能。
有谁知道吗?
发布于 2016-12-16 17:58:14
你有没有尝试抛出一个异常?这不会中止安装吗?
https://stackoverflow.com/questions/39258721
复制相似问题