trivial: win32: discover user's profile directory

For anything that is normally in /var on Linux, write it
here so that users don't need admin rights.
This commit is contained in:
Mario Limonciello 2021-12-14 09:02:09 -06:00 committed by Mario Limonciello
parent dabfac661e
commit 4960ae34ba

View File

@ -1247,9 +1247,16 @@ fu_common_get_path(FuPathKind path_kind)
tmp = g_getenv("FWUPD_LOCALSTATEDIR");
if (tmp != NULL)
return g_strdup(tmp);
#ifdef _WIN32
return g_build_filename(g_getenv("USERPROFILE"),
PACKAGE_NAME,
FWUPD_LOCALSTATEDIR,
NULL);
#else
tmp = g_getenv("SNAP_USER_DATA");
if (tmp != NULL)
return g_build_filename(tmp, FWUPD_LOCALSTATEDIR, NULL);
#endif
return g_build_filename(FWUPD_LOCALSTATEDIR, NULL);
/* /proc */
case FU_PATH_KIND_PROCFS: