public static void SetCurrent(string sourcePath, string targetPath) { if (Directory.Exists(targetPath)) { Directory.Delete(targetPath); } JunctionPoint.Create(targetPath, sourcePath); UpdateVersionMarkerFile(Path.GetDirectoryName(targetPath), Path.GetFileName(sourcePath).TrimStart('v')); }
public void Start(CancellationToken canelToken) { _canelToken = canelToken; _appPath = _parentProcess.Location; if (!JunctionPoint.Exists(_appPath)) { Logger.LogError(string.Format("Invalid app folder structure: \"{0}\". Turned off auto updates.", _appPath)); OnShutdown(EventArgs.Empty); return; } _appParentPath = Path.GetDirectoryName(_appPath); _updateDataPath = Path.Combine(_appParentPath, "UpdateData"); Logger.LogInfo(String.Format("Going to check {0} for update to {1}, current version is {2}", Settings.NugetServerUrl, _appPath, _parentProcess.Version)); _updatePackages = new UpdatePackages(Settings.NugetServerUrl); Logger.LogInfo("Starting update thread"); _updateThread.Start(); }