【发布时间】:2020-12-26 01:44:50
【问题描述】:
我正在为 linux 生成电子发行版。 这就是应用程序的构建方式 这就是在 packge.json 中构建应用程序的方式
"builderForLinx": "electron-packager --out linx64 --overwrite --platform linux --appname myApp --asar"
此应用程序结构 myApp -> myApp(linux 可执行文件)、mian.js、资源 -> myApp.asar
这给出了一个 linux 版本的电子包。但我必须运行以下命令才能运行应用程序
sudo chmod +x ./myApp
sudo chown root chrome-sandbox
sudo chmod 4755 chrome-sandbox
实际上我是从 tfs build artifact 获取应用程序,当我下载这个应用程序时,我想直接运行 ./myApp。
这是我的 tfs 定义,我在 bash 中运行所有这些,而不是我的代理/构建机器是 windows 的。
#!/bin/bash
cd "$(Build.ArtifactStagingDirectory)/myApp" ; pwd
chown <<username>> chrome-sandbox
chmod 4755 chrome-sandbox
注意:$(Build.ArtifactStagingDirectory) 是指向工件目录的 tfs 变量。 当我直接在 linux 机器上运行应用程序时,我看到了这个错误
The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/staff/kjeeva/licregsNew/v211/licensingclient/linx64/ClientSettings-asar/chrome-sandbox is owned by root and has mode 4755.
我对linux环境不太熟悉,对此有任何帮助或建议会很有帮助。
【问题讨论】:
-
请注意,电子应用程序生成为 .TGZ 文件,当我 tar 和 untar 时,我希望保留文件权限
-
例如 chrome-sandbox 需要有 -rwsr-xr-x 而所有其他的必须有 -rwxr-xr-x
-
当我对包进行 tar 和解压缩时,我希望它具有相同的文件权限
-
你好朋友,这个问题怎么样?下面的答案是否解决了您的问题,如果是,您可以 Accept it as an Answer ,这样它可以帮助遇到同样问题的其他社区成员,我们可以存档这个帖子,谢谢。另外,如果您仍然被阻止,请随时告诉我~
标签: linux tfs electron electron-builder electron-packager