diff --git a/MSOUI.csproj b/MSOUI.csproj deleted file mode 100644 index fae346b..0000000 --- a/MSOUI.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - Exe - net6.0 - MSOUI.Program - app.manifest - enable - enable - - - - none - false - 4 - - - - 4 - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - diff --git a/MSOUI.sln b/MSOUI.sln index d494f7a..dc57eed 100644 --- a/MSOUI.sln +++ b/MSOUI.sln @@ -3,9 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSOUI", "MSOUI.csproj", "{B7E4991D-99A9-4189-BCD9-557E04CA4473}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "msou_installer", "msou_installer\msou_installer.csproj", "{E86E8BBF-8830-4259-9DEE-6F3EFC284443}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "msou_installer", "msou_installer\msou_installer.csproj", "{E86E8BBF-8830-4259-9DEE-6F3EFC284443}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,10 +11,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B7E4991D-99A9-4189-BCD9-557E04CA4473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7E4991D-99A9-4189-BCD9-557E04CA4473}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7E4991D-99A9-4189-BCD9-557E04CA4473}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7E4991D-99A9-4189-BCD9-557E04CA4473}.Release|Any CPU.Build.0 = Release|Any CPU {E86E8BBF-8830-4259-9DEE-6F3EFC284443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E86E8BBF-8830-4259-9DEE-6F3EFC284443}.Debug|Any CPU.Build.0 = Debug|Any CPU {E86E8BBF-8830-4259-9DEE-6F3EFC284443}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/MSOUI.sln.DotSettings b/MSOUI.sln.DotSettings deleted file mode 100644 index e41268c..0000000 --- a/MSOUI.sln.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 7a4a8ff..0000000 --- a/Program.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Diagnostics; -using MSOUI.Properties; - -namespace MSOUI; - -internal static class Program -{ - private static void Main () - { - string folder = $"{Directory.GetCurrentDirectory()}\\mso_updates\\"; - if (!Directory.Exists (folder)) - { - Console.WriteLine(Resources.FolderNotExist, folder); - Console.ReadLine (); - return; - } - string Mask = "*.exe"; - List fileList = new(); - ScanForFiles(ref fileList, folder, Mask); - Console.WriteLine(Resources.StartUpdateMessage); - string? isAcceptStr = Console.ReadLine(); - if ((isAcceptStr ?? "n").ToLower() == "y") - InstallUpdates(ref fileList, folder); - Console.WriteLine(Resources.ProgramIsFinish); - Console.ReadLine(); - } - public static void StartProcess (string fileName) - { - Process process = new(); - process.StartInfo.FileName = fileName; - process.StartInfo.Arguments = "/q /norestart"; - process.StartInfo.CreateNoWindow = false; - process.EnableRaisingEvents = true; - process.Exited += (_, _) => Console.WriteLine(Resources.ProcessWasFinishedWithCode, process.ExitTime, process.ExitCode); - process.Start(); - process.WaitForExit(); - } - public static void InstallUpdates (ref List fileList, string folder) - { - Console.WriteLine(Resources.StartingUpdate); - - int updatesCount = fileList.Count; - - Console.WriteLine(Resources.UpdateCountMessage, updatesCount); - - int count = 0; - - foreach (string? file in fileList) - { - count++; - - decimal percentDone = Math.Round((decimal)count / updatesCount * 100); - - Console.WriteLine(Resources.UpdatingFile, file, count, updatesCount, percentDone); - StartProcess($"{folder}{file}"); - Console.WriteLine(Resources.FileWasUpdated, file); - } - } - public static void ScanForFiles (ref List fileList, string folder, string mask) - { - Console.WriteLine(Resources.SearchStarted); - Console.WriteLine($@" {folder}"); - Console.WriteLine(Resources.ListOfFoundFiles); - foreach (string fFile in Directory.EnumerateFiles(folder, mask, SearchOption.AllDirectories)) - { - try - { - FileInfo fInfo = new(fFile); - fileList.Add(fInfo.Name); - Console.WriteLine($@" {fInfo.Name}"); - } - catch - { - // ignored - } - } - } -} \ No newline at end of file diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs deleted file mode 100644 index b8c5aea..0000000 --- a/Properties/Resources.Designer.cs +++ /dev/null @@ -1,153 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Этот код создан программой. -// Исполняемая версия:4.0.30319.42000 -// -// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае -// повторной генерации кода. -// -//------------------------------------------------------------------------------ - -namespace MSOUI.Properties { - using System; - - - /// - /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. - /// - // Этот класс создан автоматически классом StronglyTypedResourceBuilder - // с помощью такого средства, как ResGen или Visual Studio. - // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen - // с параметром /str или перестройте свой проект VS. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MSOUI.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Перезаписывает свойство CurrentUICulture текущего потока для всех - /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Ищет локализованную строку, похожую на Файл "{0}" установлен!. - /// - internal static string FileWasUpdated { - get { - return ResourceManager.GetString("FileWasUpdated", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Директории «{0}» не существует!. - /// - internal static string FolderNotExist { - get { - return ResourceManager.GetString("FolderNotExist", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на СПИСОК НАЙДЕННЫХ ФАЙЛОВ:. - /// - internal static string ListOfFoundFiles { - get { - return ResourceManager.GetString("ListOfFoundFiles", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на [{0}] Процесс завершен с кодом {1}.. - /// - internal static string ProcessWasFinishedWithCode { - get { - return ResourceManager.GetString("ProcessWasFinishedWithCode", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Работа программы завершена. Нажмите "Enter" для выхода.. - /// - internal static string ProgramIsFinish { - get { - return ResourceManager.GetString("ProgramIsFinish", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Начинаю поиск исполняемых файлов в папке:. - /// - internal static string SearchStarted { - get { - return ResourceManager.GetString("SearchStarted", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Начинаю установку.... - /// - internal static string StartingUpdate { - get { - return ResourceManager.GetString("StartingUpdate", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Приступить к установке обновлений? [Y, y - да, любая другая клавиша - нет]. - /// - internal static string StartUpdateMessage { - get { - return ResourceManager.GetString("StartUpdateMessage", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Выбрано {0} обновлений для установки.... - /// - internal static string UpdateCountMessage { - get { - return ResourceManager.GetString("UpdateCountMessage", resourceCulture); - } - } - - /// - /// Ищет локализованную строку, похожую на Устанавливается файл "{0}" [{1} из {2}, {3}%].... - /// - internal static string UpdatingFile { - get { - return ResourceManager.GetString("UpdatingFile", resourceCulture); - } - } - } -} diff --git a/Properties/Resources.resx b/Properties/Resources.resx deleted file mode 100644 index 10c73bd..0000000 --- a/Properties/Resources.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - [{0}] Процесс завершен с кодом {1}. - - - Директории «{0}» не существует! - - - Приступить к установке обновлений? [Y, y - да, любая другая клавиша - нет] - - - Работа программы завершена. Нажмите "Enter" для выхода. - - - Начинаю установку... - - - Выбрано {0} обновлений для установки... - - - Устанавливается файл "{0}" [{1} из {2}, {3}%]... - - - Файл "{0}" установлен! - - - Начинаю поиск исполняемых файлов в папке: - - - СПИСОК НАЙДЕННЫХ ФАЙЛОВ: - - \ No newline at end of file diff --git a/app.manifest b/app.manifest deleted file mode 100644 index 264d5a0..0000000 --- a/app.manifest +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msou_installer/Forms/ExecuterForm.Designer.cs b/msou_installer/Forms/ExecuterForm.Designer.cs deleted file mode 100644 index 5d22ff0..0000000 --- a/msou_installer/Forms/ExecuterForm.Designer.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace msoui.Forms; - -partial class ExecuterForm -{ - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose (bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent () - { - this.SuspendLayout(); - // - // ExecuterForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(496, 180); - this.ControlBox = false; - this.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ExecuterForm"; - this.Text = "Установка обновлений"; - this.ResumeLayout(false); - - } - - #endregion -} \ No newline at end of file diff --git a/msou_installer/Forms/ExecuterForm.cs b/msou_installer/Forms/ExecuterForm.cs deleted file mode 100644 index 621f8c4..0000000 --- a/msou_installer/Forms/ExecuterForm.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace msoui.Forms; -public partial class ExecuterForm: Form -{ - public ExecuterForm () - { - InitializeComponent(); - } -} diff --git a/msou_installer/Forms/InstallForm.Designer.cs b/msou_installer/Forms/InstallForm.Designer.cs new file mode 100644 index 0000000..e36dcac --- /dev/null +++ b/msou_installer/Forms/InstallForm.Designer.cs @@ -0,0 +1,124 @@ +namespace msoui.Forms; + +partial class InstallForm +{ + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose (bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent () + { + this.components = new System.ComponentModel.Container(); + this.actionPanel = new System.Windows.Forms.Panel(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.statusLabel = new System.Windows.Forms.Label(); + this.logList = new System.Windows.Forms.ListBox(); + this.process = new System.Diagnostics.Process(); + this.startTimer = new System.Windows.Forms.Timer(this.components); + this.actionPanel.SuspendLayout(); + this.SuspendLayout(); + // + // actionPanel + // + this.actionPanel.Controls.Add(this.progressBar); + this.actionPanel.Controls.Add(this.statusLabel); + this.actionPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.actionPanel.Location = new System.Drawing.Point(0, 0); + this.actionPanel.Name = "actionPanel"; + this.actionPanel.Padding = new System.Windows.Forms.Padding(10); + this.actionPanel.Size = new System.Drawing.Size(496, 91); + this.actionPanel.TabIndex = 5; + // + // progressBar + // + this.progressBar.Dock = System.Windows.Forms.DockStyle.Fill; + this.progressBar.Location = new System.Drawing.Point(10, 59); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(476, 22); + this.progressBar.TabIndex = 1; + // + // statusLabel + // + this.statusLabel.Dock = System.Windows.Forms.DockStyle.Top; + this.statusLabel.Location = new System.Drawing.Point(10, 10); + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size(476, 49); + this.statusLabel.TabIndex = 0; + this.statusLabel.Text = "&Начинаю установку..."; + // + // logList + // + this.logList.Dock = System.Windows.Forms.DockStyle.Fill; + this.logList.FormattingEnabled = true; + this.logList.ItemHeight = 21; + this.logList.Location = new System.Drawing.Point(0, 0); + this.logList.Margin = new System.Windows.Forms.Padding(10); + this.logList.Name = "logList"; + this.logList.Size = new System.Drawing.Size(496, 313); + this.logList.TabIndex = 4; + // + // process + // + this.process.StartInfo.Domain = ""; + this.process.StartInfo.LoadUserProfile = false; + this.process.StartInfo.Password = null; + this.process.StartInfo.StandardErrorEncoding = null; + this.process.StartInfo.StandardInputEncoding = null; + this.process.StartInfo.StandardOutputEncoding = null; + this.process.StartInfo.UserName = ""; + this.process.SynchronizingObject = this; + // + // startTimer + // + this.startTimer.Interval = 1000; + this.startTimer.Tick += new System.EventHandler(this.startTimer_Tick); + // + // InstallForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(496, 313); + this.ControlBox = false; + this.Controls.Add(this.actionPanel); + this.Controls.Add(this.logList); + this.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.Margin = new System.Windows.Forms.Padding(4); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "InstallForm"; + this.Text = "Установка обновлений"; + this.Load += new System.EventHandler(this.InstallForm_Load); + this.actionPanel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Panel actionPanel; + private ProgressBar progressBar; + private Label statusLabel; + private ListBox logList; + private System.Diagnostics.Process process; + private System.Windows.Forms.Timer startTimer; +} \ No newline at end of file diff --git a/msou_installer/Forms/InstallForm.cs b/msou_installer/Forms/InstallForm.cs new file mode 100644 index 0000000..f3534a8 --- /dev/null +++ b/msou_installer/Forms/InstallForm.cs @@ -0,0 +1,75 @@ +namespace msoui.Forms; +public partial class InstallForm: Form +{ + public InstallForm (List fileList, string extractDir) + { + FileList = fileList; + ExtractDir = extractDir; + InitializeComponent(); + } + + public List FileList { get; set; } + + public string ExtractDir { get; set; } + + private void LogIt(string message) + { + logList.Items.Add(message); + } + + private void LogIt (string message, params object?[] args) + { + logList.Items.Add(string.Format(message, args)); + } + + public void StartProcess (string fileName) + { + process.StartInfo.FileName = fileName; + process.StartInfo.Arguments = "/q /norestart"; + process.StartInfo.CreateNoWindow = false; + process.EnableRaisingEvents = true; + process.Exited += (_, _) => LogIt(@"[{0}] Процесс завершен с кодом {1}.", process.ExitTime, process.ExitCode); + process.Start(); + process.WaitForExit(); + } + + + public void InstallUpdates () + { + LogIt("Начинаю установку..."); + + int updatesCount = FileList.Count; + + LogIt("Выбрано {0} обновлений для установки...", updatesCount); + + int count = 0; + + foreach (string? file in FileList) + { + count++; + + decimal percentDone = Math.Round((decimal)count / updatesCount * 100); + + LogIt(@"Устанавливается файл {0} [{1} из {2}, {3}%]...", file, count, updatesCount, percentDone); + StartProcess($"{ExtractDir}{file}"); + LogIt(@"Файл {0} установлен!", file); + } + + MessageBox.Show(@"Набор обновлений успешно установлен!", @"Установка завершена", MessageBoxButtons.OK, + MessageBoxIcon.Asterisk); + + DialogResult = DialogResult.OK; + } + + private void startTimer_Tick (object sender, EventArgs e) + { + startTimer.Enabled = false; + + InstallUpdates(); + } + + private void InstallForm_Load (object sender, EventArgs e) + { + startTimer.Enabled = true; + } +} diff --git a/msou_installer/Forms/ExecuterForm.resx b/msou_installer/Forms/InstallForm.resx similarity index 87% rename from msou_installer/Forms/ExecuterForm.resx rename to msou_installer/Forms/InstallForm.resx index f298a7b..6780448 100644 --- a/msou_installer/Forms/ExecuterForm.resx +++ b/msou_installer/Forms/InstallForm.resx @@ -57,4 +57,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 110, 17 + \ No newline at end of file diff --git a/msou_installer/Forms/MainForm.Designer.cs b/msou_installer/Forms/MainForm.Designer.cs index 0dba9ef..181409e 100644 --- a/msou_installer/Forms/MainForm.Designer.cs +++ b/msou_installer/Forms/MainForm.Designer.cs @@ -28,6 +28,7 @@ sealed partial class MainForm /// private void InitializeComponent () { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.contentPanel = new System.Windows.Forms.Panel(); this.viewButton = new System.Windows.Forms.Button(); this.bitsSelector64 = new System.Windows.Forms.RadioButton(); @@ -39,7 +40,6 @@ sealed partial class MainForm this.buttonsPanel = new System.Windows.Forms.Panel(); this.exitButton = new System.Windows.Forms.Button(); this.installButton = new System.Windows.Forms.Button(); - this.settingsButton = new System.Windows.Forms.Button(); this.dataFileDialog = new System.Windows.Forms.OpenFileDialog(); this.contentPanel.SuspendLayout(); this.buttonsPanel.SuspendLayout(); @@ -137,7 +137,6 @@ sealed partial class MainForm // this.buttonsPanel.Controls.Add(this.exitButton); this.buttonsPanel.Controls.Add(this.installButton); - this.buttonsPanel.Controls.Add(this.settingsButton); this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Bottom; this.buttonsPanel.Location = new System.Drawing.Point(0, 214); this.buttonsPanel.Name = "buttonsPanel"; @@ -164,15 +163,6 @@ sealed partial class MainForm this.installButton.UseVisualStyleBackColor = true; this.installButton.Click += new System.EventHandler(this.installButton_Click); // - // settingsButton - // - this.settingsButton.Location = new System.Drawing.Point(12, 13); - this.settingsButton.Name = "settingsButton"; - this.settingsButton.Size = new System.Drawing.Size(110, 33); - this.settingsButton.TabIndex = 0; - this.settingsButton.Text = "&Настройки"; - this.settingsButton.UseVisualStyleBackColor = true; - // // dataFileDialog // this.dataFileDialog.DefaultExt = "data"; @@ -189,6 +179,7 @@ sealed partial class MainForm this.Controls.Add(this.contentPanel); this.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Margin = new System.Windows.Forms.Padding(4); this.MaximizeBox = false; this.MinimizeBox = false; @@ -216,6 +207,5 @@ sealed partial class MainForm private Label titleLabel; private Button exitButton; private Button installButton; - private Button settingsButton; private OpenFileDialog dataFileDialog; } \ No newline at end of file diff --git a/msou_installer/Forms/MainForm.cs b/msou_installer/Forms/MainForm.cs index 971632d..b3cc801 100644 --- a/msou_installer/Forms/MainForm.cs +++ b/msou_installer/Forms/MainForm.cs @@ -51,7 +51,7 @@ public sealed partial class MainForm: Form unPackFrm.Dispose(); // - UpdatesListForm updatesListForm = new UpdatesListForm(updatesList); + UpdatesListForm updatesListForm = new(updatesList); // DialogResult ulDialogResult = updatesListForm.ShowDialog(); @@ -64,7 +64,20 @@ public sealed partial class MainForm: Form return; } - // + // + updatesListForm.Dispose(); + + // + InstallForm installForm = new (updatesList, TempWorkDir); + + // + installForm.ShowDialog(); + + // + installForm.Dispose(); + + // + CleanThis(updatesList); } private void StartForm_Load (object sender, EventArgs e) diff --git a/msou_installer/Forms/MainForm.resx b/msou_installer/Forms/MainForm.resx index 084584e..122bed5 100644 --- a/msou_installer/Forms/MainForm.resx +++ b/msou_installer/Forms/MainForm.resx @@ -60,4 +60,64 @@ 17, 17 + + + + AAABAAEAICAAAAEAGACoDAAAFgAAACgAAAAgAAAAQAAAAAEAGAAAAAAAAAAAAEgAAABIAAAAAAAAAAAA + AAD////V1dVLS0sICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBwdHR0fR0dH////X19cPDw8AAAABAQEEBAQEBAQEBAQE + BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE + BAQBAQEAAAAMDAzR0dFRUVEAAABQUFDs7Oz///////////////////////////////////////////// + ///////////////////////////////////////////////////u7u5XV1cAAABISEgPDw8AAADl5eX/ + //////////////////////////////////////////////////////////////////////////////// + ///////////////////////u7u4BAQEHBwcEBAQAAAD7+/v///////////////////////////////// + //////////////////////////////////////////////////////////////////////////8EBAQA + AAAEBAQAAAD7+/v///////////////////////////////////////////////////////////////// + //////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////8EBAQAAAAEBAQAAAD7+/v////////////////////////////////////////////////+ + /v7+/v7///////////////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v/ + ///////////////////////////////////////////p6ekwMDAqKirl5eX///////////////////// + //////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////// + ///////p6ekrKysAAAAAAAAmJibl5eX///////////////////////////////////////////8EBAQA + AAAEBAQAAAD7+/v////////////////////////////////////p6ekrKysAAAAAAAAAAAAAAAAmJibl + 5eX///////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////// + ///////////////p6ekrKysAAAAsLCwCAgIAAAAvLy8AAAAmJibl5eX///////////////////////// + //////////8EBAQAAAAEBAQAAAD7+/v////////////////////////////p6ekrKysAAAAsLCzp6ekE + BAQAAADp6ekyMjIAAAAmJibl5eX///////////////////////////////8EBAQAAAAEBAQAAAD7+/v/ + ///////////////////////p6ekrKysAAAAsLCzp6en///8EBAQAAAD7+/vt7e0yMjIAAAAmJibl5eX/ + //////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////////////8zMzMAAAAs + LCzp6en///////8EBAQAAAD7+/v////t7e0yMjIAAAAqKir+/v7///////////////////////8EBAQA + AAAEBAQAAAD7+/v///////////////////////9BQUE0NDTp6en///////////8EBAQAAAD7+/v///// + ///t7e06Ojo4ODj///////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////// + //////////////////////////////8EBAQAAAD7+/v///////////////////////////////////// + //////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////////////////////8E + BAQAAAD7+/v///////////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v/ + //////////////////////////////////////////////8EBAQAAAD7+/v///////////////////// + //////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////// + //////////////8EBAQAAAD7+/v///////////////////////////////////////////////8EBAQA + AAAEBAQAAAD7+/v///////////////////////////////////////////////8EBAQAAAD7+/v///// + //////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////// + //////////////////////////////8EBAQAAAD7+/v///////////////////////////////////// + //////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////////////////////8E + BAQAAAD7+/v///////////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v/ + //////////////////////////////////////////////9BQUE5OTn///////////////////////// + //////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////// + //////////////////////////////////////////////////////////////////////////8EBAQA + AAAEBAQAAAD7+/v///////////////////////////////////////////////////////////////// + //////////////////////////////////////////8EBAQAAAAEBAQAAAD7+/v///////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////8EBAQAAAAEBAQAAAD7+/v///////////////////////////////////////////////// + //////////////////////////////////////////////////////////8EBAQAAAAREREAAADj4+P/ + //////////////////////////////////////////////////////////////////////////////// + ///////////////////////r6+sBAQEICAhVVVUAAABJSUni4uL7+/v7+/v7+/v7+/v7+/v7+/v7+/v7 + +/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/vl5eVQUFAAAABM + TEzc3NwTExMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBDW1tb////c3NxVVVUREREEBAQEBAQEBAQE + BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE + BAQQEBBRUVHY2Nj///8P///wIAAABEAAAAJAAAAAQAAAAUAAAAFAAAABQAAAAUAAAAFAAYABQAPAAUAE + oAFACJABQBCIAUAghAFAAIABQACAAUAAgAFAAIABQACAAUAAgAFAAIABQACAAUAAAAFAAAABQAAAAUAA + AAFAAAABQAAAAEAAAAI////8AAAAAA== + + \ No newline at end of file diff --git a/msou_installer/Forms/UnPackForm.cs b/msou_installer/Forms/UnPackForm.cs index b6c6212..1e28e0b 100644 --- a/msou_installer/Forms/UnPackForm.cs +++ b/msou_installer/Forms/UnPackForm.cs @@ -78,7 +78,7 @@ public sealed partial class UnPackForm: Form Application.DoEvents(); //Распаковываю файл - //entry.Extract($@"{unPackTo}{unPackFileName}"); + entry.Extract($@"{Model.UnPackDir}{unPackFileName}"); //Добавляю в список файлов if (File.Exists($@"{Model.UnPackDir}{unPackFileName}")) diff --git a/msou_installer/Forms/UpdatesListForm.Designer.cs b/msou_installer/Forms/UpdatesListForm.Designer.cs index a1e18d3..696c7a7 100644 --- a/msou_installer/Forms/UpdatesListForm.Designer.cs +++ b/msou_installer/Forms/UpdatesListForm.Designer.cs @@ -75,6 +75,7 @@ sealed partial class UpdatesListForm this.installButton.TabIndex = 3; this.installButton.Text = "&Установить >"; this.installButton.UseVisualStyleBackColor = true; + this.installButton.Click += new System.EventHandler(this.installButton_Click); // // cancelButton // @@ -84,7 +85,7 @@ sealed partial class UpdatesListForm this.cancelButton.TabIndex = 4; this.cancelButton.Text = "< &Отмена"; this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.button2_Click); + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); // // selectionStatus // diff --git a/msou_installer/Forms/UpdatesListForm.cs b/msou_installer/Forms/UpdatesListForm.cs index 5d555b4..da58c33 100644 --- a/msou_installer/Forms/UpdatesListForm.cs +++ b/msou_installer/Forms/UpdatesListForm.cs @@ -11,11 +11,6 @@ public sealed partial class UpdatesListForm: Form private const string SelectionStatusLabel = "{0} выбрано из {1}"; - private void button2_Click (object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - } - private void selectAllButton_Click (object sender, EventArgs e) { for (int index = 0; index < updatesListBox.Items.Count; index++) @@ -34,4 +29,20 @@ public sealed partial class UpdatesListForm: Form { selectionStatus.Text = string.Format(SelectionStatusLabel, updatesListBox.CheckedItems.Count, updatesListBox.Items.Count); } + + private void installButton_Click (object sender, EventArgs e) + { + UpdatesList.Clear(); + + foreach (object checkedItem in updatesListBox.CheckedItems) + { + if (checkedItem.ToString() != null) + UpdatesList.Add(checkedItem.ToString()!); + } + } + + private void cancelButton_Click (object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + } } diff --git a/msou_installer/arrow-down-square.ico b/msou_installer/arrow-down-square.ico new file mode 100644 index 0000000..27dbf79 Binary files /dev/null and b/msou_installer/arrow-down-square.ico differ diff --git a/msou_installer/msou_installer.csproj b/msou_installer/msou_installer.csproj index 484e10d..ac5494b 100644 --- a/msou_installer/msou_installer.csproj +++ b/msou_installer/msou_installer.csproj @@ -7,8 +7,14 @@ true enable msoui + msoui.Program + arrow-down-square.ico + + + +