简体   繁体   English

Electron 2.0.8无法访问存储库中的文件

[英]Electron 2.0.8 failing to access file in the repository

I have an Electron 1.7.9 Windows application that has been working well and I decided to update to the latest version of Electron, 2.0.8. 我有一个运行良好的Electron 1.7.9 Windows应用程序,我决定更新到最新版本的Electron,2.0.8。 The application needs to copy some template files from the Electron repository to the users file system. 应用程序需要将一些模板文件从Electron存储库复制到用户文件系统。 With the 1.7.9 application this works fine, however with 2.0.8 the copy fails because the template file cannot be found. 使用1.7.9应用程序可以正常工作,但是使用2.0.8时复制失败,因为无法找到模板文件。 The path to the template file relative to the application is: 模板文件相对于应用程序的路径是:

resources\app.asar\Templates\ICC_V8\Startup.S

When I debug the application, I am using VS Code, it works just fine. 当我调试应用程序时,我正在使用VS Code,它工作得很好。

Any input would be much appreciated, Sid Sid表示非常感谢任何意见

This issue has been resolved by moving the templates out of the repository of the Electron app and updating the code to access the templates in the new location. 通过将模板移出Electron应用程序的存储库并更新代码以访问新位置中的模板,可以解决此问题。

While this complicates the build of the app, using electron-packager, it does resolve the issue and brings with it the additional benefit of being able to maintain the template files without needing to rebuild the app. 虽然这使应用程序的构建变得复杂,但使用电子打包器,它确实解决了问题,并带来了能够维护模板文件而无需重建应用程序的额外好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM