Пример #1
0
        private bool IsLibraryUpToDate(ILibraryInstallationState state, CancellationToken cancellationToken)
        {
            string cacheDir       = Path.Combine(CacheFolder, state.Name, state.Version);
            string destinationDir = Path.Combine(HostInteraction.WorkingDirectory, state.DestinationPath);

            try
            {
                foreach (string sourceFile in state.Files)
                {
                    var destinationFile = new FileInfo(Path.Combine(destinationDir, sourceFile).Replace('\\', '/'));
                    var cacheFile       = new FileInfo(Path.Combine(cacheDir, sourceFile).Replace('\\', '/'));

                    if (!destinationFile.Exists || !cacheFile.Exists || !FileHelpers.AreFilesUpToDate(destinationFile, cacheFile))
                    {
                        return(false);
                    }
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }