[英]"Windows cannot access the specified..." .Exe's made by electron-packager nor electron-forge
I'm on a Win 8.1 x64 machine.我在 Win 8.1 x64 机器上。 When I try to run the generated Windows binaries, I get a Windows error message.当我尝试运行生成的 Windows 二进制文件时,我收到一条 Windows 错误消息。
Windows cannot access the specified device, path, or file. Windows 无法访问指定的设备、路径或文件。 You may not have the appropriate permissions to access the item.您可能没有访问该项目的适当权限。
electron-forge make
to electron-packager [folder] [projectTitle] --platform=win32 --arch=x64
(same error)我从使用electron-forge make
electron-packager [folder] [projectTitle] --platform=win32 --arch=x64
electron-forge make
切换到electron-packager [folder] [projectTitle] --platform=win32 --arch=x64
(同样的错误)electron
dependency to the devdeps section in order to satisfy electron-forge
特别是,我不得不将electron
依赖移到 devdeps 部分以满足electron-forge
electronPackagerConfig.packageManager
to false
per the recommended workaround for this recent known issue about pruning failing (not related to this problem, but it's a factor in play)根据最近关于修剪失败的已知问题的推荐解决方法,将electronPackagerConfig.packageManager
更改为false
(与此问题无关,但这是一个因素)electron-forge
didn't have much in it.在 7zip 中打开两个 .exe 并注意到electron-forge
生成的那个没有太多内容。 This may be nothing or it may correlate with the console output for that command, below.这可能没什么,也可能与下面该命令的控制台输出相关。This is my first electron app (I come from a web background).这是我的第一个电子应用程序(我来自网络背景)。 I'm doing this build as a sanity check before I start significantly integrating my app with electron's API.在我开始将我的应用程序与电子 API 显着集成之前,我正在做这个构建作为健全性检查。
$ electron-forge make
We need to package your application before we can make it
[BABEL] Note: The code generator has deoptimised the styling of "E:/cygwin64/tmp/electron-packager/win32-x64/fictionDB-win32-x64/resources/app/.tmp/public/js/ckeditor/ckeditor.js" as it exceeds the max of "500KB".
[BABEL] Note: The code generator has deoptimised the styling of "E:/cygwin64/tmp/electron-packager/win32-x64/fictionDB-win32-x64/resources/app/.tmp/public/js/jquery-ui/jquery-ui.js" as it exceeds the max of "500KB".
Making for the following targets:
$
Notice how it seems to just cut off there?请注意它似乎只是在那里切断了? I wouldn't know but I'm guessing that's odd.我不知道,但我猜这很奇怪。
$ electron-packager . fictionDB --platform=win32 --arch=x64
Downloading tmp-50796-1-SHASUMS256.txt-7.1.7
[============================================>] 100.0% of 5.56 kB (5.56 kB/s)
Packaging app for platform win32 x64 using electron v7.1.7
Wrote new app to E:\xxx\Documents\src\js_src\Projects\testbed6\fictionDB-win32-x64
$
{
"name": "fictionDB",
"private": false,
"version": "0.0.0",
"description": "A way for fiction writers to plan & organize",
"keywords": [
"organize",
"database",
"fiction",
"novel",
"stories",
"characters",
"events",
"locations",
"settings"
],
"dependencies": {
"@sailshq/connect-redis": "^3.2.1",
"@sailshq/lodash": "^3.10.3",
"@sailshq/socket.io-redis": "^5.2.0",
"acorn": "^7.1.0",
"ckeditor": "^4.12.1",
"connect-redis": "^4.0.3",
"electron-compile": "^6.4.4",
"electron-squirrel-startup": "^1.0.0",
"grunt": "^1.0.4",
"jquery": "^3.4.1",
"jquery-ui-dist": "^1.12.1",
"lodash": "^4.17.15",
"request": "^2.88.0",
"sails": "^1.2.3",
"sails-hook-grunt": "^4.0.1",
"sails-hook-orm": "^2.1.1",
"sails-hook-sockets": "^2.0.0",
"socket.io-redis": "^5.2.0"
},
"devDependencies": {
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"electron": "^7.1.7",
"electron-forge": "^5.2.4",
"electron-prebuilt-compile": "4.0.0",
"eslint": "5.16.0"
},
"scripts": {
"start": "electron-forge start",
"test": "npm run lint && npm run custom-tests && echo 'Done.'",
"lint": "./node_modules/eslint/bin/eslint.js . --max-warnings=0 --report-unused-disable-directives && echo '✔ Your .js files look good.'",
"custom-tests": "echo \"(No other custom tests yet.)\" && echo",
"package": "electron-forge package",
"make": "electron-forge make"
},
"main": "app/launch.js",
"repository": {
"type": "git",
"url": "git://github.com/NathanHawks/FictionDB.git"
},
"author": "Nathan Hawks",
"license": "MIT",
"engines": {
"node": "^8.9"
},
"config": {
"forge": {
"make_targets": {
"win32": [
"squirrel"
],
"darwin": [
"zip"
],
"linux": [
"deb",
"rpm"
]
},
"electronPackagerConfig": {
"packageManager": false
},
"electronWinstallerConfig": {
"name": "fictionDB"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {},
"github_repository": {
"owner": "",
"name": ""
},
"windowsStoreConfig": {
"packageName": "",
"name": "fictionDB"
}
}
}
}
I forgot to turn off antivirus shields.我忘了关闭防病毒防护罩。 That fixed it.那修复了它。 (For the permanent solution, I then added a security exception in my antivirus app's settings.) (对于永久解决方案,我然后在我的防病毒应用程序的设置中添加了一个安全例外。)
As a note of interest, the version made by electron-forge didn't work:有趣的是,electron-forge 制作的版本不起作用:
However, the one made by electron-packager
alone, worked fine.然而,由electron-packager
单独制作的,效果很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.