feat: Use DIR_ASSETS path to locate resource bundles (#47439)

* feat: Use DIR_ASSETS path to locate resource bundles

* Use DIR_ASSETS for calculating ASAR relative paths

* Add test to verify 'assets' matches parent dir of 'exe'

* Add Mac-specific test for assets path (but it is failing)

* test: Update app.getPath('assets') to expect an exception on Mac

* docs: Update docs for 'assets' path to indicate that it's only available on Windows + Linux

* fix: Don't define 'assets' mapping on macOS
This commit is contained in:
Will Anderson
2025-08-03 20:34:08 -07:00
committed by GitHub
parent bdaf3b9a2b
commit e7683bdd25
6 changed files with 27 additions and 10 deletions

View File

@@ -602,6 +602,7 @@ Returns `string` - The current application directory.
* `%APPDATA%` on Windows
* `$XDG_CONFIG_HOME` or `~/.config` on Linux
* `~/Library/Application Support` on macOS
* `assets` The directory where app assets such as `resources.pak` are stored. By default this is the same as the folder containing the `exe` path. Available on Windows and Linux only.
* `userData` The directory for storing your app's configuration files, which
by default is the `appData` directory appended with your app's name. By
convention files storing user data should be written to this directory, and
@@ -616,7 +617,7 @@ Returns `string` - The current application directory.
directory.
* `temp` Temporary directory.
* `exe` The current executable file.
* `module` The `libchromiumcontent` library.
* `module` The location of the Chromium module. By default this is synonymous with `exe`.
* `desktop` The current user's Desktop directory.
* `documents` Directory for a user's "My Documents".
* `downloads` Directory for a user's downloads.