/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUpdate_Click(object sender, EventArgs e) { try { BlueRose.GC(); client.DownloadFileCompleted += new AsyncCompletedEventHandler(freeSODownloadCompleted); client.DownloadFileAsync(TeamCity.tcAddress("servo.freeso.org", "ProjectDollhouse_TsoClient"), "teamcity.zip"); localBuild.Text = "..."; btnUpdate.Text = "Downloading"; btnUpdate.Enabled = false; devBtn.Enabled = false; playBtn.Enabled = false; } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif btnUpdate.Text = errorBtn; btnUpdate.Enabled = false; } }
private void Form1_Load(object sender, EventArgs e) { BlueRose.GC(); try { localBuild.Text = BlueRose.readBuild(buildFile); onlineBuildLabel.Text = "#" + BlueRose.distNum(); } catch { onlineBuildLabel.Text = "Offline"; } try { if (File.Exists(fsoConfigFile)) { File.Copy(fsoConfigFile, fsoConfigFile + ".backup", true); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
void freeSODownloadCompleted(object sender, AsyncCompletedEventArgs e) { btnUpdate.Text = "Installing"; TeamCity.tcUnpack(); File.Delete(Environment.CurrentDirectory + "teamcity.zip"); BlueRose.wildUnZip(); BlueRose.writeBuild(buildFile); btnUpdate.Enabled = true; devBtn.Enabled = true; playBtn.Enabled = true; localBuild.Text = BlueRose.readBuild(buildFile); if (File.Exists(fsoConfigFile)) { File.Copy(fsoConfigFile, fsoConfigNormalBackup, true); } if (File.Exists(fsoConfigUserBackup)) { File.Copy(fsoConfigUserBackup, fsoConfigFile, true); } btnUpdate.Text = "Update FreeSO"; }
private void onlineBuildLabel_Click(object sender, EventArgs e) { try { onlineBuildLabel.Text = "#" + BlueRose.distNum(); } catch { onlineBuildLabel.Text = "FAILED"; } }
private void devBtn_Click(object sender, EventArgs e) { BlueRose.StartFSO("FSO.IDE.exe"); }
private void playBtn_Click(object sender, EventArgs e) { BlueRose.StartFSO("FreeSO.exe"); }