3

I'm trying to use the auto-update feature of install4j. The updater is configured as stand-alone and is launched by the user from a menu item with the code snippet from the installer configuration. The updates.xml URL is configured in the Auto-Update Options screen.

The updater is started correctly but then it fails with the error "The update information could not be downloaded from ". The URL is correct and the xml file can be viewed from a web browser on the same client computer. I tried disabling the firewall and antivirus, but nothing has changed. I use install4j version 6.1.6 and the target platform is Windows (tested on Win7 and WinXP just in case).

Can anyone suggest a possible reason for this failure and/or a way to get more diagnostic information?

Thanks in advance

Sasha

Sasha
  • 93
  • 9
  • 1
    You can check the log file `%TEMP%\i4j_log....` while the update downloader is still running. – Ingo Kegel Feb 20 '18 at 09:35
  • Thanks for the tip. I did check the log and it turned out to be a 403 Forbidden error. I tweaked .htaccess settings and file permissions but that hasn't changed anything. At the same time, browsers have no problem accessing the files. I'm wondering how the installer is accessing the server and why it ends up with errors that browsers don't. Also, it would be interesting to know how common this error is... – Sasha Feb 21 '18 at 00:25
  • I have never seen this error before. Maybe the server does not allow the Java client? – Ingo Kegel Feb 21 '18 at 07:15
  • Thanks, Ingo. I didn't, strictly speaking, resolve the problem, but I found the reason for it. The test server was set up to use a CDN and their rules blocked these types of accesses. I moved the updates to a different server and was able to get them without issues. – Sasha Feb 23 '18 at 20:02
  • Ingo, I still had to revisit this issue. Can you tell me how server access is implemented in install4j? I wrote a simple piece of Java code using URLConnection and was able to download updates.xml without problems. But the install4j code keeps failing. What is different about install4j that makes it fail? – Sasha Apr 18 '18 at 20:09
  • Your test program can download the file, but install4j produces a 403 Forbidden error? Could it be that install4j uses a proxy and your test program not or vice-versa? – Ingo Kegel Apr 18 '18 at 20:25
  • I run both install4j and my test code from the same system, and it has no proxy configured. Does install4j have any network access restrictions? Does it use SSL? – Sasha Apr 18 '18 at 21:20
  • It just uses the URLConnection, so I'm not sure where the difference could be, You can try to pass `-Dinstall4j.showConnectError=true` to the installer to see more information in the installation log and `-Dinstall4j.noProxy=true` to disable any proxy. – Ingo Kegel Apr 19 '18 at 05:55
  • Please see my answer below. Looks like install4j code needs a little cleanup to make sure the HTTP headers are correct. It can get away with it with no server security, but fails as soon as browser integrity check kicks in. – Sasha Apr 19 '18 at 18:05

1 Answers1

1

I solved the problem by disabling browser integrity check in the CloudFlare settings. This means that install4j is sending malformed HTTP headers that are interpreted by the CloudFlare firewall as suspicious.

I do hope that this install4j bug will be fixed, since allowing access at the CloudFlare level means that the server is more exposed to actual threats.

Sasha
  • 93
  • 9
  • I don't think the headers can be malformed, it would be interesting to know which headers are the problem. Is it the `X-Client-Application` header? Please contact support@ej-technologies.com to get a build where this property can be switched off. – Ingo Kegel Apr 20 '18 at 06:24
  • Not sure if it's X-Client-Application header, I just know that server security doesn't like the headers sent by install4j. In my working application I used this header configuration: connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"); – Sasha Apr 20 '18 at 20:20
  • You can set the same headers on the "Check for update" action or any action that downloads files. – Ingo Kegel Apr 21 '18 at 13:24