Package.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. // Round 165n (store165): LYNX running from an MSIX package (the Microsoft Store build, docs/STORE.md). The same
  3. // LYNX.exe ships in the installer, the zip and the Store package; it branches on "running packaged" only where the
  4. // package changes what is right:
  5. // - settings folder: the real path of the package's redirected %APPDATA% (core/StorePackage.h explains why), with a
  6. // one-time copy of the installer build's preferences;
  7. // - no per-user file-type registration (the package manifest declares .lynx, .flp, .mid and audio files);
  8. // - no relaunch through the 8.3 short path (WindowsApps paths are plain ASCII);
  9. // - a restart goes through the package (shell:AppsFolder) so it keeps the package identity;
  10. // - LYNX ASIO is not offered for registration with other programs (the package folder changes with every update).
  11. // Updates come from the Store: a packaged LYNX never checks for updates (ui/Updater.h; the other builds do).
  12. #include <juce_core/juce_core.h>
  13. namespace lynx::platform
  14. {
  15. // True when this process runs with a package identity (GetCurrentPackageFamilyName succeeds). For tests on a PC
  16. // without the package, LYNX_SIMULATE_PACKAGE_FAMILY=<family name> makes LYNX behave as if it were packaged.
  17. bool runningPackaged();
  18. // The package family name ("LYNX.LYNX_8wekyb3d8bbwe"); empty when not packaged.
  19. juce::String packageFamilyName();
  20. // The full package name (with version and architecture); empty when not packaged or simulated.
  21. juce::String packageFullName();
  22. // The settings folder of a packaged LYNX (created, migrated on first use); an empty File when not packaged.
  23. juce::File packagedSettingsFolder();
  24. // Starts LYNX again (after a language change): through the package when packaged, else this exe. False when it
  25. // could not be started.
  26. bool relaunchApp();
  27. // A text report for `LYNX.exe --packageinfo <out.txt>`: identity, folders, and a write/read check of the settings
  28. // folder on the real disk (what Explorer sees). "result=OK" on the last line when everything checks out.
  29. juce::String packageReport();
  30. } // namespace lynx::platform