diff --git a/Documentation/Icon/BlueUpdate Icon 128x128.png b/Documentation/Icon/BlueUpdate Icon 128x128.png new file mode 100644 index 0000000..1988e60 Binary files /dev/null and b/Documentation/Icon/BlueUpdate Icon 128x128.png differ diff --git a/README.md b/README.md index 41f93f8..a5cc4ef 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ In order to use the `BlueUpdate` toolkit, you must have your own web directory i Before using the `Update` class, you must set the `UpdatableApp.Current`, which represents the currently running application. This must be done in order to check if the currently running application was installed correctly, to set the root directory, etc.. Every application must be inside the directory with the same name as the application itself. The recommended install path format is: *`/MyCompany/My App/My App.exe`*. The root directory of this example is *`/MyCompany`*. This way, you can have multiple applications inside your companies root directory. -When you use the `Update` class for the first time, its static initializer will check if the updater is installed inside the root directory. If I follow the previous path example, the updater would be installed in *`/MyCompany/Updater`*. If the updater is not yet installed, it will install it. The updater is very small (~1 MB). +When you use the `Update` class for the first time, its static initializer will check if the updater is installed inside the root directory. If I follow the previous path example, the updater would be installed in *`/MyCompany/Updater`*. If the updater is not yet installed, it will install it. The updater is very small (~398 KB). The `Update.Check()` simply checks if the latest version of the application is greater than the current. If it is, then it needs to be updated. The `Update.Run()` starts the updater application, which will update the currently running application. That is why the currently running application must close immediately after that, otherwise the updater will not be able to update/modify the files of the application. diff --git a/src/BlueUpdate/BlueUpdate Updater/Properties/AssemblyInfo.cs b/src/BlueUpdate/BlueUpdate Updater/Properties/AssemblyInfo.cs index 967f790..fb4c18e 100644 --- a/src/BlueUpdate/BlueUpdate Updater/Properties/AssemblyInfo.cs +++ b/src/BlueUpdate/BlueUpdate Updater/Properties/AssemblyInfo.cs @@ -79,5 +79,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 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.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] diff --git a/src/BlueUpdate/BlueUpdate/BlueUpdate.nuspec b/src/BlueUpdate/BlueUpdate/BlueUpdate.nuspec index 41f2c5c..432f8f6 100644 --- a/src/BlueUpdate/BlueUpdate/BlueUpdate.nuspec +++ b/src/BlueUpdate/BlueUpdate/BlueUpdate.nuspec @@ -9,19 +9,23 @@ LICENSE.md https://github.com/GregaMohorko/BlueUpdate - BlueUpdate Icon.png + BlueUpdate Icon 128x128.png false $description$ $copyright$ Update Updater Version Check Checksum Deployment Install - Enabled SourceLink. + Fixed a bug where it didn't recognize previous version of Updater as legit. - + + + + + - + diff --git a/src/BlueUpdate/BlueUpdate/Properties/AssemblyInfo.cs b/src/BlueUpdate/BlueUpdate/Properties/AssemblyInfo.cs index 5911de2..07591e6 100644 --- a/src/BlueUpdate/BlueUpdate/Properties/AssemblyInfo.cs +++ b/src/BlueUpdate/BlueUpdate/Properties/AssemblyInfo.cs @@ -60,5 +60,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 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.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] diff --git a/src/BlueUpdate/BlueUpdate/Update.cs b/src/BlueUpdate/BlueUpdate/Update.cs index 2fadadc..fa90f92 100644 --- a/src/BlueUpdate/BlueUpdate/Update.cs +++ b/src/BlueUpdate/BlueUpdate/Update.cs @@ -43,6 +43,11 @@ namespace BlueUpdate { public static class Update { + /// + /// For backward compatibility, include all previous company names. + /// + private static string[] GetAllPastCompanyNames() => new string[] { "Grega Mohorko" }; + /// /// Root directory of all applications. /// @@ -78,7 +83,7 @@ static Update() if(updaterFileInfo != null) { ReflectionUtility.AssemblyInformation assembly = ReflectionUtility.GetAssemblyInformation(ReflectionUtility.GetAssembly(ReflectionUtility.AssemblyType.CURRENT)); - if(updaterFileInfo.CompanyName != assembly.Company || updaterFileInfo.ProductName != BlueUpdateConstants.UPDATER_NAME) { + if((updaterFileInfo.CompanyName != assembly.Company && !GetAllPastCompanyNames().Contains(updaterFileInfo.CompanyName)) || updaterFileInfo.ProductName != BlueUpdateConstants.UPDATER_NAME) { throw new Exception("Updater executable is not legit."); } Version currentVersion = Version.Parse(updaterFileInfo.FileVersion); @@ -98,8 +103,8 @@ static Update() UpdateUtility.Update(Updater); } }catch(Exception e) { - MessageBox.Show($"Error while initializing BlueUpdate:{Environment.NewLine}{Environment.NewLine}{e.Message}"); - throw e; + _ = MessageBox.Show($"Error while initializing BlueUpdate:{Environment.NewLine}{Environment.NewLine}{e.Message}"); + throw; } }