diff --git a/ApplicationManager.cs b/ApplicationManager.cs index 4205f25c..8401e751 100644 --- a/ApplicationManager.cs +++ b/ApplicationManager.cs @@ -99,12 +99,8 @@ public void Initialize() Settings.Default.UpgradeRequired = false; Settings.Default.Save(); } - - if (!Debugger.IsAttached) - { - AutoUpdaterHelper unused = new AutoUpdaterHelper(); - } + Logger.Debug("Syn3 Updater is Starting"); // ReSharper disable once IdentifierTypo // ReSharper disable once UnusedVariable diff --git a/Helper/AppUpdateHelper.cs b/Helper/AppUpdateHelper.cs index fdfa21e0..a1ef36af 100644 --- a/Helper/AppUpdateHelper.cs +++ b/Helper/AppUpdateHelper.cs @@ -21,8 +21,21 @@ public AutoUpdaterHelper() private static void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args) { { + string asseturl = ""; dynamic json = JsonConvert.DeserializeObject(args.RemoteData); + foreach (var asset in json.assets) + { + + string browser_download_url = asset.browser_download_url.ToString(); + if (browser_download_url.Contains(".zip")) + { + asseturl = asset.browser_download_url; + break; + } + + } if (json != null) + { args.UpdateInfo = new UpdateInfoEventArgs { ChangelogURL = Api.UpdaterChangelogURL, @@ -30,14 +43,15 @@ private static void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs a CurrentVersion = json.tag_name.ToString() .Replace("v", ""), - DownloadURL = json.assets[0] - .browser_download_url, + DownloadURL = asseturl, Error = null, InstalledVersion = null, InstallerArgs = null, IsUpdateAvailable = false, Mandatory = null }; + } + } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index aaa82943..8a2732de 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -48,5 +48,5 @@ // You can specify all the values or you can default the Build a nd Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/UI/MainWindow.xaml.cs b/UI/MainWindow.xaml.cs index a4c538b8..cfdf3788 100644 --- a/UI/MainWindow.xaml.cs +++ b/UI/MainWindow.xaml.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.Net; using System.Reflection; using System.Windows.Controls; diff --git a/UI/MainWindowViewModel.cs b/UI/MainWindowViewModel.cs index c6784943..a0ddfc9c 100644 --- a/UI/MainWindowViewModel.cs +++ b/UI/MainWindowViewModel.cs @@ -5,6 +5,7 @@ using System.Windows; using FontAwesome5; using ModernWpf; +using Syn3Updater.Helper; using Syn3Updater.Model; using Syn3Updater.Properties; using ElementTheme = SourceChord.FluentWPF.ElementTheme; @@ -61,6 +62,8 @@ public MainWindowViewModel() ApplicationManager.Instance.ShowSettingsTab += delegate { CurrentTab = "settings"; }; ApplicationManager.Instance.ShowHomeTab += delegate { CurrentTab = "home"; }; ApplicationManager.Instance.ShowUtilityTab += delegate { CurrentTab = "utility"; }; + + AutoUpdaterHelper unused = new AutoUpdaterHelper(); } #endregion