[vlc-devel] [vlc-commits] commit: Win32: Store the plugins cache in c:\ProgramData\VideoLAN\VLC, run vlc-cache-gen.exe at install time, and as a bonus, fixes #3308 ( Geoffroy Couprie )
Geoffroy Couprie
geo.couprie at gmail.com
Fri Mar 5 23:12:22 CET 2010
Hello,
2010/3/5 Rémi Denis-Courmont <remi at remlab.net>:
>> !macro delprefs
>> StrCpy $0 0
>> !define Index 'Line${__LINE__}'
>> @@ -331,6 +339,9 @@ FunctionEnd
>> Goto "${Index}-Loop"
>> "${Index}-End:"
>> !undef Index
>> + SetShellVarContext all
>> + RMDir /r "$APPDATA\\VideoLAN"
>> + SetShellVarContext current
>
> Hmm, what if the user has another program, say VLMC in $APPDATA\VLMC ?
You're right, I should ask the VLMC developers about the paths they choose.
>
>> +#ifndef WIN32
>> if( asprintf( &path, "%s" DIR_SEP "plugins", vlcpath ) != -1 )
>> vlc_array_append( arraypaths, path );
>> +#else
>> + /* Store the plugins cache in the common AppData folder */
>> + char commonpath[PATH_MAX] = "";
>> + int res = snprintf( commonpath, PATH_MAX -1, "%s\\VideoLAN\\VLC",
>> config_GetConfDir()); + if(res == -1 || res >= PATH_MAX)
>> + {
>> + vlc_array_destroy( arraypaths );
>> + free(path);
>> + return;
>> + }
>> +#endif
>
> Err, this is not the path to the plugins cache. That's the path to plugins.
Sorry, I had a hard time understanding that code.
>
>> else
>> +#ifndef WIN32
>> CacheLoad( p_this, p_module_bank, path );
>> +#else
>> + CacheLoad( p_this, p_module_bank, commonpath );
>> +#endif
>
> Reloading the cache from the same place for every plugin path makes no sense.
>
>> +#ifndef WIN32
>> CacheSave( p_this, path, p_module_bank->pp_cache + offset,
>> p_module_bank->i_cache - offset );
>> +#else
>> + CacheSave( p_this, commonpath, p_module_bank->pp_cache + offset,
>> + p_module_bank->i_cache - offset );
>> +#endif
>
> Consecutive plugin paths will overwrite each other's cache which is idiotic.
What do you mean by "consecutive" ?
> Also, this brings back the bug that this was supposed to fix in the first
> place, that multiple VLC versions compete for the plugin cache. This sucks big
> time for developers and portable VLC users.
>
OK, I didn't know that (and yes, I asked before writing the code). By
the way, what happens with the configuration directory
(c:/Users/username/AppDataRoaming/vlc) ? The different VLC versions
are competing again (and preferences are rarely compatible between two
versions). How are the portableapps maintainers handling that? Should
I add a vlc/version/ subdirectory?
I'll fix this code to generate the cache in the plugins directory at
install time, but then, what do you think about removing the
--reset-plugins-cache option, at least for Windows users? It will fail
completely, as they need admin rights to write to c:/Program Files.
Regards,
Geoffroy
More information about the vlc-devel
mailing list