public void rename_legacy_package_version(ChocolateyConfiguration config, IPackage installedPackage, ChocolateyPackageInformation pkgInfo) { if (pkgInfo != null && pkgInfo.IsSideBySide) { return; } var installDirectory = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id); if (!_fileSystem.directory_exists(installDirectory)) { // if the folder has a version on it, we need to rename the folder first. var pathResolver = new ChocolateyPackagePathResolver(NugetCommon.GetNuGetFileSystem(config, _nugetLogger), useSideBySidePaths: true); installDirectory = pathResolver.GetInstallPath(installedPackage); if (_fileSystem.directory_exists(installDirectory)) { FaultTolerance.try_catch_with_logging_exception( () => _fileSystem.move_directory(installDirectory, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id)), "Error during old package rename"); } } }
public void rename_legacy_package_version(ChocolateyConfiguration config, IPackage installedPackage, ChocolateyPackageInformation pkgInfo) { if (pkgInfo != null && pkgInfo.IsSideBySide) return; var installDirectory = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id); if (!_fileSystem.directory_exists(installDirectory)) { // if the folder has a version on it, we need to rename the folder first. var pathResolver = new ChocolateyPackagePathResolver(NugetCommon.GetNuGetFileSystem(config, _nugetLogger), useSideBySidePaths: true); installDirectory = pathResolver.GetInstallPath(installedPackage); if (_fileSystem.directory_exists(installDirectory)) { FaultTolerance.try_catch_with_logging_exception( () => _fileSystem.move_directory(installDirectory, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id)), "Error during old package rename"); } } }
public void ensure_package_files_have_compatible_attributes(ChocolateyConfiguration config, IPackage installedPackage, ChocolateyPackageInformation pkgInfo) { var installDirectory = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id); if (!_fileSystem.directory_exists(installDirectory)) { var pathResolver = new ChocolateyPackagePathResolver(NugetCommon.GetNuGetFileSystem(config, _nugetLogger), useSideBySidePaths: true); installDirectory = pathResolver.GetInstallPath(installedPackage); if (!_fileSystem.directory_exists(installDirectory)) return; } _filesService.ensure_compatible_file_attributes(installDirectory, config); }