Skip to content

Commit

Permalink
Clarified how to use the two magical strings for cacheDir. A full exp…
Browse files Browse the repository at this point in the history
…lanation

is coming in the Wiki.
  • Loading branch information
TurekBot committed Dec 19, 2018
1 parent bdc477c commit 178d8dc
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,26 @@ Check out these prebuilt installers for a more complex demo application

## Specify cache directory

By default, the artifacts are downloaded to the current working directory. This is usually fine for native installers, but if you distribute
your application via just the launcher jar, you might want to specify where the downloaded artifacts land. See the
[cache dir documentation](https://github.com/edvin/fxlauncher/wiki/Optional-Cache-Directory) for more information.
By default, the artifacts are downloaded to the current working directory. This is usually fine for per-user native
installers, but if you distribute your application via a system-wide native installer, or just the launcher
jar, you might want to specify where the downloaded artifacts land. See the
[cache dir documentation] for more information.

[cache dir documentation]: https://github.com/edvin/fxlauncher/wiki/Optional-Cache-Directory

## Installation location

It's worth noting that the two package alternatives for Windows, (EXE and MSI) have different install location defaults.
While EXE will default to %APPDATALOCAL%, the MSI installer will default to %ProgramFiles%. If you use the MSI installer you
might therefore need to specify the cache dir parameter as `cacheDir 'USERLIB/MyApp'` to make sure that the launcher has
write access to download the artifacts for your application.
It's worth noting that the two package alternatives for Windows, (EXE and MSI) have different default install locations.
While EXE will default to [`%AppDataLocal%`], the MSI installer will default to `%ProgramFiles%`. To write to
`%ProgramFiles%` one definitely does need admin privileges—that poses a problem for FXLauncher which, by default,
downloads updates to where it was installed.

If you use the MSI installer you will therefore need to tell FXLauncher to cache artifacts somewhere it is allowed
to put them. For an OS-independent answer to this problem, look no further than the
[two magical strings][cache dir documentation], `USERLIB` and `ALLUSERS`.


[`%AppDataLocal%`]: https://www.howtogeek.com/318177/what-is-the-appdata-folder-in-windows/

Read more about Java Packager in the official documentation:

Expand Down

0 comments on commit 178d8dc

Please sign in to comment.