更新应用程序时,最佳方法更改配置文件中的URL是什么?

发布于 2025-01-24 13:46:24 字数 217 浏览 2 评论 0原文

我有一个Javafx客户端/服务器应用程序,其中客户端具有存储URL的config.ini文件。 我配置了Windows的更新方式,如果有更新,该程序将从服务器下载新的应用程序,然后运行BAT脚本并关闭,然后BAT替换JAR文件。更新时,我还需要替换配置中的URL地址,每次启动应用程序时,我想出的只是检查和替换URL。

但这是一个非常糟糕的决定。

仅在更新时才能替换URL,在什么时候更好?

I have a javafx client/server application in which the client has a config.ini file where the URL is stored.
I configured the update for Windows in such a way that if there is an update, the program downloads a new jar of the application from the server and then runs the bat script and closes, and bat replaces the jar file. I also need to replace the URL address in config when updating, and all I came up with is just checking and replacing the URL every time I start application.

But this is a very bad decision.

How can I replace the URL only when updating, and at what point is it better to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文