在 Install4j 的自动更新功能中使用 HTTP 请求

Use HTTP Request in auto update feature of Install4j

我通过设置 updates.xml 的 URL 成功地使用了 Intsall4J 的自动更新功能。为了进行测试,我使用具有匿名访问权限的服务器(托管 Installer.exe 和 updates.xml)。它运作良好。

但现在的要求是服务器需要具有授权的 HTTP 请求 header。

是否可以在自动更新功能中使用带有授权 header 的 HTTP 请求?

下载支持HTTP认证,更新器会询问用户的用户名和密码。

如果你想在安装程序中硬编码登录,你可以在启动节点添加一个"Run script"动作并执行

System.getProperty("serverAuthUser", "user name");
System.getProperty("serverAuthPassword", "password");