diff --git a/pressure-vessel/wrap-setup.c b/pressure-vessel/wrap-setup.c
index eb734d07c8cf491377b9055dad679f6b00f6d16f..ddce9cd3a1f5401b53856796a94715ff54a5ebc6 100644
--- a/pressure-vessel/wrap-setup.c
+++ b/pressure-vessel/wrap-setup.c
@@ -343,6 +343,8 @@ pv_wrap_move_into_scope (const char *steam_app_id)
  *  namespace, possibly including special ld.so tokens such as `$LIB`,
  *  or basename of a preloadable module to be found in the standard
  *  library search path
+ * @env: (array zero-terminated=1) (element-type filename): Environment
+ *  variables to be used instead of `environ`
  * @flags: Flags to adjust behaviour
  * @runtime: (nullable): Runtime to be used in container
  * @exports: (nullable): Used to configure extra paths that need to be
@@ -356,6 +358,7 @@ pv_wrap_append_preload (GPtrArray *argv,
                         const char *variable,
                         const char *option,
                         const char *preload,
+                        GStrv env,
                         PvAppendPreloadFlags flags,
                         PvRuntime *runtime,
                         FlatpakExports *exports)
@@ -437,7 +440,7 @@ pv_wrap_append_preload (GPtrArray *argv,
       else
         {
           const gchar *steam_path = NULL;
-          steam_path = g_getenv ("STEAM_COMPAT_CLIENT_INSTALL_PATH");
+          steam_path = g_environ_getenv (env, "STEAM_COMPAT_CLIENT_INSTALL_PATH");
 
           if (steam_path != NULL && flatpak_has_path_prefix (preload, steam_path))
             {
diff --git a/pressure-vessel/wrap-setup.h b/pressure-vessel/wrap-setup.h
index 45a7b463a563a2b1032694cf79da9ddf8ccdab88..0c13cecee25785004cc5e01e6530370be013b8a5 100644
--- a/pressure-vessel/wrap-setup.h
+++ b/pressure-vessel/wrap-setup.h
@@ -62,6 +62,7 @@ void pv_wrap_append_preload (GPtrArray *argv,
                              const char *variable,
                              const char *option,
                              const char *preload,
+                             GStrv env,
                              PvAppendPreloadFlags flags,
                              PvRuntime *runtime,
                              FlatpakExports *exports);
diff --git a/pressure-vessel/wrap.c b/pressure-vessel/wrap.c
index 16e3ce41e1b7cb27078a3f9187f92e3f6f0de451..6cd018d9bd782469992aedbe74ea67ad08ee36c4 100644
--- a/pressure-vessel/wrap.c
+++ b/pressure-vessel/wrap.c
@@ -2118,6 +2118,7 @@ main (int argc,
                                   variable,
                                   option,
                                   g_ptr_array_index (values, j),
+                                  environ,
                                   append_preload_flags,
                                   runtime,
                                   exports);