Switch-Toolbox/Updater
DanielSvoboda 0d33f4ead1
Updater Fix/Improvements (#606)
* Updater Fix/Improvements

In SetAccessRule():
A call to the Directory.SetAccessControl method was added to apply the changes made to the DirectorySecurity object. Additionally, the function does not handle possible exceptions that may occur during code execution. This version of the function attempts to set the access rule for the specified directory and, if an error occurs during the process, prints an error message on the screen. This helps to identify and fix possible problems that may occur during code execution.

In Install():
The function checks if the destination directory exists before attempting to delete it. Additionally, a destDir variable was created to store the path of the 'destination directory' and a destFile variable to store the path of the 'destination file'. This makes the code a little more readable.

In Application_Idle():
A MessageBox.Show was included to display a dialog box with the message "Updates are available. Do you want to update now?" and two buttons: "Yes" and "No". If the user clicks on the "Yes" button, the UpdateNotifcationClick method is called to start the update process. Otherwise, the dialog box is closed and no action is taken.

The dialog box will only be shown once for each available update, as the UsePrompt variable is set to false after the dialog box is shown for the first time.

when trying to update, updater.exe crashed and presented the following error, as shown in the print below:
unhandled exception: Unable to create a file that already exists.

* Updater Fix/Improvements
2023-05-26 17:07:09 -04:00
..
Properties More fixes for permissions 2019-06-01 19:09:27 -04:00
App.config BFRES : Support v0.10 bfres loading (no saving with models). 2022-08-25 19:33:46 -04:00
Program.cs Updater Fix/Improvements (#606) 2023-05-26 17:07:09 -04:00
Updater.csproj BFRES : Support v0.10 bfres loading (no saving with models). 2022-08-25 19:33:46 -04:00