英文:
Electron app only works on computers where it was builded
问题
I'm trying to create an Electron app for MacOS. To do this, I'm using macOS Catalina on VirtualBox. I can create a DMG file using Electron Builder and Forge. It works fine for me; I can install and run the application. However, it doesn't work on other PCs. People can run the DMG and install it, but they can't run it. They get the error message: "The application app_name can't be opened."
Forge config:
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-dmg',
config: {
format: 'ULFO'
}
}
],
};
Builder config:
"build": {
"files": [
"**/*",
"!node_modules/"
],
"appId": "lib",
"win": {
"target": [
"nsis"
]
},
"nsis": {
"oneClick": false,
"uninstallDisplayName": "Remove Library",
"shortcutName": "Library",
"menuCategory": true,
"allowToChangeInstallationDirectory": true,
"license": "license.md",
"language": "0x046D",
"multiLanguageInstaller": true,
"unicode": true,
"installerIcon": "icon.ico",
"uninstallerIcon": "icon.ico"
},
"mac": {
"target": "dmg",
"icon": "icon.ico",
"asarUnpack": "**/*.node",
"arch": [
"universal"
]
},
"extraFiles": [
{
"from": "license.md",
"to": "license.md",
"filter": [
"**/*"
]
}
],
"extraResources": [
"./src/extraResources/**",
{
"from": "tor",
"to": "tor",
"filter": [
"**/*"
]
}
]
}
}
It doesn't work even with a simple application that just opens a window.
英文:
I'm trying to create electron app for MacOS. To do this, i'm using macos catalina on virtual box. I can tried dmg file using electron-builder and forge. It works fine for me, i can install and ru application. But it doesn't work on other PC's. People can run dmg and install, but can't run it, "The application app_name can't be opened".
forge config:
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-dmg',
config: {
format: 'ULFO'
}
}
],
};
Builder config:
"build": {
"files": [
"**/*",
"!node_modules/"
],
"appId": "lib",
"win": {
"target": [
"nsis"
]
},
"nsis": {
"oneClick": false,
"uninstallDisplayName": "Remove Library",
"shortcutName": "Library",
"menuCategory": true,
"allowToChangeInstallationDirectory": true,
"license": "license.md",
"language": "0x046D",
"multiLanguageInstaller": true,
"unicode": true,
"installerIcon": "icon.ico",
"uninstallerIcon": "icon.ico"
},
"mac": {
"target": "dmg",
"icon": "icon.ico",
"asarUnpack": "**/*.node",
"arch": [
"universal"
]
},
"extraFiles": [
{
"from": "license.md",
"to": "license.md",
"filter": [
"**/*"
]
}
],
"extraResources": [
"./src/extraResources/**",
{
"from": "tor",
"to": "tor",
"filter": [
"**/*"
]
}
]
}
It doesn't work event with a clear application which just opens window.
答案1
得分: 1
需要对应用程序进行签名,以便能够在其他人的计算机上运行。
英文:
You need to sign the application so it can be able to be run on other peoples machines.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论