public AppUpdater(NuGetConfig nugetConfig, IAppVersionProvider appVersionProvider, IExtendedFileSystem fileSystem, ICommandLineWrapper commandLineWrapper, IProcessWrapper processWrapper)
        {
            _appVersionProvider = appVersionProvider;
            _fileSystem = fileSystem;
            _commandLineWrapper = commandLineWrapper;
            _processWrapper = processWrapper;
            _packageSource = nugetConfig.PackageSource;
            _appPackageId = nugetConfig.AppPackageId;
            _packageRepositoryFactory = nugetConfig.RepositoryFactory;

            _oldVersionDir = Path.Combine(_fileSystem.AppDirectory, ".old");
        }
        /// <summary>
        /// Build the AppUpdater with the configured options.
        /// </summary>
        /// <returns></returns>
        public AppUpdater Build()
        {
            var nugetConfig = new NuGetConfig
                                  {
                                      AppPackageId = _appPackageId,
                                      PackageSource = _packageSource ?? NuGetConstants.DefaultFeedUrl,
                                      RepositoryFactory = _repositoryFactory ?? new AppUpdaterRepositoryFactory(),
                                  };

            var versionProvider = _versionProvider ?? new EntryAssemblyAppVersionProvider();
            var fileSystem = _fileSystem ?? new ExtendedPhysicalFileSystem(GetAppDir());
            var commandLineWrapper = _commandLineWrapper ?? new CommandLineWrapper();
            var processWrapper = _processWrapper ?? new ProcessWrapper();

            return new AppUpdater(nugetConfig, versionProvider, fileSystem, commandLineWrapper, processWrapper);
        }