The Launcher can download an error page rather than the full Launcher.
When this happens, the error page file is passed directly to unzip,
which promptly fails with the following message:
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of NewHQLauncher.zip or
NewHQLauncher.zip.zip, and cannot find NewHQLauncher.zip.ZIP, period.
This change improves the error message by checking the size of the
Launcher download and failing if the Launcher is smaller than the
smallest Launcher we've released. The smallest Launcher we've had is
308KB, so I picked 250KB as the limit because it's a nice rounder number
below that.
Before this change the update helper app in the Mac version of HQ
Launcher silently ignored errors. This change adds error handling to aid
troubleshooting.
I was mistaken when I added the EphemeralSession to stop local caching.
Using an EphermeralSession doesn't stop Foundation from caching a
request. Setting a request cache policy controls caching.
Before this change, the mac HQ launcher didn't set a User-Agent string.
This change adds a User-Agent header – HQLauncher/$version – to each
HTTP request the mac launcher makes.
The approach I took was to add the User-Agent header to each HTTP
request. There is room for improvement. Most of the session
initialization could be rolled up into a helper class that sets the
User-Agent headers and other configuration parameters. Making that
change would be too much overhead for this quick task.
Jira: https://highfidelity.atlassian.net/browse/DEV-417
Prior to this change we used the default session while downloading the
latest tags API response from Thunder. This left open the possibility that
NSURLSession could cache the response, even though the server asked it
not to; NSURLSession can be pretty aggressive about its caching.
This change ensure no caching of the API is occurring my using an
ephemeral session when calling the tags API.
Prior to this change the macOS HQ Launcher used the version from the
settings files. Pull this information in the settings file could
result in a situation where the setting file was updated, but interface
wasn't. When the launcher ran a second time it would check the settings
file and think Interface was updated even though it wasn't. This change
resolves the issue by asking interface for its version directly.
In the event that Interface doesn't response with a version number HQ
Launcher knows how to interoperate HQ Launcher will fall back to using the
settings file.
Known Issues
---
1) Interface reports different version number formats depending
on how its built. A stable interface for getting the build version
from interface should be added.
This change pins HQ Launcher's target SDK to 10.9, which is the same as
the target SDK for Interface. Without this pinned value the target
version defaults to whatever the OS version is on the machine that
happened to build HQ Launcher.
Priot to this change there was code that attempted to verify that
LAUNCHER_HMAC_SECRET was set to something. This code was broke though
and didn't catch the case correctly. This change fixes the check.