diff --git a/Make-EXE/Assets/MakeReg.reg b/Make-EXE/Assets/MakeReg.reg index eac91e4..4e25b73 100644 Binary files a/Make-EXE/Assets/MakeReg.reg and b/Make-EXE/Assets/MakeReg.reg differ diff --git a/Make-EXE/Assets/gear_32xLG.png b/Make-EXE/Assets/gear_32xLG.png new file mode 100644 index 0000000..eb7b43c Binary files /dev/null and b/Make-EXE/Assets/gear_32xLG.png differ diff --git a/Make-EXE/MainWindow.xaml b/Make-EXE/MainWindow.xaml index f0069aa..266cf0b 100644 --- a/Make-EXE/MainWindow.xaml +++ b/Make-EXE/MainWindow.xaml @@ -6,8 +6,9 @@ xmlns:local="clr-namespace:Make_EXE" mc:Ignorable="d" Title="Make EXE" Height="250" Width="300" Loaded="Window_Loaded" Icon="BuildSolution.ico"> - - Make EXE + + + Make EXE diff --git a/Make-EXE/MainWindow.xaml.cs b/Make-EXE/MainWindow.xaml.cs index 0f8fadc..a3a0843 100644 --- a/Make-EXE/MainWindow.xaml.cs +++ b/Make-EXE/MainWindow.xaml.cs @@ -140,13 +140,13 @@ private void buttonInstall_Click(Object sender, RoutedEventArgs e) File.Copy(Application.ResourceAssembly.ManifestModule.Assembly.Location, installedPath, true); buttonInstall.IsEnabled = false; buttonRemove.IsEnabled = true; - MessageBox.Show("Install completed! Now right-click some PowerShell files! If the 'Make EXE' option isn't showing up, reset your program defaults and reinstall Make-EXE.", "Install Completed", MessageBoxButton.OK, MessageBoxImage.Information); + MessageBox.Show("Install completed! If the 'Make EXE' option isn't showing up, reset your program defaults and reinstall Make-EXE.", "Install Completed", MessageBoxButton.OK, MessageBoxImage.Information); } private void buttonRemove_Click(Object sender, RoutedEventArgs e) { Directory.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Make-EXE", true); - var psi = new ProcessStartInfo("cmd.exe", @"/c reg.exe delete HKCR\.ps1\shell\MakeEXE /f®.exe delete HKCR\Microsoft.PowerShellScript.1\Shell\MakeEXE /f®.exe delete HKCR\Applications\powershell_ise.exe\shell\MakeEXE /f"); + var psi = new ProcessStartInfo("cmd.exe", @"/c reg.exe delete HKCR\.ps1\shell\MakeEXE /f®.exe delete HKCR\Microsoft.PowerShellScript.1\Shell\MakeEXE /f®.exe delete HKCR\Applications\powershell_ise.exe\shell\MakeEXE /f®.exe delete HKCR\batfile\shell\MakeEXE /f"); psi.WindowStyle = ProcessWindowStyle.Hidden; psi.Verb = "runas"; var proc = Process.Start(psi); diff --git a/Make-EXE/Make-EXE.csproj b/Make-EXE/Make-EXE.csproj index 5d0c09f..46d8b8f 100644 --- a/Make-EXE/Make-EXE.csproj +++ b/Make-EXE/Make-EXE.csproj @@ -122,6 +122,9 @@ + + + diff --git a/Make-EXE/Maker.cs b/Make-EXE/Maker.cs index 1ae5216..4487901 100644 --- a/Make-EXE/Maker.cs +++ b/Make-EXE/Maker.cs @@ -9,7 +9,7 @@ static void Main(string[] args) var assembly = System.Reflection.Assembly.GetExecutingAssembly(); var resources = assembly.GetManifestResourceNames(); Console.Title = resources[0]; - Console.WriteLine("Extracting resources..."); + Console.WriteLine("Extracting resource files..."); var workingDir = ""; var count = 0; while (workingDir == "") @@ -20,16 +20,21 @@ static void Main(string[] args) { Directory.Delete(System.IO.Path.GetTempPath() + "Make-EXE" + count, true); } - workingDir = System.IO.Path.GetTempPath() + "Make-EXE" + count + @"\"; - Directory.CreateDirectory(workingDir); + else + { + workingDir = System.IO.Path.GetTempPath() + "Make-EXE" + count + @"\"; + Directory.CreateDirectory(workingDir); + } } catch { count++; } } + count = 0; foreach (var resource in resources) { + Console.WriteLine("Extracting file " + count + " of " + resources.Length + "..."); using (var rs = assembly.GetManifestResourceStream(resource)) { using (var fs = new FileStream(workingDir + resource, FileMode.Create)) @@ -41,7 +46,14 @@ static void Main(string[] args) } } Console.WriteLine("Starting up..."); - System.Diagnostics.Process.Start("powershell.exe", "-executionpolicy bypass -file \"" + workingDir + resources[0] + "\""); + if (Path.GetExtension(resources[0]).ToLower() == ".ps1") + { + System.Diagnostics.Process.Start("powershell.exe", "-executionpolicy bypass -file \"" + workingDir + resources[0] + "\""); + } + else if (Path.GetExtension(resources[0]).ToLower() == ".bat") + { + System.Diagnostics.Process.Start("cmd.exe", "/c " + resources[0]); + } } } } \ No newline at end of file diff --git a/Make-EXE/Properties/AssemblyInfo.cs b/Make-EXE/Properties/AssemblyInfo.cs index ff7665e..6f1ac9f 100644 --- a/Make-EXE/Properties/AssemblyInfo.cs +++ b/Make-EXE/Properties/AssemblyInfo.cs @@ -51,7 +51,7 @@ // 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("0.9.3.0")] -[assembly: AssemblyFileVersion("0.9.3.0")] +[assembly: AssemblyVersion("0.9.4.0")] +[assembly: AssemblyFileVersion("0.9.4.0")] [assembly: Guid("eea5aba0-927d-44ef-95ff-b4eccca23cfe")] diff --git a/Make-EXE/Windows/AboutWindow.xaml b/Make-EXE/Windows/AboutWindow.xaml index b26c6ff..d196f83 100644 --- a/Make-EXE/Windows/AboutWindow.xaml +++ b/Make-EXE/Windows/AboutWindow.xaml @@ -20,7 +20,7 @@ - +