public static Settings GetSettings(FrbdkUpdaterSettings settings) { var returnSettings = new Settings { ExtractionPath = settings.SelectedDirectory }; if (settings.CleanFolder) { returnSettings.DirectoryToClear = settings.SelectedDirectory; } returnSettings.ApplicationToRunAfterWorkIsDone = settings.GlueRunPath; returnSettings.Passive = settings.Passive; returnSettings.ForceDownload = settings.ForceDownload; returnSettings.Url = StartRemoteUri + settings.SelectedSource + FrbdkFileName; returnSettings.SaveFile = UserAppPath + @"FRBDK\" + settings.SelectedSource + FrbdkFileName; returnSettings.LocalFileForTimeStamp = UserAppPath + @"FRBDK\" + settings.SelectedSource + @"\timestamp.txt"; return(returnSettings); }
void CreateUpdaterFiles() { FrbdkUpdaterSettings fus = new FrbdkUpdaterSettings(); fus.CleanFolder = true; fus.GlueRunPath = null; fus.SelectedSource = "DailyBuild/"; fus.SelectedDirectory = //ComponentStorage.GetValue<string>(FrbdkSetupComponent.Path); FrbdkUpdaterManager.FrbdkInProgramFiles; fus.Passive = true; fus.SaveSettings(); #if !DEBUG var key = Registry.LocalMachine.CreateSubKey("SOFTWARE\\FlatRedBall"); key.SetValue("FrbdkDir", fus.SelectedDirectory); key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\FlatRedBall"); #endif }
private void SyncFormLoad(object sender, EventArgs e) { _settings = FrbdkUpdaterSettings.LoadSettings(); if (!string.IsNullOrEmpty(_settings.SelectedDirectory)) { tbPath.Text = _settings.SelectedDirectory; } cbCleanFolder.Checked = _settings.CleanFolder; cbForceDownload.Checked = _settings.ForceDownload; }
public static Settings GetSettings(FrbdkUpdaterSettings settings) { var returnSettings = new Settings {ExtractionPath = settings.SelectedDirectory}; if (settings.CleanFolder) { returnSettings.DirectoryToClear = settings.SelectedDirectory; } returnSettings.ApplicationToRunAfterWorkIsDone = settings.GlueRunPath; returnSettings.Passive = settings.Passive; returnSettings.ForceDownload = settings.ForceDownload; returnSettings.Url = StartRemoteUri + settings.SelectedSource + FrbdkFileName; returnSettings.SaveFile = UserAppPath + @"FRBDK\" + settings.SelectedSource + FrbdkFileName; returnSettings.LocalFileForTimeStamp = UserAppPath + @"FRBDK\" + settings.SelectedSource + @"\timestamp.txt"; return returnSettings; }
private void SyncFormLoad(object sender, EventArgs e) { BuildMenu(); _settings = FrbdkUpdaterSettings.LoadSettings(); tbPath.Text = _settings.SelectedDirectory; foreach (Item item in cbSyncTo.Items) { if(item.Value == _settings.SelectedSource) { cbSyncTo.SelectedItem = item; break; } } cbCleanFolder.Checked = _settings.CleanFolder; cbForceDownload.Checked = _settings.ForceDownload; }
private void FrmMainLoad(object sender, EventArgs e) { try { var extension = FileManager.GetExtension(mFileNameToLoad); List <string> stringList = new List <string>(); if (extension == UpdaterRuntimeSettings.RuntimeSettingsExtension) { var updaterRuntimeSettings = UpdaterRuntimeSettings.FromFile(mFileNameToLoad); if (string.IsNullOrEmpty(updaterRuntimeSettings.LocationToSaveFile)) { throw new Exception("UserRuntimeSettings LocationToSaveFile is null. Loaded settings from " + Settings.UserAppPath); } _settings = Settings.GetSettings(updaterRuntimeSettings); Logger.Log("Loading UpdaterRuntimeSettings"); if (string.IsNullOrEmpty(_settings.SaveFile)) { throw new Exception("The settings SaveFile was null when loading from UpdaterRuntimeSettings"); } } else { FrbdkUpdaterSettings tempSettings; if (string.IsNullOrEmpty(mFileNameToLoad)) { throw new Exception("The command line argument must not be null"); } tempSettings = FrbdkUpdaterSettings.LoadSettings(mFileNameToLoad); stringList.Add("Selected source:" + tempSettings.SelectedSource); _settings = Settings.GetSettings(tempSettings); Logger.Log("Loading FrbdkUpdaterSettings"); if (string.IsNullOrEmpty(_settings.SaveFile)) { throw new Exception("The settings SaveFile was null when loading from the FRBDKUpdaterSettings"); } } Messaging.ShowAlerts = !_settings.Passive; if (!String.IsNullOrEmpty(_settings.Title)) { UserMessage = _settings.Title; } var downloader = new Downloader(_settings); downloader.ReportProgress += DownloaderOnReportProgress; downloader.ErrorOccured += DownloaderOnErrorOccured; downloader.DownloadComplete += DownloaderOnDownloadComplete; downloader.Start(); } catch (Exception outerException) { MessageBox.Show(outerException.ToString()); } }