Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Stable | 3.3
Browse files Browse the repository at this point in the history
* Implemented Update Service
* Added Automatic Log dumping; as an option. 
* Implemented Dark-theme; can be disabled/enabled. 
* Removed old code and forms. 
* Refined the Interface. 
* Cleaned the code-base. 
* Added code-base comments here & there.
  • Loading branch information
DrHacknik committed Jul 7, 2018
1 parent c1df1b9 commit dced997
Show file tree
Hide file tree
Showing 28 changed files with 666 additions and 1,116 deletions.
Expand Up @@ -98,12 +98,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main\MnExtension.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main\MnExtension.Designer.cs">
<DependentUpon>MnExtension.cs</DependentUpon>
</Compile>
<Compile Include="Main\MnSettings.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -142,9 +136,6 @@
<Compile Include="Parser\PsSyncDown.cs" />
<Compile Include="Services\SvcUpd.cs" />
<Compile Include="Parser\PsYLS.cs" />
<EmbeddedResource Include="Main\MnExtension.resx">
<DependentUpon>MnExtension.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Main\MnSettings.resx">
<DependentUpon>MnSettings.cs</DependentUpon>
<SubType>Designer</SubType>
Expand Down
Expand Up @@ -11,28 +11,34 @@
<userSettings>
<_3DNUS_Material_Edition.Properties.Settings>
<setting name="dev_auto_upd" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_dump_info" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_flags" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_def_titlelist" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_music" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_mode" serializeAs="String">
<value/>
<value />
</setting>
<setting name="eula_read" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_tour" serializeAs="String">
<value/>
<value />
</setting>
<setting name="dev_dark_theme" serializeAs="String">
<value>0</value>
</setting>
<setting name="dev_auto_dump_log" serializeAs="String">
<value />
</setting>
</_3DNUS_Material_Edition.Properties.Settings>
</userSettings>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -8,9 +8,7 @@ public partial class FmLoad : Form
{
public readonly String cd = Path.GetDirectoryName(Application.ExecutablePath);
private bool is64 = System.Environment.Is64BitOperatingSystem;
private bool checksum;

private MnMain frm;
private Form mn = new MnMain();

public FmLoad()
{
Expand All @@ -19,163 +17,57 @@ public FmLoad()

private void main_load_Load(object sender, EventArgs e)
{
//string cd = Application.StartupPath;
//if (!Directory.Exists(cd)) Directory.CreateDirectory(cd);

//Assembly ass = Assembly.GetExecutingAssembly();
//String prefix = "_3DNUS.RuntimeAssets." + wat + ".";
//int prefixlen = prefix.Length;

//foreach (String ss in ass.GetManifestResourceNames().Where(str => str.StartsWith(prefix)))
//{
// String s = ss.Substring(prefixlen);
// String fn = Path.Combine(cd, s);

// if (File.Exists(fn))
// if (checksum)
// {
// String cs = null;

// using (Stream sr = ass.GetManifestResourceStream(ss))
// {
// using (MD5 md = MD5.Create())
// {
// cs = BitConverter.ToString(md.ComputeHash(sr)).ToLower();
// }
// }

// using (FileStream fs = File.OpenRead(fn))
// {
// using (MD5 md = MD5.Create())
// {
// if (BitConverter.ToString(md.ComputeHash(fs)).ToLower() == cs) continue;
// }
// }
// }
// else continue;

// using (Stream sr = ass.GetManifestResourceStream(ss))
// {
// using (FileStream fs = File.OpenWrite(fn))
// {
// byte[] buf = new byte[0x1000];
// int read = -1;
// while (true)
// {
// read = sr.Read(buf, 0, buf.Length);
// if (read == 0) break;
// fs.Write(buf, 0, read);
if (Properties.Settings.Default.dev_music == "")
{
Properties.Settings.Default.dev_music = "0";
Properties.Settings.Default.Save();
//Application.Restart();
}
if (Properties.Settings.Default.dev_auto_upd == "")
{
Properties.Settings.Default.dev_auto_upd = "1";
Properties.Settings.Default.Save();
//Application.Restart();
}
if (Properties.Settings.Default.eula_read == "")
if (Properties.Settings.Default.dev_auto_upd == "1")
{
Properties.Settings.Default.eula_read = "nope";
Properties.Settings.Default.Save();
splash_timer.Stop();
SvcUpd.SvcUpdate();
tmr_get_upd_stat.Start();
}
/*
if (Properties.Settings.Default.dev_auto_upd == "1")
else
{
try
if (Properties.Settings.Default.dev_tour == "")
{
dev_status.Text = "Checking for Updates...";
File.Delete(Path.Combine(cd, "Update_info.txt"));
File.Delete(Path.Combine(cd, "Update_URI.txt"));
File.Delete(Path.Combine(cd, "3DNUS_old.exe"));
File.Delete(Path.Combine(cd, "3DNUS_new.exe"));
File.Delete(Path.Combine(cd, "upd_fin.exe"));
WebClient get_info = new WebClient();
get_info.DownloadFile(new Uri("https://raw.githubusercontent.com/zoltx23/3DNUS/master/Update_Info.txt"), cd + "\\Update_info.txt");
WebClient upd_dwld = new WebClient();
using (Stream upd = File.Open(cd + "\\Update_info.txt", FileMode.Open))
{
using (StreamReader reader = new StreamReader(upd))
{
string rd_upd = null;
rd_upd = reader.ReadToEnd();
if (rd_upd == Application.ProductVersion)
{
dev_status.Text = "No new Updates";
splash_timer.Start();
}
else
{
dev_status.Text = "Downloading New update...";
if (is64 == true)
{
upd_dwld.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/x64/3DNUS.exe?raw=true"), cd + "\\3DNUS_new.exe");
WebClient get_fin = new WebClient();
get_fin.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/upd_fin.exe?raw=true"), cd + "\\upd_fin.exe");
Process.Start(cd + "\\upd_fin.exe");
dev_status.Text = "Preparing...";
Application.Exit();
}
if (is64 == false)
{
upd_dwld.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/x32/3DNUS.exe?raw=true"), cd + "\\3DNUS_new.exe");
WebClient get_fin = new WebClient();
get_fin.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/upd_fin.exe?raw=true"), cd + "\\upd_fin.exe");
Process.Start(cd + "\\upd_fin.exe");
dev_status.Text = "Preparing...";
Application.Exit();
}
}
}
}
Form dv = new dev_tour();
dv.Show();
this.Hide();
}
catch
else
{
dev_status.Text = "Unable to update...";
splash_timer.Start();
}
}
else
{*/

if (!File.Exists(cd + "\\3DNUS Material Edition.exe.old"))
{
File.Delete(cd + "\\3DNUS Material Edition.exe.old");
}

if (Properties.Settings.Default.dev_tour == "")
{
Form dv = new dev_tour();
dv.Show();
this.Hide();
}
else
{
frm = new MnMain();
splash_timer.Start();
}

//}
}

private void timer1_Tick(object sender, EventArgs e)
{
splash_timer.Stop();
frm.Show();
mn.Show();
Hide();
}

private void main_load_QueryAccessibilityHelp(object sender, QueryAccessibilityHelpEventArgs e)
private void tmr_get_upd_stat_Tick(object sender, EventArgs e)
{
}
//Fetch Svc Status
dev_status.Text = SvcUpd.SvcUpdateStat;
this.Refresh();

private void pic_splash_logo_Click(object sender, EventArgs e)
{
//Fetch and check Error codes
if (SvcUpd.SvcUpdateStat == "Unable to update. [Overall Failure]")
{
splash_timer.Start();
}
if (SvcUpd.SvcUpdateStat == "Unable to update. [Get Binary Failed]")
{
splash_timer.Start();
}
if (SvcUpd.SvcUpdateStat == "No new Updates")
{
splash_timer.Start();
}
}
}
}
Expand Up @@ -120,6 +120,9 @@
<metadata name="splash_timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tmr_get_upd_stat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit dced997

Please sign in to comment.