├── .gitattributes
├── .gitignore
├── 1.ico
├── App.config
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── Form2.Designer.cs
├── Form2.cs
├── Form2.resx
├── Helper.cs
├── LICENSE
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── README.md
├── XeniaUpdater-main-pre-rewrite.zip
├── XeniaUpdater.csproj
├── XeniaUpdater.csproj.user
├── XeniaUpdater.sln
├── bin
├── Debug
│ ├── XeniaUpdater.exe
│ ├── XeniaUpdater.exe.config
│ └── XeniaUpdater.pdb
└── Release
│ ├── XeniaUpdater.exe
│ ├── XeniaUpdater.exe.config
│ ├── XeniaUpdater.pdb
│ └── XeniaUpdaterLog.txt
├── version-Debug.txt
└── version-Release.txt
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs/
2 | obj/Debug/XeniaUpdater.exe
3 | obj/Debug/XeniaUpdater.exe
4 | obj/Debug/XeniaUpdater.pdb
5 | bin/Debug/xenia.log
6 | bin/Debug/XeniaCanary/LastUpdate/xenia_canary.zip
7 | bin/Debug/XeniaCanary/xenia_canary.exe
8 | bin/Debug/XeniaCanary/xenia_canary.zip
9 | bin/Debug/response.txt
10 | bin/Debug/UploadFile.bat
11 | .vscode/launch.json
12 | .idea/.idea.XeniaUpdater/.idea/encodings.xml
13 | .idea/.idea.XeniaUpdater/.idea/indexLayout.xml
14 | .idea/.idea.XeniaUpdater/.idea/projectSettingsUpdater.xml
15 | .idea/.idea.XeniaUpdater/.idea/vcs.xml
16 | .idea/.idea.XeniaUpdater/.idea/workspace.xml
17 |
--------------------------------------------------------------------------------
/1.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/1.ico
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace XeniaUpdater_C
3 | {
4 | partial class Form1
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
33 | this.masterUpdateBTN = new System.Windows.Forms.Button();
34 | this.label1 = new System.Windows.Forms.Label();
35 | this.masterStartBTN = new System.Windows.Forms.Button();
36 | this.canaryStartBTN = new System.Windows.Forms.Button();
37 | this.label2 = new System.Windows.Forms.Label();
38 | this.canaryUpdateBTN = new System.Windows.Forms.Button();
39 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
40 | this.percentageLBL = new System.Windows.Forms.Label();
41 | this.infoBTN = new System.Windows.Forms.Button();
42 | this.updateBTN = new System.Windows.Forms.Button();
43 | this.button1 = new System.Windows.Forms.Button();
44 | this.button2 = new System.Windows.Forms.Button();
45 | this.SuspendLayout();
46 | //
47 | // masterUpdateBTN
48 | //
49 | this.masterUpdateBTN.Location = new System.Drawing.Point(115, 6);
50 | this.masterUpdateBTN.Name = "masterUpdateBTN";
51 | this.masterUpdateBTN.Size = new System.Drawing.Size(69, 23);
52 | this.masterUpdateBTN.TabIndex = 0;
53 | this.masterUpdateBTN.Text = "Update";
54 | this.masterUpdateBTN.UseVisualStyleBackColor = true;
55 | this.masterUpdateBTN.Click += new System.EventHandler(this.button1_Click);
56 | //
57 | // label1
58 | //
59 | this.label1.AutoSize = true;
60 | this.label1.Location = new System.Drawing.Point(7, 11);
61 | this.label1.Name = "label1";
62 | this.label1.Size = new System.Drawing.Size(69, 13);
63 | this.label1.TabIndex = 1;
64 | this.label1.Text = "Xenia Master";
65 | //
66 | // masterStartBTN
67 | //
68 | this.masterStartBTN.Location = new System.Drawing.Point(190, 6);
69 | this.masterStartBTN.Name = "masterStartBTN";
70 | this.masterStartBTN.Size = new System.Drawing.Size(69, 23);
71 | this.masterStartBTN.TabIndex = 2;
72 | this.masterStartBTN.Text = "Start";
73 | this.masterStartBTN.UseVisualStyleBackColor = true;
74 | this.masterStartBTN.Click += new System.EventHandler(this.button2_Click);
75 | //
76 | // canaryStartBTN
77 | //
78 | this.canaryStartBTN.Location = new System.Drawing.Point(190, 35);
79 | this.canaryStartBTN.Name = "canaryStartBTN";
80 | this.canaryStartBTN.Size = new System.Drawing.Size(69, 23);
81 | this.canaryStartBTN.TabIndex = 6;
82 | this.canaryStartBTN.Text = "Start";
83 | this.canaryStartBTN.UseVisualStyleBackColor = true;
84 | this.canaryStartBTN.Click += new System.EventHandler(this.button3_Click);
85 | //
86 | // label2
87 | //
88 | this.label2.AutoSize = true;
89 | this.label2.Location = new System.Drawing.Point(7, 40);
90 | this.label2.Name = "label2";
91 | this.label2.Size = new System.Drawing.Size(88, 13);
92 | this.label2.TabIndex = 5;
93 | this.label2.Text = "Xenia Canary PR";
94 | //
95 | // canaryUpdateBTN
96 | //
97 | this.canaryUpdateBTN.Location = new System.Drawing.Point(115, 35);
98 | this.canaryUpdateBTN.Name = "canaryUpdateBTN";
99 | this.canaryUpdateBTN.Size = new System.Drawing.Size(69, 23);
100 | this.canaryUpdateBTN.TabIndex = 4;
101 | this.canaryUpdateBTN.Text = "Update";
102 | this.canaryUpdateBTN.UseVisualStyleBackColor = true;
103 | this.canaryUpdateBTN.Click += new System.EventHandler(this.button4_Click);
104 | //
105 | // progressBar1
106 | //
107 | this.progressBar1.Location = new System.Drawing.Point(10, 64);
108 | this.progressBar1.Name = "progressBar1";
109 | this.progressBar1.Size = new System.Drawing.Size(219, 23);
110 | this.progressBar1.TabIndex = 7;
111 | //
112 | // percentageLBL
113 | //
114 | this.percentageLBL.AutoSize = true;
115 | this.percentageLBL.BackColor = System.Drawing.Color.Transparent;
116 | this.percentageLBL.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
117 | this.percentageLBL.ForeColor = System.Drawing.SystemColors.ControlText;
118 | this.percentageLBL.Location = new System.Drawing.Point(235, 69);
119 | this.percentageLBL.Name = "percentageLBL";
120 | this.percentageLBL.Size = new System.Drawing.Size(21, 13);
121 | this.percentageLBL.TabIndex = 8;
122 | this.percentageLBL.Text = "0%";
123 | this.percentageLBL.TextAlign = System.Drawing.ContentAlignment.TopCenter;
124 | //
125 | // infoBTN
126 | //
127 | this.infoBTN.Location = new System.Drawing.Point(10, 93);
128 | this.infoBTN.Name = "infoBTN";
129 | this.infoBTN.Size = new System.Drawing.Size(82, 23);
130 | this.infoBTN.TabIndex = 12;
131 | this.infoBTN.Text = "Information";
132 | this.infoBTN.UseVisualStyleBackColor = true;
133 | this.infoBTN.Click += new System.EventHandler(this.infoBTN_Click);
134 | //
135 | // updateBTN
136 | //
137 | this.updateBTN.Location = new System.Drawing.Point(180, 93);
138 | this.updateBTN.Name = "updateBTN";
139 | this.updateBTN.Size = new System.Drawing.Size(80, 23);
140 | this.updateBTN.TabIndex = 13;
141 | this.updateBTN.Text = "Update";
142 | this.updateBTN.UseVisualStyleBackColor = true;
143 | this.updateBTN.Click += new System.EventHandler(this.updateBTN_Click);
144 | //
145 | // button1
146 | //
147 | this.button1.Location = new System.Drawing.Point(95, 93);
148 | this.button1.Name = "button1";
149 | this.button1.Size = new System.Drawing.Size(82, 23);
150 | this.button1.TabIndex = 14;
151 | this.button1.Text = "Open Folder";
152 | this.button1.UseVisualStyleBackColor = true;
153 | this.button1.Click += new System.EventHandler(this.button1_Click_2);
154 | //
155 | // button2
156 | //
157 | this.button2.Location = new System.Drawing.Point(95, 119);
158 | this.button2.Name = "button2";
159 | this.button2.Size = new System.Drawing.Size(82, 23);
160 | this.button2.TabIndex = 15;
161 | this.button2.Text = "Upload Log";
162 | this.button2.UseVisualStyleBackColor = true;
163 | this.button2.Click += new System.EventHandler(this.button2_Click_2);
164 | //
165 | // Form1
166 | //
167 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
168 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
169 | this.ClientSize = new System.Drawing.Size(272, 151);
170 | this.Controls.Add(this.button2);
171 | this.Controls.Add(this.button1);
172 | this.Controls.Add(this.updateBTN);
173 | this.Controls.Add(this.infoBTN);
174 | this.Controls.Add(this.percentageLBL);
175 | this.Controls.Add(this.progressBar1);
176 | this.Controls.Add(this.canaryStartBTN);
177 | this.Controls.Add(this.label2);
178 | this.Controls.Add(this.canaryUpdateBTN);
179 | this.Controls.Add(this.masterStartBTN);
180 | this.Controls.Add(this.label1);
181 | this.Controls.Add(this.masterUpdateBTN);
182 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
183 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
184 | this.MaximizeBox = false;
185 | this.Name = "Form1";
186 | this.Text = "Xenia Updater";
187 | this.ResumeLayout(false);
188 | this.PerformLayout();
189 |
190 | }
191 |
192 | #endregion
193 |
194 | private System.Windows.Forms.Button masterUpdateBTN;
195 | private System.Windows.Forms.Label label1;
196 | private System.Windows.Forms.Button masterStartBTN;
197 | private System.Windows.Forms.Button canaryStartBTN;
198 | private System.Windows.Forms.Label label2;
199 | private System.Windows.Forms.Button canaryUpdateBTN;
200 | private System.Windows.Forms.ProgressBar progressBar1;
201 | private System.Windows.Forms.Label percentageLBL;
202 | private System.Windows.Forms.Button infoBTN;
203 | private System.Windows.Forms.Button updateBTN;
204 | private System.Windows.Forms.Button button1;
205 | private System.Windows.Forms.Button button2;
206 | }
207 | }
208 |
209 |
--------------------------------------------------------------------------------
/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Windows.Forms;
4 |
5 | namespace XeniaUpdater_C
6 | {
7 | ///
8 | /// Correctly updating Xenia Updater:
9 | /// Firstly, go to Form2.cs and change the buildDate string to the correct build date (Current date and time).
10 | /// Then open the version-{branch}.txt for the branch you are updating, change it to match the build date in Form2.cs (Without the \n).
11 | /// Near the bottom of this file (Form1.cs), change h.UpdateXeniaUpdater("branchHere") to the branch you are updating.
12 | /// Finally, of course, change the build config in VS to build the correct version (Debug or Release).
13 | ///
14 | /// If you are not the original developer of this software (Chopper1337), be sure to update the GitHub links associated with the self updater such that
15 | /// updates are pulled from your fork and not from the original repo.
16 | ///
17 | public partial class Form1 : Form
18 | {
19 |
20 | public Form1()
21 | {
22 | //Create form
23 | InitializeComponent();
24 |
25 | Helper h = new Helper();
26 | h.StartupTasks();
27 | }
28 |
29 | //Takes the parameters needed to update any branch of Xenia given the correct parameters
30 | public void UpdateXenia(string folderName, string url, string zipFullName, string exeName)
31 | {
32 | Helper h = new Helper();
33 | h.CreateFolders(folderName);
34 | h.PreUpdateTask(folderName, zipFullName, exeName);
35 | if (h.InternetAvailable() == true)
36 | {
37 | DownloadFile(url, zipFullName, folderName);
38 | }
39 | else
40 | {
41 | MessageBox.Show("Could not ping AppVeyor. Please check your internet connection.");
42 | }
43 | }
44 |
45 |
46 | //Start Xenia given a folder and executable name
47 | public void StartXenia(string folderName, string exeName)
48 | {
49 | Helper h = new Helper();
50 | h.StartProcess(exeName, folderName);
51 | }
52 |
53 |
54 | //Downloads a file from a URL to a path with the file name you specify
55 | public void DownloadFile(string downloadURL, string fileName, string folderName)
56 | {
57 | ToggleButtons(false);
58 | using (WebClient wc = new WebClient())
59 | {
60 | //Download from URL to location
61 | wc.DownloadFileAsync(new Uri(downloadURL), $"{folderName}/{fileName}");
62 |
63 | //For each change in progrress, output progress to the wc_DownloadProgressChanged method
64 | wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
65 |
66 | // For each update in the downloads progress, do this
67 | void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
68 | {
69 | progressBar1.Value = e.ProgressPercentage;
70 | percentageLBL.Text = $"{progressBar1.Value.ToString()}%";
71 |
72 | if (progressBar1.Value == 100)
73 | {
74 | wc.Dispose();
75 | ToggleButtons(true);
76 | Helper h = new Helper();
77 | h.ExtractBuild(folderName, fileName);
78 | }
79 | }
80 | wc.Dispose();
81 |
82 | }
83 | }
84 |
85 | void ToggleButtons(bool enabled)
86 | {
87 | masterUpdateBTN.Enabled = enabled;
88 | masterStartBTN.Enabled = enabled;
89 | canaryUpdateBTN.Enabled = enabled;
90 | canaryStartBTN.Enabled = enabled;
91 | updateBTN.Enabled = enabled;
92 | }
93 |
94 | private void button1_Click(object sender, System.EventArgs e)
95 | {
96 | string url = "https://github.com/xenia-project/release-builds-windows/releases/latest/download/xenia_master.zip";
97 | UpdateXenia("XeniaMaster", url, "xenia_master.zip", "xenia.exe");
98 | }
99 |
100 | private void button2_Click(object sender, System.EventArgs e)
101 | {
102 | StartXenia("XeniaMaster", "xenia");
103 | }
104 |
105 | private void button4_Click(object sender, System.EventArgs e)
106 | {
107 | string url = "https://github.com/xenia-canary/xenia-canary/releases/latest/download/xenia_canary.zip";
108 | UpdateXenia("XeniaCanary", url, "xenia_canary.zip", "xenia_canary.exe");
109 | }
110 |
111 | private void button3_Click(object sender, System.EventArgs e)
112 | {
113 | StartXenia("XeniaCanary", "xenia_canary");
114 | }
115 |
116 | private void infoBTN_Click(object sender, EventArgs e)
117 | {
118 | Form2 f2 = new Form2();
119 | f2.ShowDialog();
120 | }
121 |
122 | private void updateBTN_Click(object sender, EventArgs e)
123 | {
124 | Helper h = new Helper();
125 | h.UpdateXeniaUpdater("Release");
126 | }
127 |
128 | private void button1_Click_2(object sender, EventArgs e)
129 | {
130 | Helper h = new Helper();
131 | h.OpenInstallFolder();
132 | }
133 |
134 | private void button2_Click_2(object sender, EventArgs e)
135 | {
136 | Helper h = new Helper();
137 | h.UploadFile("xenia.log");
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/Form2.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace XeniaUpdater_C
3 | {
4 | partial class Form2
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.label3 = new System.Windows.Forms.Label();
35 | this.label5 = new System.Windows.Forms.Label();
36 | this.label6 = new System.Windows.Forms.Label();
37 | this.label7 = new System.Windows.Forms.Label();
38 | this.label8 = new System.Windows.Forms.Label();
39 | this.label4 = new System.Windows.Forms.Label();
40 | this.SuspendLayout();
41 | //
42 | // label1
43 | //
44 | this.label1.AutoSize = true;
45 | this.label1.Cursor = System.Windows.Forms.Cursors.Hand;
46 | this.label1.ForeColor = System.Drawing.SystemColors.Highlight;
47 | this.label1.Location = new System.Drawing.Point(37, 28);
48 | this.label1.Name = "label1";
49 | this.label1.Size = new System.Drawing.Size(46, 13);
50 | this.label1.TabIndex = 0;
51 | this.label1.Text = "Website";
52 | this.label1.Click += new System.EventHandler(this.label1_Click);
53 | //
54 | // label2
55 | //
56 | this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
57 | | System.Windows.Forms.AnchorStyles.Right)));
58 | this.label2.AutoSize = true;
59 | this.label2.Location = new System.Drawing.Point(8, 73);
60 | this.label2.Name = "label2";
61 | this.label2.Size = new System.Drawing.Size(306, 13);
62 | this.label2.TabIndex = 1;
63 | this.label2.Text = "\"Xenia Updater\" is in no way associated with the Xenia Project!";
64 | this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
65 | //
66 | // label3
67 | //
68 | this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
69 | | System.Windows.Forms.AnchorStyles.Right)));
70 | this.label3.AutoSize = true;
71 | this.label3.Location = new System.Drawing.Point(79, 86);
72 | this.label3.Name = "label3";
73 | this.label3.Size = new System.Drawing.Size(0, 13);
74 | this.label3.TabIndex = 2;
75 | //
76 | // label5
77 | //
78 | this.label5.AutoSize = true;
79 | this.label5.Location = new System.Drawing.Point(8, 8);
80 | this.label5.Name = "label5";
81 | this.label5.Size = new System.Drawing.Size(125, 13);
82 | this.label5.TabIndex = 5;
83 | this.label5.Text = "Xenia Project Information";
84 | //
85 | // label6
86 | //
87 | this.label6.AutoSize = true;
88 | this.label6.Location = new System.Drawing.Point(170, 9);
89 | this.label6.Name = "label6";
90 | this.label6.Size = new System.Drawing.Size(130, 13);
91 | this.label6.TabIndex = 6;
92 | this.label6.Text = "Xenia Updater Information";
93 | //
94 | // label7
95 | //
96 | this.label7.AutoSize = true;
97 | this.label7.Cursor = System.Windows.Forms.Cursors.Hand;
98 | this.label7.ForeColor = System.Drawing.SystemColors.Highlight;
99 | this.label7.Location = new System.Drawing.Point(40, 41);
100 | this.label7.Name = "label7";
101 | this.label7.Size = new System.Drawing.Size(38, 13);
102 | this.label7.TabIndex = 7;
103 | this.label7.Text = "Github";
104 | this.label7.Click += new System.EventHandler(this.label7_Click);
105 | //
106 | // label8
107 | //
108 | this.label8.AutoSize = true;
109 | this.label8.Cursor = System.Windows.Forms.Cursors.Hand;
110 | this.label8.ForeColor = System.Drawing.SystemColors.Highlight;
111 | this.label8.Location = new System.Drawing.Point(37, 54);
112 | this.label8.Name = "label8";
113 | this.label8.Size = new System.Drawing.Size(43, 13);
114 | this.label8.TabIndex = 8;
115 | this.label8.Text = "Discord";
116 | this.label8.Click += new System.EventHandler(this.label8_Click);
117 | //
118 | // label4
119 | //
120 | this.label4.AutoSize = true;
121 | this.label4.Cursor = System.Windows.Forms.Cursors.Hand;
122 | this.label4.ForeColor = System.Drawing.SystemColors.Highlight;
123 | this.label4.Location = new System.Drawing.Point(210, 28);
124 | this.label4.Name = "label4";
125 | this.label4.Size = new System.Drawing.Size(46, 13);
126 | this.label4.TabIndex = 9;
127 | this.label4.Text = "Website";
128 | this.label4.Click += new System.EventHandler(this.label4_Click);
129 | //
130 | // Form2
131 | //
132 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
133 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
134 | this.ClientSize = new System.Drawing.Size(333, 108);
135 | this.Controls.Add(this.label4);
136 | this.Controls.Add(this.label8);
137 | this.Controls.Add(this.label7);
138 | this.Controls.Add(this.label6);
139 | this.Controls.Add(this.label5);
140 | this.Controls.Add(this.label3);
141 | this.Controls.Add(this.label2);
142 | this.Controls.Add(this.label1);
143 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
144 | this.Name = "Form2";
145 | this.ShowInTaskbar = false;
146 | this.Text = "Information";
147 | this.ResumeLayout(false);
148 | this.PerformLayout();
149 |
150 | }
151 |
152 | #endregion
153 |
154 | private System.Windows.Forms.Label label1;
155 | private System.Windows.Forms.Label label2;
156 | private System.Windows.Forms.Label label3;
157 | private System.Windows.Forms.Label label5;
158 | private System.Windows.Forms.Label label6;
159 | private System.Windows.Forms.Label label7;
160 | private System.Windows.Forms.Label label8;
161 | private System.Windows.Forms.Label label4;
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/Form2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 |
5 | namespace XeniaUpdater_C
6 | {
7 | public partial class Form2 : Form
8 | {
9 | //KEEP \N AT THE END. GITHUB RETURNS TEXT FILES WITH THIS FOR SOME REASON
10 | //UPDATE CHECK WILL NOT WORK IF REMOVED.
11 | public string buildDate = "Build date: 10/03/2023 1820 GMT\n";
12 | public Form2()
13 | {
14 | InitializeComponent();
15 | label3.Text = buildDate;
16 | }
17 |
18 | private void label1_Click(object sender, EventArgs e)
19 | {
20 | Process.Start("https://xenia.jp");
21 | }
22 |
23 | private void label7_Click(object sender, EventArgs e)
24 | {
25 | Process.Start("https://github.com/xenia-project");
26 | }
27 |
28 | private void label8_Click(object sender, EventArgs e)
29 | {
30 | Process.Start("https://discord.com/invite/Q9mxZf9");
31 | }
32 |
33 | private void label4_Click(object sender, EventArgs e)
34 | {
35 | Process.Start("https://github.com/Chopper1337/XeniaUpdater");
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Form2.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Helper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Net;
6 | using System.Windows.Forms;
7 |
8 | namespace XeniaUpdater_C
9 | {
10 | class Helper
11 | {
12 | string currentExecutableFullPathName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //Full path of the Xenia Updater executable
13 | string currentExecutableName = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName; //The current name of the Updater. (For the case that the user renames it)
14 | string newExeLoc = $"C:\\Users\\{Environment.UserName}\\AppData\\Local\\Temp\\XeniaUpdater.Latest.exe"; //Full path in which you will find the newly downloaded version of the updater
15 | string newBatLoc = $"C:\\Users\\{Environment.UserName}\\AppData\\Local\\Temp\\UpdateDownloaded.bat"; //Full path in which you will find the generated batch file used for the self updater
16 |
17 | public Helper()
18 | {
19 |
20 | }
21 |
22 | //Creates the folders needed for a given Xenia build
23 | public void CreateFolders(string folderName)
24 | {
25 | try
26 | {
27 | Directory.CreateDirectory(folderName);
28 | Directory.CreateDirectory($"{folderName}/LastUpdate");
29 | }
30 | catch (Exception e)
31 | {
32 | LogError(e.ToString(),"XeniaUpdaterLog.txt");
33 | }
34 | }
35 |
36 | //Open the folder in which the current running instance of Xenia Updater is located.
37 | public void OpenInstallFolder()
38 | {
39 | Process.Start(currentExecutableFullPathName.Replace(currentExecutableName, ""));
40 | }
41 |
42 | //Extracts the zip
43 | public void ExtractBuild(string folderName, string zipName)
44 | {
45 | //Deletes LICENSE file because it isn't needed and also causes issues for some reason
46 | try
47 | {
48 | File.Delete($"{folderName}/LICENSE");
49 | ZipFile.ExtractToDirectory($"{folderName}/{zipName}", folderName);
50 | File.Delete($"{folderName}/LICENSE");
51 |
52 | }
53 | catch (Exception e)
54 | {
55 | LogError(e.ToString(),"XeniaUpdaterLog.txt");
56 | }
57 | }
58 |
59 | //Logs the last error the program had in a file named XeniaUpdaterLog
60 | //This file will not infintely be written to.
61 | void LogError(string e, string fileName)
62 | {
63 | if (!File.Exists(fileName))
64 | {
65 | File.Create(fileName);
66 | }
67 |
68 | double length = new System.IO.FileInfo(fileName).Length;
69 | length = length / 1000;
70 | byte limit = 200;
71 | if(length > limit)
72 | {
73 | File.Delete(fileName);
74 | File.AppendAllText(fileName, $"Your previous log file exceeded {limit}KB and was deleted.\n");
75 | }
76 | File.AppendAllText(fileName, e);
77 | }
78 |
79 | //Cleanup tasks to do before download and extraction of a new version
80 | public void PreUpdateTask(string folderName, string zipName, string ExecutableName)
81 | {
82 | string PDBName = ExecutableName.Remove(ExecutableName.Length - 4) + ".pdb";
83 | try
84 | {
85 | File.Delete($"{folderName}/LastUpdate/{zipName}");
86 | File.Move($"{folderName}/{zipName}", $"{folderName}/LastUpdate/{zipName}");
87 | File.Delete($"{folderName}/{ExecutableName}");
88 | File.Delete($"{folderName}/LICENSE");
89 | File.Delete($"{folderName}/xenia.log");
90 | File.Delete($"{folderName}/{ExecutableName}");
91 | File.Delete($"{folderName}/{PDBName}");
92 | File.Delete($"{folderName}/{PDBName}");
93 | }
94 | catch (Exception e)
95 | {
96 | LogError(e.ToString(),"XeniaUpdaterLog.txt");
97 | }
98 | }
99 |
100 | //Start a process
101 | public void StartProcess(string ExecutableName, string ExeLocation)
102 | {
103 | try
104 | {
105 | Process.Start($"{ExeLocation}\\{ExecutableName}");
106 | }
107 | catch (Exception e)
108 | {
109 | MessageBox.Show($"\"{ExecutableName}.exe\" could not be started.\nThe file must be present and executable.", "Error");
110 | LogError(e.ToString(),"XeniaUpdaterLog.txt");
111 | }
112 | }
113 |
114 | //Updates XeniaUpdater
115 | public void UpdateXeniaUpdater(string branch)
116 | {
117 | //If we have an internet connection
118 | if (InternetAvailable() == true)
119 | {
120 | //Create instance of form 2 to pull build date from self.
121 | Form2 f2 = new Form2();
122 |
123 | //Pull latest version from github
124 | System.Net.WebClient wc1 = new System.Net.WebClient();
125 | string webData = wc1.DownloadString($"https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/main/version-{branch}.txt");
126 | wc1.Dispose();
127 |
128 | //If current version is equal to version pulled from github
129 | if (webData.Equals(f2.buildDate))
130 | {
131 | MessageBox.Show("You are on the latest version! :)\n\nYour build date matches that on GitHub","Better luck next time!");
132 | return;
133 | }
134 | else
135 | {
136 | //Usual update process
137 | WebClient wc = new WebClient();
138 | wc.DownloadFileAsync(new Uri($"https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/main/bin/{branch}/XeniaUpdater.exe"), newExeLoc);
139 | wc.Dispose();
140 |
141 | if (File.Exists(newExeLoc))
142 | {
143 | using (FileStream strm = File.Create(newBatLoc))
144 | using (StreamWriter sw = new StreamWriter(strm))
145 | {
146 | //This is supposed to look like this.
147 | sw.WriteLine(
148 | $@"@echo off
149 | rem File generated by {currentExecutableName} (XeniaUpdater), do not modify or delete :)
150 | title Updating Xenia Updater
151 | echo Killing {currentExecutableName}
152 | taskkill /im {currentExecutableName}
153 | timeout 1
154 | echo Deleting {currentExecutableName}
155 | del {currentExecutableFullPathName}
156 | move {newExeLoc} {currentExecutableFullPathName}
157 | echo XeniaUpdater has been updated under the name {currentExecutableName}.
158 | echo This CMD window will not appear on next start and can be closed :)
159 | {currentExecutableName}
160 | del {newBatLoc}");
161 | }
162 | MessageBox.Show($"Latest version downloaded, please restart!", "Latest version downloaded :)");
163 | }
164 | }
165 | }
166 | else
167 | {
168 | MessageBox.Show("Internet connection not available.");
169 | }
170 |
171 | //This is needed for backward compatibility with previous versions of Xenia Updater
172 | if (File.Exists("XeniaUpdater.Latest.exe"))
173 | {
174 | MessageBox.Show($"Latest version downloaded, please restart!", "Latest version downloaded :)");
175 |
176 | using (FileStream strm = File.Create("UpdateDownloaded.bat"))
177 | using (StreamWriter sw = new StreamWriter(strm))
178 | {
179 | //This is supposed to look like this.
180 | sw.WriteLine(
181 | $@"@echo off
182 | rem File generated by {currentExecutableName} (XeniaUpdater), do not modify or delete :)
183 | title Updating Xenia Updater
184 | echo Killing {currentExecutableName}
185 | taskkill /im {currentExecutableName}
186 | timeout 1
187 | echo Deleting {currentExecutableName}
188 | del {currentExecutableFullPathName}
189 | move XeniaUpdater.Latest.exe {currentExecutableFullPathName}
190 | echo XeniaUpdater has been updated under the name {currentExecutableName}.
191 | echo This CMD window will not appear on next start and can be closed :)
192 | {currentExecutableName}
193 | del UpdateDownloaded.bat");
194 | }
195 | }
196 | }
197 |
198 | //Things to do upon launch of the program
199 | public void StartupTasks()
200 | {
201 | //Booleans to check for the existance of the update batch file, a newly downloaded version of the updater from GitHub and a safety switch to prevent infinte cmd.exe's being started
202 | bool updateBatExists = File.Exists(newBatLoc);
203 | bool updateEXEExists = File.Exists(newExeLoc);
204 | bool updateBatExists_c = File.Exists("UpdateDownloaded.bat");
205 | bool updateEXEExists_c = File.Exists("XeniaUpdater.Latest.exe");
206 | bool safetySwitch = true;
207 |
208 | if (safetySwitch)
209 | {
210 | //If the batch file exists and the new executable exists, start the batch file
211 | if (updateBatExists && updateEXEExists)
212 | {
213 | Process.Start(newBatLoc);
214 | safetySwitch = false;
215 | }
216 | //Else, if the batch file does not exist but the updated executable does, delete the executable.
217 | //Reason behind this being that this executable is useless without the batch file.
218 | else if (!updateBatExists && updateEXEExists)
219 | {
220 | File.Delete(newExeLoc);
221 | }
222 | else if (updateBatExists && !updateEXEExists)
223 | {
224 | File.Delete(newBatLoc);
225 | }
226 |
227 | // For people using previous builds:
228 | //If the batch file exists and the new executable exists, start the batch file
229 | if (updateBatExists_c && updateEXEExists_c)
230 | {
231 | Process.Start("UpdateDownloaded.bat");
232 | safetySwitch = false;
233 | }
234 | //Else, if the batch file does not exist but the updated executable does, delete the executable.
235 | //Reason behind this being that this executable is useless without the batch file.
236 | else if (!updateBatExists_c && updateEXEExists_c)
237 | {
238 | File.Delete("XeniaUpdater.Latest.exe");
239 | }
240 | else if (updateBatExists_c && !updateEXEExists_c)
241 | {
242 | File.Delete("UpdateDownloaded.bat");
243 | }
244 |
245 |
246 | }
247 |
248 | //Delete log uploader, it isn't necessary to keep
249 | if (File.Exists("UploadFile.bat"))
250 | {
251 | File.Delete("UploadFile.bat");
252 | File.Delete("response.txt");
253 | }
254 |
255 | }
256 |
257 | //Bool to check for internet connection. Pings AppVeyor as you will need to connect to their servers eventually to use this application properly.
258 | public bool InternetAvailable()
259 | {
260 | try
261 | {
262 | using (var client = new WebClient())
263 | using (var stream = client.OpenRead("http://appveyor.com"))
264 | {
265 | return true;
266 | }
267 | }
268 | catch
269 | {
270 | return false;
271 | }
272 | }
273 |
274 | //Generates batch script to upload a file to tmp.ninja using CURL.
275 | public void UploadFile(string filename)
276 | {
277 | string text = $@"
278 | @echo off
279 | rem File generated by {currentExecutableName} (XeniaUpdater), safe to delete :)
280 | echo Uploading log :)
281 | curl -i -F files[]=@{filename} https://tmp.ninja/upload.php?output=text > response.txt
282 | cls
283 | echo Your {filename} is uploaded here:
284 | echo.
285 | type response.txt | findstr http
286 | echo.
287 | echo Highlight the URL with your mouse and right click to copy to clipboard.
288 | echo.
289 | echo If there is no URL displayed above, you will need to install CURL. Download it here: https://curl.se/windows/
290 | echo.
291 | echo Files are hosted on https://tmp.ninja/. Neither Xenia nor Xenia Updater are associated with tmp.ninja.
292 | echo.
293 | echo Read more here: https://tmp.ninja/faq.html
294 | echo.
295 | echo You can close this window.
296 | pause";
297 |
298 | if (File.Exists(filename))
299 | {
300 | using (FileStream strm = File.Create("UploadFile.bat"))
301 | using (StreamWriter sw = new StreamWriter(strm))
302 | {
303 | sw.WriteLine(text);
304 | }
305 | Process.Start("UploadFile.bat");
306 | }
307 | else
308 | {
309 | MessageBox.Show($"{filename} not found");
310 | }
311 | }
312 | }
313 | }
314 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace XeniaUpdater_C
5 | {
6 | static class Program
7 | {
8 | ///
9 | /// The main entry point for the application.
10 | ///
11 | [STAThread]
12 | static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new Form1());
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("XeniaUpdater2")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("XeniaUpdater2")]
12 | [assembly: AssemblyCopyright("Copyright © 2021")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("e4409db2-0b37-41a0-8cf4-bf4b4793fa76")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace XeniaUpdater.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XeniaUpdater.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace XeniaUpdater.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unofficial Xenia Updater
2 | Small program made to manage the Xenia Xbox 360 emulator and its versions.
3 |
4 | # Releases
5 |
6 | * [**Stable**](https://github.com/Chopper1337/XeniaUpdater/raw/main/bin/Release/XeniaUpdater.exe)
7 | * [Debug](https://github.com/Chopper1337/XeniaUpdater/raw/main/bin/Debug/XeniaUpdater.exe)
8 |
9 | Expect the debug version to have the latest features implemented in an ugly way :) (See note for more info on debug release).
10 |
11 | # Features
12 |
13 | * Compatible with master and canary branches of Xenia.
14 | * Downloads and extracts latest builds of Xenia in one click.
15 | * Creates a backup of the last downloaded version of Xenia.
16 |
17 | # Developers
18 |
19 | ## Some advice before proceeding
20 |
21 | I highly recommend that you use [XeniaUpdater2](https://github.com/Chopper1337/XeniaUpdater2) or [XeniaLauncher-CLI](https://github.com/Chopper1337/XeniaLauncher-CLI) to make changes. They should be significantly easier to work with.
22 |
23 | ## Adding other builds of Xenia
24 |
25 | 1. Add two new buttons (Update and Launch)
26 | 2. Create click events for these buttons
27 | 3. Use the `UpdateXenia` and `StartXenia` functions in the click event functions
28 | 4. Add your newly created buttons to the `ToggleButtons` functions
29 |
30 | Examples:
31 |
32 | ```
33 | // Update Xenia Master button click event
34 | private void button1_Click(object sender, System.EventArgs e) {
35 | // URL to download the latest build ZIP
36 | string url = "https://github.com/xenia-project/release-builds-windows/releases/latest/download/xenia_master.zip";
37 | // Update the build providing the folder name, url, ZIP name and executable name
38 | UpdateXenia("XeniaMaster", url, "xenia_master.zip", "xenia.exe");
39 | }
40 |
41 | // Start Xenia Master button click event
42 | private void button2_Click(object sender, System.EventArgs e) {
43 | // Start the build providing the folder name and executable name (excluding extension)
44 | StartXenia("XeniaMaster", "xenia");
45 | }
46 |
47 | ```
48 |
49 | ```
50 | // Enables or disabled all buttons in the application
51 | void ToggleButtons(bool enabled) {
52 | masterUpdateBTN.Enabled = enabled;
53 | masterStartBTN.Enabled = enabled;
54 | canaryUpdateBTN.Enabled = enabled;
55 | canaryStartBTN.Enabled = enabled;
56 | // Add your buttons here
57 |
58 | updateBTN.Enabled = enabled;
59 | }
60 | ```
61 |
62 | # Note for "Debug" release
63 |
64 | There is no guarantee of stability with the debug release.
65 |
66 |
67 | If you run into any issues, create an issue through GitHub.
68 | Try provide as much info as possible, screenshot of when the issue occurred and a screenshot of the directory the updater was in and so on.
69 |
70 | A log file should be generated with the last error the program had, provide this if possible.
71 |
72 | Thanks :)
73 |
--------------------------------------------------------------------------------
/XeniaUpdater-main-pre-rewrite.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/XeniaUpdater-main-pre-rewrite.zip
--------------------------------------------------------------------------------
/XeniaUpdater.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}
8 | WinExe
9 | XeniaUpdater
10 | XeniaUpdater
11 | v4.7.2
12 | 512
13 | true
14 | true
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 | AnyCPU
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 |
41 |
42 | AnyCPU
43 | pdbonly
44 | true
45 | bin\Release\
46 | TRACE
47 | prompt
48 | 4
49 |
50 |
51 | 1.ico
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Form
70 |
71 |
72 | Form1.cs
73 |
74 |
75 | Form
76 |
77 |
78 | Form2.cs
79 |
80 |
81 |
82 |
83 |
84 | Form1.cs
85 |
86 |
87 | Form2.cs
88 |
89 |
90 | ResXFileCodeGenerator
91 | Resources.Designer.cs
92 | Designer
93 |
94 |
95 | True
96 | Resources.resx
97 | True
98 |
99 |
100 | SettingsSingleFileGenerator
101 | Settings.Designer.cs
102 |
103 |
104 | True
105 | Settings.settings
106 | True
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | False
118 | Microsoft .NET Framework 4.7.2 %28x86 and x64%29
119 | true
120 |
121 |
122 | False
123 | .NET Framework 3.5 SP1
124 | false
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/XeniaUpdater.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/XeniaUpdater.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31105.61
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XeniaUpdater", "XeniaUpdater.csproj", "{E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E4409DB2-0B37-41A0-8CF4-BF4B4793FA76}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {D7F52BD6-3E4C-4C41-89A2-E7F208D37B20}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/bin/Debug/XeniaUpdater.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/bin/Debug/XeniaUpdater.exe
--------------------------------------------------------------------------------
/bin/Debug/XeniaUpdater.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/bin/Debug/XeniaUpdater.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/bin/Debug/XeniaUpdater.pdb
--------------------------------------------------------------------------------
/bin/Release/XeniaUpdater.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/bin/Release/XeniaUpdater.exe
--------------------------------------------------------------------------------
/bin/Release/XeniaUpdater.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/bin/Release/XeniaUpdater.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/bin/Release/XeniaUpdater.pdb
--------------------------------------------------------------------------------
/bin/Release/XeniaUpdaterLog.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chopper1337/XeniaUpdater/73b60f7aa16e4a8958787a4d254e8ebcd784082d/bin/Release/XeniaUpdaterLog.txt
--------------------------------------------------------------------------------
/version-Debug.txt:
--------------------------------------------------------------------------------
1 | Build date: 10/03/2023 1820 GMT
2 |
--------------------------------------------------------------------------------
/version-Release.txt:
--------------------------------------------------------------------------------
1 | Build date: 10/03/2023 1820 GMT
2 |
--------------------------------------------------------------------------------