lua: discard basedir and DIR_SEP on UWP
On UWP, the lua folder is deployed right next to the executable in the
app installation folder, but the path returned by config_GetUserDir
(which is basedir
) points to the local packages folder, located in the
current user AppData folder. Therefore, discard basedir
and the
directory separator, to allow VLC to find the lua folder.
Merge request reports
Activity
mentioned in issue libvlc-nuget#13
added MRStatus::Reviewable label
183 183 if (unlikely(basedir == NULL)) 184 184 return list; 185 185 186 #ifndef VLC_WINSTORE_APP 186 187 if (likely(asprintf(list, "%s"DIR_SEP"lua"DIR_SEP"%s", 187 188 basedir, luadirname) != -1)) 189 #else 190 if (likely(asprintf(list, "lua"DIR_SEP"%s", luadirname) != -1)) Then, there needs to be a way to get the absolute path to the folder with the UWP executable, to use that as
basedir
. So like @jbk said, I'd imagine that would need to be implemented in the core.VLC_USERDATA_DIR
corresponds to%AppData%
on Windows and should not be changed (used by the MediaLibrary for example).We may need a separate
VLC_XXX_DIR
to address the internal scripts. None of these seems to fit:-
VLC_HOME_DIR
/* User's home */ -
VLC_CONFIG_DIR
/* VLC-specific configuration directory */ -
VLC_USERDATA_DIR
/* VLC-specific data directory */ -
VLC_CACHE_DIR
/* VLC-specific user cached data directory */
Then on UWP we can report a different location than the one from a regular Win32 installation (
dirs.c
vsdirs-uap.c
).-
I fail to see a problem with using the user data directory here. This is the directory in which to place generic stuff that:
- cannot be regenerated on the fly: cache
- and does not fit in any other category: configuration, downloads, templates, public share, documents, music, pictures, videos.
AFAIK, no platform defines a more specific and thus better fitting directory. Adding a new script directory that just ends up aliasing the data directory on all platforms would not be terribly useful.
This code is called for
VLC_USERDATA_DIR
,VLC_PKG_LIBEXEC_DIR
andVLC_PKG_DATA_DIR
.The share folder is actually added via
config_GetSysPath(VLC_PKG_DATA_DIR, NULL)
. Maybe it doesn't point in the right place in UWP ? Or the UWP packaging doesn't put the lua scripts in a lua folder as expected ?
added MRStatus::InReview label and removed MRStatus::Reviewable label
added MRStatus::Stale label and removed MRStatus::InReview label
added MRStatus::InReview label and removed MRStatus::Stale label
added MRStatus::Stale label and removed MRStatus::InReview label
added MRStatus::InReview label and removed MRStatus::Stale label
added MRStatus::Stale label and removed MRStatus::InReview label
changed milestone to %3.0.x maintenance
changed milestone to %4.0