如何将git与电子应用捆绑在一起

编程入门 行业动态 更新时间:2024-10-08 10:58:55
本文介绍了如何将git与电子应用捆绑在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为客户开发一个电子应用程序,他们需要一种简单的方式来更新应用程序,因为我正在处理它。我发现最简单的方法就是包含从git仓库中提取的支持,这在我的测试和客户端机器上运行良好。

最近,他们试图在没有安装git的新Mac上安装应用程序。这位不懂技术的客户在安装git方面遇到了很多麻烦,我花了一段时间来让他们通过下载安装程序,点击它,运行它等等。为了避免将来出现这种情况,我想在我的电子应用程序中捆绑git并使用本地副本。这可能/可行/理想吗?有没有其他的方法可以解决这个问题?解析方案

我推荐你构建安装程序而不是你的git解决方案。电子支持自动更新(windows / mac)和 electron-builder 为您创建安装程序(启用autoUpdates)。这应该是不那么痛苦和更稳定。

然后,如果你仍然需要捆绑与你的应用程序第三方的东西,请参阅 stackoverflow/questions/38918914/how-to-bundle-a-third-party-binary-with-electron/41024174#41024174\">如何将第三方二进制文件与Electron进行捆绑?以及其他解答。

如果你提供了更多的细节,我可以给你一个定制的答案(操作系统,私人应用程序只为你的客户?,...)。

I am developing an electron application for a client and they need an easy way to update the app as I work on it. I have found that the easiest way is to just include support for pulling from a git repo and this works fine in my tests and on the clients' machine.

Recently, they tried to install the app on a new mac that does not have git installed. The client, who is not tech savvy, is having a lot of trouble installing git and it took me a while to walk them through downloading the installer, clicking on it, running it etc. To avoid this in the future, I'd like to just bundle git in my electron application and use a local copy. Is this possible/doable/desirable? Are there any other good ways to approach this problem?

解决方案

I'd recommend you to build installers instead of your git solution. electron has support for automatic updates (windows/mac) and electron-builder creates installers for you (with autoUpdates enabled). This should be way less painful and more stable.

Then, if you still need to bundle 3rd party stuff w/ your app see How to bundle a third party binary with Electron? and other answers on SO.

If you provided some more details I could give you a tailored answer (OS, private app just for your client?, ...).

更多推荐

如何将git与电子应用捆绑在一起

本文发布于:2023-11-23 22:10:47,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   电子   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!