Installer wrapper (#74) [TGSDeploy]

* Add a version command

* Remove service update from commandline

* Ayy lmao

* Fix

* Final touches

* Last thing

* Can't break backwards compat I suppose

* Version bump to 3.0.85.0

* Final cleanup

* This time I swear

* VERY LAST FUCKING THING

* CANT STOP FUCKING UP THE UI

* AHHHH!!!!!

* Do not become like me kids
This commit is contained in:
Jordan Brown
2017-06-23 11:56:19 -04:00
committed by GitHub
parent 6b8caf241e
commit 4f8a848388
23 changed files with 3069 additions and 58 deletions
+1 -1
View File
@@ -148,6 +148,6 @@ You can clear all active test merges using `Reset to Origin Branch` in the `Repo
## CONTRIBUTING
* IF YOU MAKE ANY CHANGES TO THE CODE, BE SURE TO BUMP THE VERSION NUMBERS IN ALL 4 "AssemblyInfo.cs"s AND ON LINE 3 OF TGServiceInstaller/Product.wx
* IF YOU MAKE ANY CHANGES TO THE CODE, BE SURE TO BUMP THE VERSION NUMBERS IN ALL 5 "AssemblyInfo.cs"s AND ON LINE 3 OF TGServiceInstaller/Product.wx
* My recommendation is bump the revision number per test release, the minor version per PR, and the major version if you rewrite the whole thing.
* To have auto deployment to github releases work, put `[TGSDeploy]` somewhere in your pull request title
+2 -2
View File
@@ -22,5 +22,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.0.84.0")]
[assembly: AssemblyFileVersion("3.0.84.0")]
[assembly: AssemblyVersion("3.0.85.0")]
[assembly: AssemblyFileVersion("3.0.85.0")]
+1 -32
View File
@@ -15,7 +15,7 @@ namespace TGCommandLine
public RootCommand()
{
if (IsRealRoot()) //stack overflows
Children = new Command[] { new UpdateCommand(), new TestmergeCommand(), new IRCCommand(), new RepoCommand(), new BYONDCommand(), new DMCommand(), new DDCommand(), new ConfigCommand(), new ChatCommand(), new ServiceUpdateCommand() };
Children = new Command[] { new UpdateCommand(), new TestmergeCommand(), new IRCCommand(), new RepoCommand(), new BYONDCommand(), new DMCommand(), new DDCommand(), new ConfigCommand(), new ChatCommand() };
}
public override ExitCode Run(IList<string> parameters)
{
@@ -144,35 +144,4 @@ namespace TGCommandLine
return "Merges the specified pull request and updates the server";
}
}
class ServiceUpdateCommand : Command
{
public ServiceUpdateCommand()
{
Keyword = "service-update";
}
public override ExitCode Run(IList<string> parameters)
{
if (parameters.Count == 0 || parameters[0] != "--verify")
Console.WriteLine("This command should only be used by the installer program. Please use the --verify option to confirm this command");
else
{
Server.GetComponent<ITGSService>().StopForUpdate();
GC.Collect();
Thread.Sleep(10000);
}
return ExitCode.Normal;
}
protected override string GetArgumentString()
{
return "[--verify]";
}
protected override string GetHelpText()
{
return "Internal. Stops the service in preparation of an update operation.";
}
}
}
+2 -2
View File
@@ -25,5 +25,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.84.0")]
[assembly: AssemblyFileVersion("3.0.84.0")]
[assembly: AssemblyVersion("3.0.85.0")]
[assembly: AssemblyFileVersion("3.0.85.0")]
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
+221
View File
@@ -0,0 +1,221 @@
namespace TGInstallerWrapper
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
this.ProgressBar = new System.Windows.Forms.ProgressBar();
this.DeskShortcutsCheckbox = new System.Windows.Forms.CheckBox();
this.StartShortcutsCheckbox = new System.Windows.Forms.CheckBox();
this.InstallingLabel = new System.Windows.Forms.Label();
this.PathTextBox = new System.Windows.Forms.TextBox();
this.SelectPathButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.VersionLabel = new System.Windows.Forms.Label();
this.InstallButton = new System.Windows.Forms.Button();
this.ShowLogCheckbox = new System.Windows.Forms.CheckBox();
this.TargetVersionLabel = new System.Windows.Forms.Label();
this.InstallCancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// ProgressBar
//
this.ProgressBar.Location = new System.Drawing.Point(11, 119);
this.ProgressBar.Name = "ProgressBar";
this.ProgressBar.Size = new System.Drawing.Size(386, 22);
this.ProgressBar.TabIndex = 0;
//
// DeskShortcutsCheckbox
//
this.DeskShortcutsCheckbox.AutoSize = true;
this.DeskShortcutsCheckbox.Checked = true;
this.DeskShortcutsCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
this.DeskShortcutsCheckbox.Font = new System.Drawing.Font("Verdana", 12F);
this.DeskShortcutsCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.DeskShortcutsCheckbox.Location = new System.Drawing.Point(12, 61);
this.DeskShortcutsCheckbox.Name = "DeskShortcutsCheckbox";
this.DeskShortcutsCheckbox.Size = new System.Drawing.Size(214, 22);
this.DeskShortcutsCheckbox.TabIndex = 2;
this.DeskShortcutsCheckbox.Text = "Add Desktop Shortcuts";
this.DeskShortcutsCheckbox.UseVisualStyleBackColor = true;
//
// StartShortcutsCheckbox
//
this.StartShortcutsCheckbox.AutoSize = true;
this.StartShortcutsCheckbox.Checked = true;
this.StartShortcutsCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
this.StartShortcutsCheckbox.Font = new System.Drawing.Font("Verdana", 12F);
this.StartShortcutsCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.StartShortcutsCheckbox.Location = new System.Drawing.Point(289, 61);
this.StartShortcutsCheckbox.Name = "StartShortcutsCheckbox";
this.StartShortcutsCheckbox.Size = new System.Drawing.Size(236, 22);
this.StartShortcutsCheckbox.TabIndex = 3;
this.StartShortcutsCheckbox.Text = "Add Start Menu Shortcuts";
this.StartShortcutsCheckbox.UseVisualStyleBackColor = true;
//
// InstallingLabel
//
this.InstallingLabel.AutoSize = true;
this.InstallingLabel.Font = new System.Drawing.Font("Verdana", 12F);
this.InstallingLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.InstallingLabel.Location = new System.Drawing.Point(8, 37);
this.InstallingLabel.Name = "InstallingLabel";
this.InstallingLabel.Size = new System.Drawing.Size(52, 18);
this.InstallingLabel.TabIndex = 1;
this.InstallingLabel.Text = "Path:";
//
// PathTextBox
//
this.PathTextBox.Location = new System.Drawing.Point(66, 35);
this.PathTextBox.Name = "PathTextBox";
this.PathTextBox.ReadOnly = true;
this.PathTextBox.Size = new System.Drawing.Size(413, 20);
this.PathTextBox.TabIndex = 4;
//
// SelectPathButton
//
this.SelectPathButton.Location = new System.Drawing.Point(485, 35);
this.SelectPathButton.Name = "SelectPathButton";
this.SelectPathButton.Size = new System.Drawing.Size(40, 20);
this.SelectPathButton.TabIndex = 6;
this.SelectPathButton.Text = "...";
this.SelectPathButton.UseVisualStyleBackColor = true;
this.SelectPathButton.Click += new System.EventHandler(this.SelectPathButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Verdana", 12F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.label1.Location = new System.Drawing.Point(8, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(155, 18);
this.label1.TabIndex = 7;
this.label1.Text = "Detected Version:";
//
// VersionLabel
//
this.VersionLabel.AutoSize = true;
this.VersionLabel.Font = new System.Drawing.Font("Verdana", 12F);
this.VersionLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.VersionLabel.Location = new System.Drawing.Point(169, 9);
this.VersionLabel.Name = "VersionLabel";
this.VersionLabel.Size = new System.Drawing.Size(228, 18);
this.VersionLabel.TabIndex = 8;
this.VersionLabel.Text = "None (No Service Running)";
//
// InstallButton
//
this.InstallButton.Location = new System.Drawing.Point(400, 89);
this.InstallButton.Name = "InstallButton";
this.InstallButton.Size = new System.Drawing.Size(125, 22);
this.InstallButton.TabIndex = 9;
this.InstallButton.Text = "Install";
this.InstallButton.UseVisualStyleBackColor = true;
this.InstallButton.Click += new System.EventHandler(this.InstallButton_Click);
//
// ShowLogCheckbox
//
this.ShowLogCheckbox.AutoSize = true;
this.ShowLogCheckbox.Font = new System.Drawing.Font("Verdana", 12F);
this.ShowLogCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.ShowLogCheckbox.Location = new System.Drawing.Point(289, 90);
this.ShowLogCheckbox.Name = "ShowLogCheckbox";
this.ShowLogCheckbox.Size = new System.Drawing.Size(105, 22);
this.ShowLogCheckbox.TabIndex = 10;
this.ShowLogCheckbox.Text = "Show Log";
this.ShowLogCheckbox.UseVisualStyleBackColor = true;
//
// TargetVersionLabel
//
this.TargetVersionLabel.AutoSize = true;
this.TargetVersionLabel.Font = new System.Drawing.Font("Verdana", 12F);
this.TargetVersionLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242)))));
this.TargetVersionLabel.Location = new System.Drawing.Point(8, 90);
this.TargetVersionLabel.Name = "TargetVersionLabel";
this.TargetVersionLabel.Size = new System.Drawing.Size(132, 18);
this.TargetVersionLabel.TabIndex = 11;
this.TargetVersionLabel.Text = "Target Version:";
//
// InstallCancelButton
//
this.InstallCancelButton.Enabled = false;
this.InstallCancelButton.Location = new System.Drawing.Point(400, 119);
this.InstallCancelButton.Name = "InstallCancelButton";
this.InstallCancelButton.Size = new System.Drawing.Size(125, 22);
this.InstallCancelButton.TabIndex = 12;
this.InstallCancelButton.Text = "Cancel";
this.InstallCancelButton.UseVisualStyleBackColor = true;
this.InstallCancelButton.Click += new System.EventHandler(this.CancelButton_Click);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(40)))), ((int)(((byte)(34)))));
this.ClientSize = new System.Drawing.Size(537, 153);
this.Controls.Add(this.InstallCancelButton);
this.Controls.Add(this.TargetVersionLabel);
this.Controls.Add(this.ShowLogCheckbox);
this.Controls.Add(this.InstallButton);
this.Controls.Add(this.VersionLabel);
this.Controls.Add(this.label1);
this.Controls.Add(this.SelectPathButton);
this.Controls.Add(this.PathTextBox);
this.Controls.Add(this.StartShortcutsCheckbox);
this.Controls.Add(this.DeskShortcutsCheckbox);
this.Controls.Add(this.InstallingLabel);
this.Controls.Add(this.ProgressBar);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Main";
this.Text = "/tg/station Server Installer";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar ProgressBar;
private System.Windows.Forms.CheckBox DeskShortcutsCheckbox;
private System.Windows.Forms.CheckBox StartShortcutsCheckbox;
private System.Windows.Forms.Label InstallingLabel;
private System.Windows.Forms.TextBox PathTextBox;
private System.Windows.Forms.Button SelectPathButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label VersionLabel;
private System.Windows.Forms.Button InstallButton;
private System.Windows.Forms.CheckBox ShowLogCheckbox;
private System.Windows.Forms.Label TargetVersionLabel;
private System.Windows.Forms.Button InstallCancelButton;
}
}
+179
View File
@@ -0,0 +1,179 @@
using Microsoft.Deployment.WindowsInstaller;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TGServiceInterface;
namespace TGInstallerWrapper
{
public partial class Main : Form
{
const string InstallDir = "TG Station Server"; //keep this in sync with the msi installer
bool installing = false;
bool cancelled = false;
bool pathIsDefault = true;
public Main()
{
InitializeComponent();
FormClosing += Main_FormClosing;
PathTextBox.Text = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + Path.DirectorySeparatorChar + InstallDir;
if (Server.VerifyConnection() == null)
try
{
VersionLabel.Text = Server.GetComponent<ITGSService>().Version();
}
catch
{
VersionLabel.Text = "< v3.0.85.0 (Missing ITGService.Version())";
}
TargetVersionLabel.Text += " v" + FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion;
}
private void Main_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = installing; //not allowed, nununu
}
async void DoInstall()
{
string path = null;
string logfile = null;
try
{
var args = new List<string>();
if (!pathIsDefault)
args.Add(String.Format("INSTALLFOLDER=\"{0}\"", PathTextBox.Text));
if (StartShortcutsCheckbox.Checked)
args.Add("INSTALLSHORTCUTSTART=1");
if (DeskShortcutsCheckbox.Checked)
args.Add("INSTALLSHORTCUTDESK=1");
SelectPathButton.Enabled = false;
PathTextBox.Enabled = false;
DeskShortcutsCheckbox.Enabled = false;
StartShortcutsCheckbox.Enabled = false;
InstallButton.Enabled = false;
ShowLogCheckbox.Enabled = false;
InstallButton.Text = "Installing...";
path = Path.GetTempFileName();
File.Delete(path); //we want a dir not a file
Directory.CreateDirectory(path);
var msipath = path + Path.DirectorySeparatorChar + "TGServiceInstaller.msi";
File.WriteAllBytes(msipath, Properties.Resources.TGServiceInstaller);
File.WriteAllBytes(path + Path.DirectorySeparatorChar + "cab1.cab", Properties.Resources.cab1);
ProgressBar.Style = ProgressBarStyle.Marquee;
if (Server.VerifyConnection() == null)
try
{
Server.GetComponent<ITGSService>().PrepareForUpdate();
}
catch
{
try //maybe older version
{
Server.GetComponent<ITGSService>().StopForUpdate(); //this version tries to stop the service itself
await Task.Factory.StartNew(() => Thread.Sleep(15000)); //so let's just let that happen first
}
catch
{
if (MessageBox.Show("ITGSService.PrepareForUpdate() threw an exception! Existing DreamDaemon instances will be terminated. Continue?", "Warning", MessageBoxButtons.YesNo) != DialogResult.Yes)
return;
}
}
InstallCancelButton.Enabled = true;
if (ShowLogCheckbox.Checked)
{
logfile = path + Path.DirectorySeparatorChar + "tgsinstall.log";
Installer.EnableLog(InstallLogModes.Verbose | InstallLogModes.PropertyDump, logfile);
}
var cl = args.Count > 0 ? String.Join(" ", args) : "";
Installer.SetInternalUI(InstallUIOptions.Silent);
Installer.SetExternalUI(OnUIUpdate, InstallLogModes.Progress);
await Task.Factory.StartNew(() => Installer.InstallProduct(msipath, cl));
if (cancelled)
{
MessageBox.Show("Operation cancelled!");
return;
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.ToString());
return;
}
finally
{
InstallCancelButton.Enabled = false;
ShowLogCheckbox.Enabled = true;
SelectPathButton.Enabled = true;
PathTextBox.Enabled = true;
DeskShortcutsCheckbox.Enabled = true;
StartShortcutsCheckbox.Enabled = true;
ProgressBar.Style = ProgressBarStyle.Blocks;
InstallButton.Enabled = true;
InstallButton.Text = "Install";
installing = false;
cancelled = false;
if (ShowLogCheckbox.Checked && logfile != null)
try
{
Process.Start(logfile).WaitForInputIdle();
}
catch { }
if (path != null)
try
{
Directory.Delete(path, true);
}
catch { }
}
MessageBox.Show("Success!");
Application.Exit();
}
MessageResult OnUIUpdate(InstallMessage messageType, string message, MessageButtons buttons, MessageIcon icon, MessageDefaultButton defaultButton)
{
if (cancelled && installing)
{
installing = false;
return MessageResult.Cancel;
}
return MessageResult.OK;
}
private void InstallButton_Click(object sender, EventArgs e)
{
DoInstall();
}
private void SelectPathButton_Click(object sender, EventArgs e)
{
var fbd = new FolderBrowserDialog()
{
Description = "Select where you would like to install the service executables. This isn't where an actual server instance is created.",
ShowNewFolderButton = true
};
if (fbd.ShowDialog() != DialogResult.OK)
return;
pathIsDefault = false;
PathTextBox.Text = fbd.SelectedPath + Path.DirectorySeparatorChar + InstallDir;
}
private void CancelButton_Click(object sender, EventArgs e)
{
cancelled = true;
InstallCancelButton.Enabled = false;
}
}
}
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TGInstallerWrapper
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TGStation Server Installer")]
[assembly: AssemblyDescription("Installation manager for /tg/station Server")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8956d4c3-bfb9-448e-bf5f-ee7e6f9996f9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.85.0")]
[assembly: AssemblyFileVersion("3.0.85.0")]
+83
View File
@@ -0,0 +1,83 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TGInstallerWrapper.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TGInstallerWrapper.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] cab1 {
get {
object obj = ResourceManager.GetObject("cab1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] TGServiceInstaller {
get {
object obj = ResourceManager.GetObject("TGServiceInstaller", resourceCulture);
return ((byte[])(obj));
}
}
}
}
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cab1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\TGServiceInstaller\bin\Release\cab1.cab;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="TGServiceInstaller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>...\..\TGServiceInstaller\bin\Release\TGServiceInstaller.msi;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>TGInstallerWrapper</RootNamespace>
<AssemblyName>TG Station Server Installer</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Deployment.WindowsInstaller, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TGServiceInterface\TGServiceInterface.csproj">
<Project>{ac4e7e8b-f83a-481c-a8b0-8fa4e8ae59ab}</Project>
<Name>TGServiceInterface</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<Content Include="tgs.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

+8 -2
View File
@@ -1,7 +1,13 @@
$src = $Env:APPVEYOR_BUILD_FOLDER + "\TGServiceInstaller\bin\Release"
$src = $Env:APPVEYOR_BUILD_FOLDER + "\TGInstallerWrapper\bin\Release"
Remove-Item "$src\Microsoft.Deployment.WindowsInstaller.xml"
Remove-Item "$src\TG Station Server Installer.exe.config"
Remove-Item "$src\TG Station Server Installer.pdb"
Remove-Item "$src\TGServiceInterface.pdb"
$destination = $Env:APPVEYOR_BUILD_FOLDER + "\TGS3.zip"
If(Test-path $destination) {Remove-item $destination}
If(Test-path $destination) {Remove-item $destination}
Add-Type -assembly "system.io.compression.filesystem"
+12 -5
View File
@@ -1,6 +1,5 @@
using System;
using System.ServiceModel;
using System.Threading;
using TGServiceInterface;
namespace TGServerService
@@ -33,6 +32,11 @@ namespace TGServerService
DisposeChat();
}
public string Version()
{
return TGServerService.Version;
}
//one stop update
public string UpdateServer(TGRepoUpdateMethod updateType, bool push_changelog_if_enabled, ushort testmerge_pr)
{
@@ -81,15 +85,18 @@ namespace TGServerService
}
//public api
public void VerifyConnection()
{}
public void VerifyConnection() { }
//public api
public void StopForUpdate()
{
TGServerService.WriteInfo("Stopping for update!", TGServerService.EventID.UpdateRequest);
PrepareForUpdate();
}
//public api
public void PrepareForUpdate()
{
Properties.Settings.Default.ReattachToDD = true;
TGServerService.LocalStop();
}
//mostly generated code with a call to RunDisposals()
+2 -2
View File
@@ -25,5 +25,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.84.0")]
[assembly: AssemblyFileVersion("3.0.84.0")]
[assembly: AssemblyVersion("3.0.85.0")]
[assembly: AssemblyFileVersion("3.0.85.0")]
+1 -6
View File
@@ -77,7 +77,7 @@ namespace TGServerService
static TGServerService ActiveService; //So everyone else can write to our eventlog
public static readonly string Version = "/tg/station 13 Server Service " + FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion;
public static readonly string Version = "/tg/station 13 Server Service v" + FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion;
public static void WriteInfo(string message, EventID id)
{
@@ -91,11 +91,6 @@ namespace TGServerService
{
ActiveService.EventLog.WriteEntry(message, EventLogEntryType.Warning, (int)id);
}
public static void LocalStop()
{
ThreadPool.QueueUserWorkItem(_ => { ActiveService.Stop(); });
}
ServiceHost host; //the WCF host
+5 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="TG Station Server" Language="1033" Version="3.0.84.0" Manufacturer="/tg/station 13" UpgradeCode="663badae-ddca-4aa9-8f3f-3b7b20332eac">
<Product Id="*" Name="TG Station Server" Language="1033" Version="3.0.85.0" Manufacturer="/tg/station 13" UpgradeCode="663badae-ddca-4aa9-8f3f-3b7b20332eac">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
@@ -15,7 +15,8 @@
</Feature>
<Icon Id="tgs.ico" SourceFile="..\tgs.ico"/>
<Property Id="ARPPRODUCTICON" Value="tgs.ico" />
<Property Id="INSTALLSHORTCUTDESK" />
<Property Id="INSTALLSHORTCUTDESK" Value="0" />
<Property Id="INSTALLSHORTCUTSTART" Value="0" />
</Product>
<Fragment>
@@ -40,6 +41,7 @@
<Fragment>
<ComponentGroup Id="StartMenuShortcuts" Directory="ApplicationProgramsFolder">
<Component Id="StartMenuShortcut" Guid="685790d5-24ae-431b-8c5a-c71125e389d5">
<Condition>INSTALLSHORTCUTSTART = 1</Condition>
<Shortcut Id="StartMenuShortcutCL"
Name="TG Command Line"
Target="[#TGCommandLine.exe]"
@@ -60,6 +62,7 @@
<ComponentGroup Id="DesktopShortcuts" Directory="DesktopFolder">
<Component Id="DesktopShortcut" Guid="08950533-8264-4824-b7a5-8424c48375df">
<Condition>INSTALLSHORTCUTDESK = 1</Condition>
<Shortcut Id="DesktopShortcutCL"
Name="TG Command Line"
Target="[#TGCommandLine.exe]"
@@ -25,5 +25,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.84.0")]
[assembly: AssemblyFileVersion("3.0.84.0")]
[assembly: AssemblyVersion("3.0.85.0")]
[assembly: AssemblyFileVersion("3.0.85.0")]
+12 -1
View File
@@ -63,10 +63,21 @@ namespace TGServiceInterface
void VerifyConnection();
/// <summary>
/// Stops the service without closing DD and sets a flag for it to reattach once it restarts
/// Next stop of the service will not close DD and sets a flag for it to reattach once it restarts
/// </summary>
[OperationContract]
void PrepareForUpdate();
[OperationContract]
[Obsolete("StopForUpdate is deprecated, please use PrepareForUpdate instead")]
void StopForUpdate();
/// <summary>
/// Retrieve's the service's version
/// </summary>
/// <returns>The service's version</returns>
[OperationContract]
string Version();
}
/// <summary>
+13 -1
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
VisualStudioVersion = 15.0.26430.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGServerService", "TGServerService\TGServerService.csproj", "{F32EDA25-0855-411C-AF5E-F0D042917E2D}"
EndProject
@@ -23,6 +23,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
View TGS3 Logs.xml = View TGS3 Logs.xml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGInstallerWrapper", "TGInstallerWrapper\TGInstallerWrapper.csproj", "{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}"
ProjectSection(ProjectDependencies) = postProject
{154435F6-0890-42D4-9AEC-B743D4FBC1CB} = {154435F6-0890-42D4-9AEC-B743D4FBC1CB}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -70,6 +75,13 @@ Global
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|Any CPU.Build.0 = Release|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|x86.ActiveCfg = Release|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|x86.Build.0 = Release|x86
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Debug|x86.ActiveCfg = Debug|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Debug|x86.Build.0 = Debug|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|Any CPU.Build.0 = Release|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|x86.ActiveCfg = Release|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE