[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 )

Rémi Denis-Courmont remi at remlab.net
Sat Mar 6 18:08:31 CET 2010

Le samedi 6 mars 2010 00:12:22 Geoffroy Couprie, vous avez écrit :
> >> +  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.

That's irrelevant. Generally, the installer shouldn't blindly destroy files 
which it did not create.

> >> +#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" ?

"subsequent". There is the default path, libvlc.dll/../plugins and then there 
are zero or more paths listed in the plugin-path command line parameter. You 
cannot store the cache of each of those multiple plugins directories in the 
same place. Obviously, they'd overwrite one another.

> > 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) ?

That's a different problem. The plugins cache is fully automatically 
generated; there is no unrecoverable loss if you change it. Also, the cache 
only and fully depends on the installation. Two users of the same installation 
will get the same cache. In 1.1 it is physically the same file, while in 1.0 
and earlier, each user had its own identical copy.

The configuration contains user-specified settings. Ideally, we would have one 
configuration directory per installation *and* per user. But the 
implementation would be a can of worms due to permission problems.

Fortunately, only configuration parameters that do not exist in a given 
version are lost. Most of them are preserved across upgrade/downgrade. This is 
quite different from the plugin cache which is reset from scratch when 
changing version (it contains absolutely no useful data to preserve).

> 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?

We could include the version number in the vlcrc file if it is a problem. But 
it will make importing configuration from older versions more difficult.

Rémi Denis-Courmont

More information about the vlc-devel mailing list