From b96affd4fdbb51627d2782283cf517679eb1d722 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Sun, 24 Feb 2019 19:28:00 +0100 Subject: [PATCH] Build and publication update - app will now deploy to remote FTP and generate one click installer. --- 02_Windows_App/Perun_v1/App.config | 2 +- 02_Windows_App/Perun_v1/Perun_v1.csproj | 22 ++++++-- .../Perun_v1/Properties/AssemblyInfo.cs | 4 +- .../Perun_v1/Properties/Settings.Designer.cs | 2 +- .../Perun_v1/Properties/Settings.settings | 2 +- 02_Windows_App/Perun_v1/form_Main.cs | 55 ++++++++++--------- 6 files changed, 51 insertions(+), 36 deletions(-) diff --git a/02_Windows_App/Perun_v1/App.config b/02_Windows_App/Perun_v1/App.config index 06d45f7..7aeb785 100644 --- a/02_Windows_App/Perun_v1/App.config +++ b/02_Windows_App/Perun_v1/App.config @@ -36,7 +36,7 @@ False - + 3306 diff --git a/02_Windows_App/Perun_v1/Perun_v1.csproj b/02_Windows_App/Perun_v1/Perun_v1.csproj index 75ae84d..77bf9ba 100644 --- a/02_Windows_App/Perun_v1/Perun_v1.csproj +++ b/02_Windows_App/Perun_v1/Perun_v1.csproj @@ -12,21 +12,30 @@ 512 true true - false - C:\Users\simpo\Desktop\Perun\ + true + ftp://s18.mydevil.net/perun/ true - Disk - false + Web + true Foreground 7 Days false false true - true - 2 + http://share.porwolik.com/ftp/perun/ + https://github.com/szporwolik/perun + https://github.com/szporwolik/perun + en + Perun for DCS World + szporwolik + Perun + true + Perun.htm + 8 0.3.3.%2a false + true true true @@ -73,6 +82,7 @@ LocalIntranet + Properties\app.manifest diff --git a/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs b/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs index 6494195..e6c2e8d 100644 --- a/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs +++ b/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki // przy użyciu symbolu „*”, tak jak pokazano poniżej: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.3.0")] -[assembly: AssemblyFileVersion("0.3.3.0")] +[assembly: AssemblyVersion("0.3.3.3")] +[assembly: AssemblyFileVersion("0.3.3.3")] [assembly: NeutralResourcesLanguage("en")] diff --git a/02_Windows_App/Perun_v1/Properties/Settings.Designer.cs b/02_Windows_App/Perun_v1/Properties/Settings.Designer.cs index 925a3b4..a94ba30 100644 --- a/02_Windows_App/Perun_v1/Properties/Settings.Designer.cs +++ b/02_Windows_App/Perun_v1/Properties/Settings.Designer.cs @@ -121,7 +121,7 @@ namespace Perun_v1.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] + [global::System.Configuration.DefaultSettingValueAttribute("3306")] public string MYSQL_Port { get { return ((string)(this["MYSQL_Port"])); diff --git a/02_Windows_App/Perun_v1/Properties/Settings.settings b/02_Windows_App/Perun_v1/Properties/Settings.settings index 1b55d4d..7fa9c96 100644 --- a/02_Windows_App/Perun_v1/Properties/Settings.settings +++ b/02_Windows_App/Perun_v1/Properties/Settings.settings @@ -27,7 +27,7 @@ False - + 3306 \ No newline at end of file diff --git a/02_Windows_App/Perun_v1/form_Main.cs b/02_Windows_App/Perun_v1/form_Main.cs index 1324cea..fc0d5c0 100644 --- a/02_Windows_App/Perun_v1/form_Main.cs +++ b/02_Windows_App/Perun_v1/form_Main.cs @@ -23,6 +23,7 @@ namespace Perun_v1 public string[] SendBuffer=new string[10]; // Mysql send buffer public bool LetMeOut=false; // Helper to handle system tray public string MySql_connStr; // MySQL connection string + string publishVersion = "DEBUG"; // Helper for pulling version definition public static void LogHistoryAdd(ref string[] LogHistory, string Comment) { @@ -47,10 +48,8 @@ namespace Perun_v1 // Modify specific if (type == "1") // Inject app version information { - Assembly assembly = Assembly.GetExecutingAssembly(); - FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); - string version = fileVersionInfo.ProductVersion; - udp_frame.payload["v_win"] = "v"+version; + + udp_frame.payload["v_win"] = "v"+ publishVersion; } // Specific SQL @@ -181,9 +180,12 @@ namespace Perun_v1 con_check_3rd_srs.Checked = Properties.Settings.Default.OTHER_SRS_USE; // Version to title header - Assembly assembly = Assembly.GetExecutingAssembly(); - FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); - this.Text = this.Text + " - v" + fileVersionInfo.ProductVersion; + if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) + { + System.Deployment.Application.ApplicationDeployment cd = System.Deployment.Application.ApplicationDeployment.CurrentDeployment; + publishVersion = cd.CurrentVersion.ToString(); + } + this.Text = this.Text + " - v" + publishVersion; } private void con_Button_Listen_ON_Click(object sender, EventArgs e) @@ -386,28 +388,31 @@ namespace Perun_v1 for (int i = 0; i < raw_lotatc.Count; i++) { - int temp = raw_lotatc[i].RadioInfo.radios.Count - 1; - for (int j = temp; j >= 0; j--) - { - raw_lotatc[i].RadioInfo.radios[j].enc.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].encKey.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].encMode.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].freqMax.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].freqMin.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].modulation.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].freqMode.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].volMode.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].expansion.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].channel.Parent.Remove(); - raw_lotatc[i].RadioInfo.radios[j].simul.Parent.Remove(); + if (raw_lotatc[i].RadioInfo != null) { - if (raw_lotatc[i].RadioInfo.radios[j].name == "No Radio") + int temp = raw_lotatc[i].RadioInfo.radios.Count - 1; + for (int j = temp; j >= 0; j--) { - raw_lotatc[i].RadioInfo.radios[j].Remove(); + raw_lotatc[i].RadioInfo.radios[j].enc.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].encKey.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].encMode.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].freqMax.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].freqMin.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].modulation.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].freqMode.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].volMode.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].expansion.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].channel.Parent.Remove(); + raw_lotatc[i].RadioInfo.radios[j].simul.Parent.Remove(); + + if (raw_lotatc[i].RadioInfo.radios[j].name == "No Radio") + { + raw_lotatc[i].RadioInfo.radios[j].Remove(); + } } + raw_lotatc[i].ClientChannelId.Parent.Remove(); + raw_lotatc[i].RadioInfo.simultaneousTransmission.Parent.Remove(); } - raw_lotatc[i].ClientChannelId.Parent.Remove(); - raw_lotatc[i].RadioInfo.simultaneousTransmission.Parent.Remove(); } strSRSJson = JsonConvert.SerializeObject(raw_lotatc);