EnvVars.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. namespace BepInEx.IL2CPP
  3. {
  4. /// <summary>
  5. /// Doorstop environment variables, passed into the BepInEx preloader.
  6. /// <para>https://github.com/NeighTools/UnityDoorstop/wiki#environment-variables</para>
  7. /// </summary>
  8. internal static class EnvVars
  9. {
  10. /// <summary>
  11. /// Path to the assembly that was invoked via Doorstop. Contains the same value as in "targetAssembly" configuration option in the config file.
  12. /// </summary>
  13. public static string DOORSTOP_INVOKE_DLL_PATH { get; private set; }
  14. /// <summary>
  15. /// Full path to the game's "Managed" folder that contains all the game's managed assemblies
  16. /// </summary>
  17. public static string DOORSTOP_MANAGED_FOLDER_DIR { get; private set; }
  18. /// <summary>
  19. /// Full path to the game's executable.
  20. /// </summary>
  21. public static string DOORSTOP_PROCESS_PATH { get; private set; }
  22. internal static void LoadVars()
  23. {
  24. DOORSTOP_INVOKE_DLL_PATH = Environment.GetEnvironmentVariable("DOORSTOP_INVOKE_DLL_PATH");
  25. DOORSTOP_MANAGED_FOLDER_DIR = Environment.GetEnvironmentVariable("DOORSTOP_MANAGED_FOLDER_DIR");
  26. DOORSTOP_PROCESS_PATH = Environment.GetEnvironmentVariable("DOORSTOP_PROCESS_PATH");
  27. }
  28. }
  29. }