feat(autoupdate): detect install type
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using CarManagerV3.Forms;
|
||||
using CarManagerV3.Manager;
|
||||
using CarManagerV3.Util;
|
||||
|
||||
namespace CarManagerV3
|
||||
{
|
||||
@@ -65,8 +66,19 @@ namespace CarManagerV3
|
||||
{
|
||||
if (Updater.IsUpdateAvailable(Properties.Settings.Default.AllowPrerelease))
|
||||
{
|
||||
UpdatePromptForm updatePrompt = new UpdatePromptForm(Updater.GetCurrentVersion(true), Updater.GetLatestVersion(Properties.Settings.Default.AllowPrerelease));
|
||||
updatePrompt.ShowDialog();
|
||||
if (InstallModeDetector.IsInstalledViaMsi())
|
||||
{
|
||||
UpdatePromptForm updatePrompt = new UpdatePromptForm(Updater.GetCurrentVersion(true), Updater.GetLatestVersion(Properties.Settings.Default.AllowPrerelease));
|
||||
updatePrompt.ShowDialog();
|
||||
} else
|
||||
{
|
||||
DialogResult updateResult = MessageBox.Show($"A new version of Car Manager is available! \nYour Version: {Updater.GetCurrentVersion(true)} \nLatest Version: {Updater.GetLatestVersion(Properties.Settings.Default.AllowPrerelease)} \n\nDo you want to open the Git repository to download the update?", "Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||
if (updateResult == DialogResult.Yes)
|
||||
{
|
||||
Updater.OpenReleasePage(Updater.GetLatestVersion(Properties.Settings.Default.AllowPrerelease));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user