diff --git a/Classes/AppInfo.cs b/Classes/AppInfo.cs index 62cbe27..713c307 100644 --- a/Classes/AppInfo.cs +++ b/Classes/AppInfo.cs @@ -46,7 +46,7 @@ public bool bIsDebug( ) if ( System.Diagnostics.Debugger.IsAttached ) return true; - if ( Cfg.Default.app_bDevmode ) + if ( Settings.app_bDevmode ) return true; #if DEBUG diff --git a/Classes/Perms.cs b/Classes/Perms.cs index 1e5cfa7..0a3a44a 100644 --- a/Classes/Perms.cs +++ b/Classes/Perms.cs @@ -4,6 +4,8 @@ @author : Aetherinox */ +#region "Using" + using System; using System.Collections.Generic; using System.Linq; @@ -13,6 +15,8 @@ using System.Security.AccessControl; using System.IO; +#endregion + namespace MobaXtermKG { public class Perms diff --git a/Classes/Program.cs b/Classes/Program.cs index 818ab74..0d7835d 100644 --- a/Classes/Program.cs +++ b/Classes/Program.cs @@ -20,6 +20,27 @@ namespace MobaXtermKG { + /* + Global Settings + + app_bDevmode : bool + Determines if debug mode is enabled + + bShowedUpdates : bool + This determines if the app should show the update notification. This value must be set otherwise, + every time the user goes from the About / Contribute WinForm back to Parent, the update notification will appear over and over. + */ + + public static class Settings + { + public static bool bShowedUpdates = false; + public static bool app_bDevmode = false; + } + + /* + Main Program + */ + public sealed class Program { @@ -111,7 +132,7 @@ Elevate to admin so we can modify the windows host file. ensure debug mode is turned off by default as we don't want presistence */ - Cfg.Default.app_bDevmode = false; + Settings.app_bDevmode = false; Cfg.Default.Save( ) ; /* @@ -123,7 +144,7 @@ args start at index args[ 0 ] if ( args.Length > 0 && args[ 0 ] == Cfg.Default.app_argid_debug ) { - Cfg.Default.app_bDevmode = true; + Settings.app_bDevmode = true; EnableDebugConsole( ); Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ]", String.Format( "User defined {0} argument", Cfg.Default.app_argid_debug ) ); diff --git a/Forms/FormContribute.cs b/Forms/FormContribute.cs index d6d698f..03ae057 100644 --- a/Forms/FormContribute.cs +++ b/Forms/FormContribute.cs @@ -318,6 +318,5 @@ private void lbl_Contrib_Intro_MouseMove( object sender, MouseEventArgs e ) } #endregion - } } diff --git a/Forms/FormMessageBox.Designer.cs b/Forms/FormMessageBox.Designer.cs index c3a35e9..500d393 100644 --- a/Forms/FormMessageBox.Designer.cs +++ b/Forms/FormMessageBox.Designer.cs @@ -194,6 +194,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoValidate = System.Windows.Forms.AutoValidate.Disable; this.BackColor = System.Drawing.Color.CornflowerBlue; this.ClientSize = new System.Drawing.Size(380, 150); this.Controls.Add(this.pnl_Body); diff --git a/Forms/FormMessageBox.cs b/Forms/FormMessageBox.cs index e4cf758..a36dbcd 100644 --- a/Forms/FormMessageBox.cs +++ b/Forms/FormMessageBox.cs @@ -1,7 +1,19 @@ -using System; +/* + @app : MobaXterm + @repo : https://github.com/Aetherinox/MobaXtermKeygen + @author : Aetherinox +*/ + +#region "Using" + +using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; +using Res = MobaXtermKG.Properties.Resources; +using Cfg = MobaXtermKG.Properties.Settings; + +#endregion namespace MobaXtermKG.Msgbox { @@ -161,7 +173,7 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ case MessageBoxButtons.OK: btn_1.Visible = true; btn_1.Location = new Point( xCenter, yCenter ); - btn_1.Text = "&OK"; + btn_1.Text = Res.btn_template_ok; btn_1.DialogResult = DialogResult.OK; SetDefaultButton( btn_Default ); @@ -175,12 +187,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ btn_1.Visible = true; btn_1.Location = new Point( xCenter - ( btn_1.Width / 2 ) - 5, yCenter ); - btn_1.Text = "&OK"; + btn_1.Text = Res.btn_template_ok; btn_1.DialogResult = DialogResult.OK; btn_2.Visible = true; btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter ); - btn_2.Text = "&Cancel"; + btn_2.Text = Res.btn_template_cancel; btn_2.DialogResult = DialogResult.Cancel; btn_2.BackColor = Color.DimGray; @@ -198,12 +210,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ btn_1.Visible = true; btn_1.Location = new Point(xCenter - ( btn_1.Width / 2) - 5, yCenter ); - btn_1.Text = "&Retry"; + btn_1.Text = Res.btn_template_retry; btn_1.DialogResult = DialogResult.Retry; btn_2.Visible = true; btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter ); - btn_2.Text = "&Cancel"; + btn_2.Text = Res.btn_template_cancel; btn_2.DialogResult = DialogResult.Cancel; btn_2.BackColor = Color.DimGray; @@ -221,12 +233,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ btn_1.Visible = true; btn_1.Location = new Point(xCenter - ( btn_1.Width / 2) - 5, yCenter ); - btn_1.Text = "&Yes"; + btn_1.Text = Res.btn_template_yes; btn_1.DialogResult = DialogResult.Yes; btn_2.Visible = true; btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter ); - btn_2.Text = "&No"; + btn_2.Text = Res.btn_template_no; btn_2.DialogResult = DialogResult.No; btn_2.BackColor = Color.IndianRed; @@ -244,18 +256,18 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ btn_1.Visible = true; btn_1.Location = new Point( xCenter - btn_1.Width - 5, yCenter ); - btn_1.Text = "&Yes"; + btn_1.Text = Res.btn_template_yes; btn_1.DialogResult = DialogResult.Yes; btn_2.Visible = true; btn_2.Location = new Point( xCenter, yCenter ); - btn_2.Text = "&No"; + btn_2.Text = Res.btn_template_no; btn_2.DialogResult = DialogResult.No; btn_2.BackColor = Color.IndianRed; btn_3.Visible = true; btn_3.Location = new Point( xCenter + btn_2.Width + 5, yCenter ); - btn_3.Text = "&Cancel"; + btn_3.Text = Res.btn_template_cancel; btn_3.DialogResult = DialogResult.Cancel; btn_3.BackColor = Color.DimGray; @@ -271,18 +283,18 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_ btn_1.Visible = true; btn_1.Location = new Point( xCenter - btn_1.Width - 5, yCenter ); - btn_1.Text = "&Abort"; + btn_1.Text = Res.btn_template_abort; btn_1.DialogResult = DialogResult.Abort; btn_1.BackColor = Color.Goldenrod; btn_2.Visible = true; btn_2.Location = new Point(xCenter, yCenter); - btn_2.Text = "&Retry"; + btn_2.Text = Res.btn_template_retry; btn_2.DialogResult = DialogResult.Retry; btn_3.Visible = true; btn_3.Location = new Point( xCenter + btn_2.Width + 5, yCenter ); - btn_3.Text = "&Ignore"; + btn_3.Text = Res.btn_template_ignore; btn_3.DialogResult = DialogResult.Ignore; btn_3.BackColor = Color.IndianRed; diff --git a/Forms/FormParent.cs b/Forms/FormParent.cs index 3bb0e6e..f87a9e1 100644 --- a/Forms/FormParent.cs +++ b/Forms/FormParent.cs @@ -277,7 +277,7 @@ forces the debug activation timer to expire every X seconds. see method DebugTimer_Tick for functionality */ - DebugTimer.Interval = ( 10 * 700 ); + DebugTimer.Interval = ( 10 * ( 100 * Cfg.Default.app_debug_clicks_activate ) ); DebugTimer.Tick += new EventHandler( DebugTimer_Tick ); DebugTimer.Start ( ); SW_DebugRemains.Start ( ); @@ -289,10 +289,12 @@ This termines how long a user has to click the header image in order to enable d This is easier than creating yet another menu item. */ - private void DebugTimer_Tick(object sender, EventArgs e) + private void DebugTimer_Tick( object sender, EventArgs e ) { i_DebugClicks = 0; SW_DebugRemains.Restart( ); + + Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Timer", String.Format( "Debug timer SW_DebugRemains expired after {0} seconds -- resetting", Cfg.Default.app_debug_clicks_activate ) ); } /* @@ -342,9 +344,9 @@ update checker #pragma warning disable CS4014 Task.Factory.StartNew( () => { - if ( ( bUpdateAvailable && !Cfg.Default.bShowedUpdates ) ) + if ( ( bUpdateAvailable && !Settings.bShowedUpdates ) ) { - Cfg.Default.bShowedUpdates = true; + Settings.bShowedUpdates = true; var result = MessageBox.Show ( @@ -1181,25 +1183,28 @@ private void lbl_HeaderName_MouseClick( object sender, MouseEventArgs e ) i_DebugClicks++; /* - don't go higher than 7, otherwise each click after 7 will re-activate dialog + don't go higher than 7, otherwise each click after 7 will re-show confirmation dialog. Start back at 0 */ - int i_DebugRemains = 7 - i_DebugClicks; - if ( i_DebugRemains > 7 ) + int i_DebugRemains = Cfg.Default.app_debug_clicks_activate - i_DebugClicks; + if ( i_DebugClicks > Cfg.Default.app_debug_clicks_activate ) + { + i_DebugClicks = 0; return; + } /* timer > remaining */ - int remains = 7 - Convert.ToInt32( SW_DebugRemains.Elapsed.TotalSeconds ); + int remains = Cfg.Default.app_debug_clicks_activate - Convert.ToInt32( SW_DebugRemains.Elapsed.TotalSeconds ); /* prompt to enable / disable debug */ - if ( Cfg.Default.app_bDevmode ) + if ( Settings.app_bDevmode ) Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Trigger", String.Format( "Disable debug with {0} more clicks -- {1} seconds remain", i_DebugRemains, remains ) ); else Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Trigger", String.Format( "Enable debug with {0} more clicks -- {1} seconds remain", i_DebugRemains, remains ) ); @@ -1208,10 +1213,10 @@ prompt to enable / disable debug wait until 7 clicks are done in X seconds */ - if ( i_DebugClicks >= 7 ) + if ( i_DebugClicks >= Cfg.Default.app_debug_clicks_activate ) { - if ( Cfg.Default.app_bDevmode ) + if ( Settings.app_bDevmode ) { /* @@ -1228,7 +1233,7 @@ wait until 7 clicks are done in X seconds if ( resp_input.ToString( ).ToLower( ) == "yes" ) { - Cfg.Default.app_bDevmode = false; + Settings.app_bDevmode = false; Program.DisableDebugConsole( ); } @@ -1251,14 +1256,16 @@ wait until 7 clicks are done in X seconds if ( resp_input.ToString( ).ToLower( ) == "yes" ) { - Cfg.Default.app_bDevmode = true; + Settings.app_bDevmode = true; Program.EnableDebugConsole( ); } } } } + #endregion + } } diff --git a/Materials/bch.png b/Materials/bch.png new file mode 100644 index 0000000..453ae4f Binary files /dev/null and b/Materials/bch.png differ diff --git a/Materials/bg_header.jpg b/Materials/bg_header.jpg new file mode 100644 index 0000000..cc60b07 Binary files /dev/null and b/Materials/bg_header.jpg differ diff --git a/Materials/btc.png b/Materials/btc.png new file mode 100644 index 0000000..da93fd1 Binary files /dev/null and b/Materials/btc.png differ diff --git a/Materials/eth.png b/Materials/eth.png new file mode 100644 index 0000000..e93b45d Binary files /dev/null and b/Materials/eth.png differ diff --git a/Materials/notify_01.png b/Materials/notify_01.png new file mode 100644 index 0000000..b6566c4 Binary files /dev/null and b/Materials/notify_01.png differ diff --git a/MobaXtermKG.csproj b/MobaXtermKG.csproj index 54335f9..fe669b9 100644 --- a/MobaXtermKG.csproj +++ b/MobaXtermKG.csproj @@ -36,7 +36,7 @@ MobaXterm Aetherx 0 - 1.3.0.0 + 1.3.1.0 false true true @@ -96,9 +96,6 @@ - - packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - @@ -202,7 +199,6 @@ - SettingsSingleFileGenerator Settings.Designer.cs @@ -219,15 +215,14 @@ + + + + + - - - - - - diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e7d2bad..dc4d83a 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ // 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("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 8520881..d6555b4 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -135,6 +135,96 @@ internal static System.Drawing.Bitmap btc { } } + /// + /// Looks up a localized string similar to &Generate. + /// + internal static string btn_generate { + get { + return ResourceManager.GetString("btn_generate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Copy. + /// + internal static string btn_generate_copy { + get { + return ResourceManager.GetString("btn_generate_copy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Save Keyfile. + /// + internal static string btn_savekeyfile { + get { + return ResourceManager.GetString("btn_savekeyfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Abort. + /// + internal static string btn_template_abort { + get { + return ResourceManager.GetString("btn_template_abort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Cancel. + /// + internal static string btn_template_cancel { + get { + return ResourceManager.GetString("btn_template_cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Ignore. + /// + internal static string btn_template_ignore { + get { + return ResourceManager.GetString("btn_template_ignore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &No. + /// + internal static string btn_template_no { + get { + return ResourceManager.GetString("btn_template_no", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &OK. + /// + internal static string btn_template_ok { + get { + return ResourceManager.GetString("btn_template_ok", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Retry. + /// + internal static string btn_template_retry { + get { + return ResourceManager.GetString("btn_template_retry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Yes. + /// + internal static string btn_template_yes { + get { + return ResourceManager.GetString("btn_template_yes", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Properties/Resources.resx b/Properties/Resources.resx index b4538bf..645b756 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -134,13 +134,43 @@ - ..\Resources\bch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Materials\bch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\bg_header.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Materials\bg_header.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\btc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Materials\btc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + &Generate + + + &Copy + + + &Save Keyfile + + + &Abort + + + &Cancel + + + &Ignore + + + &No + + + &OK + + + &Retry + + + &Yes ..\Materials\bell.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -149,7 +179,7 @@ ..\Materials\error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\eth.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Materials\eth.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Materials\exclamation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -310,7 +340,7 @@ Would you like to view the update? If not, program will start as normal. Update Available: {0} ► {1} - ..\Resources\notify_01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Materials\notify_01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a This program will generate a diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index b56074e..a023eef 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -114,30 +114,6 @@ public string app_url_manifest { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool bShowedUpdates { - get { - return ((bool)(this["bShowedUpdates"])); - } - set { - this["bShowedUpdates"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool app_bDevmode { - get { - return ((bool)(this["app_bDevmode"])); - } - set { - this["app_bDevmode"] = value; - } - } - [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("hex_original.dmp")] @@ -149,7 +125,7 @@ public string app_res_file_dmp_original { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("hex_original.dmp")] + [global::System.Configuration.DefaultSettingValueAttribute("hex_patched.dmp")] public string app_res_file_dmp_patched { get { return ((string)(this["app_res_file_dmp_patched"])); @@ -165,27 +141,30 @@ public string app_argid_debug { } } - [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] public bool NeedsUpgrade { get { return ((bool)(this["NeedsUpgrade"])); } - set { - this["NeedsUpgrade"] = value; - } } - [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("MobaXterm")] public string app_name { get { return ((string)(this["app_name"])); } - set { - this["app_name"] = value; + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("7")] + public int app_debug_clicks_activate { + get { + return ((int)(this["app_debug_clicks_activate"])); } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index ae77f07..7a725e2 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -32,26 +32,23 @@ https://raw.githubusercontent.com/Aetherinox/MobaXtermKeygen/master/Manifest/manifest.json - - False - - - False - hex_original.dmp - hex_original.dmp + hex_patched.dmp --debug - + False - + MobaXterm + + 7 + \ No newline at end of file diff --git a/Tools/signtool.exe b/Tools/signtool.exe new file mode 100644 index 0000000..d200127 Binary files /dev/null and b/Tools/signtool.exe differ diff --git a/Tools/xsum.exe b/Tools/xsum.exe new file mode 100644 index 0000000..20d5b83 Binary files /dev/null and b/Tools/xsum.exe differ diff --git a/app.config b/app.config index 76b9421..aceff09 100644 --- a/app.config +++ b/app.config @@ -4,9 +4,6 @@
- -
- @@ -44,27 +41,21 @@ hex_original.dmp - hex_original.dmp + hex_patched.dmp --debug - - - - - - False - - - False - False MobaXterm + + 7 + - - + + + diff --git a/bin/Release/MobaXtermKG.exe b/bin/Release/MobaXtermKG.exe index ca9908e..7e6607e 100644 Binary files a/bin/Release/MobaXtermKG.exe and b/bin/Release/MobaXtermKG.exe differ diff --git a/bin/Release/app.publish/MobaXtermKG.exe b/bin/Release/app.publish/MobaXtermKG.exe index 10d00b8..df36401 100644 Binary files a/bin/Release/app.publish/MobaXtermKG.exe and b/bin/Release/app.publish/MobaXtermKG.exe differ diff --git a/sign.bat b/sign.bat index bb8191c..80cb4ed 100644 --- a/sign.bat +++ b/sign.bat @@ -1,5 +1,5 @@ @ECHO OFF -TITLE Aetherx - Signtool) +TITLE Aetherx - Signtool SETLOCAL ENABLEDELAYEDEXPANSION MODE con:cols=125 lines=30 MODE 125,30 @@ -53,7 +53,7 @@ IF !ERRORLEVEL! NEQ 0 ( %echo% This script has detected that the command %signtool% is not accessible. %echo%. - TITLE Signtool Missing [Error] + TITLE Aetherx - Signtool Missing [Error] %echo% Press any key to acknowledge error and try anyway ... PAUSE >nul @@ -67,23 +67,92 @@ IF !ERRORLEVEL! NEQ 0 ( IF %dir_home:~-1%==\ SET dir_home=%dir_home:~0,-1% :: ----------------------------------------------------------------------------------------------------- -:: sign each file +:: func: NEXT +:: continue script :: ----------------------------------------------------------------------------------------------------- -for /R "bin/Release/" %%f in (*.exe) do ( - call signtool sign /sha1 "%CERT_THUMBPRINT%" /fd SHA256 /t http://timestamp.comodoca.com/authenticode "%%f" -) +:NEXT + + %echo% Select an option: + %echo% 1 Sign EXE /Bin/Release + %echo% 2 Sign EXE + DLL Current folder + %echo%. + %echo%. + set /P v_input_cs_type=" Enter Choice: " + %echo%. + + if [!v_input_cs_type!]==[] ( + %echo% No choice provided, defaulting to OPTION + %echo%. + GOTO SIGN_EXE_SUBFOLDERS + ) + + if /I "%v_input_cs_type%" EQU "1" ( + GOTO SIGN_EXE_SUBFOLDERS + ) + + if /I "%v_input_cs_type%" EQU "2" ( + GOTO SIGN_EXE_DLL_CUROLDER + ) else ( + %echo%. + %echo% Unrecognized Option !v_input_cs_type! + %echo%. + + goto NEXT + ) + +:: ----------------------------------------------------------------------------------------------------- +:: func: SIGN > EXE ONLY > SUBFOLDER +:: sign exe subfolders +:: ----------------------------------------------------------------------------------------------------- + +:SIGN_EXE_SUBFOLDERS + + for /R "bin/Release/" %%f in ( *.exe ) do ( + call signtool sign /sha1 "%CERT_THUMBPRINT%" /fd SHA256 /d "Aetherx" /du "https://github.com/Aetherinox" /t http://timestamp.comodoca.com/authenticode "%%f" + ) + + goto FINISH + +:: ----------------------------------------------------------------------------------------------------- +:: func: SIGN > EXE + DLL > CURRENT FOLDER +:: sign exe, dll current folder +:: ----------------------------------------------------------------------------------------------------- + +:SIGN_EXE_DLL_CUROLDER + + :: ----------------------------------------------------------------------------------------------------- + :: sign DLL + :: ----------------------------------------------------------------------------------------------------- + + for %%f in ( *.dll ) do ( + call signtool sign /sha1 "%CERT_THUMBPRINT%" /fd SHA256 /d "Aetherx" /du "https://github.com/Aetherinox" /t http://timestamp.comodoca.com/authenticode "%%f" + ) + + :: ----------------------------------------------------------------------------------------------------- + :: sign EXE + :: ----------------------------------------------------------------------------------------------------- + + for %%f in ( *.exe ) do ( + call signtool sign /sha1 "%CERT_THUMBPRINT%" /fd SHA256 /d "Aetherx" /du "https://github.com/Aetherinox" /t http://timestamp.comodoca.com/authenticode "%%f" + ) + + goto FINISH :: ----------------------------------------------------------------------------------------------------- :: finish :: ----------------------------------------------------------------------------------------------------- -%echo%. -%echo%. +:FINISH -timeout /t 1 /nobreak >nul -TITLE Aetherx - Sign (Complete) + %echo%. + %echo%. -%echo% Press any key to close utility -PAUSE >nul + timeout /t 1 /nobreak >nul + TITLE Aetherx - Signtool (Complete) + %echo%. + %echo%. + %echo% Press any key to close utility + PAUSE >nul + Exit /B 0 \ No newline at end of file