You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FLog.Info($"Showing update prompt for new version: {releaseInfo.Version}");
140
+
FLog.Info($"[{nameof(Update)}] Showing update prompt for new version: {releaseInfo.Version}");
54
141
55
-
stringmsg=Loc.Tr("VolumeControl.Dialogs.UpdatePrompt.NewVersionAvailableFormatMsg","A new version of Volume Control is available!\nDo you want to go to the releases page?\nCurrent Version: ${CURRENT_VERSION}\nLatest Version: ${LATEST_VERSION}\n\nClick 'Yes' to go to the releases page.\nClick 'No' if you don't want to update right now.\nClick 'Cancel' to disable these prompts.");
{// failed to find a release asset with the specified name
154
+
FLog.Error(
155
+
$"[{nameof(Update)}] Failed to download installer for \"{releaseInfo.Version}\"; couldn't find a release asset beginning with \"{installerAssetNameStartsWith}\"!",
156
+
$" Found assets: \"{string.Join("\", \"",releaseInfo.packet.assets.Select(a =>a.name))}\"");
Loc.Tr("VolumeControl.Dialogs.UpdatePrompt.StartFailed.Message","Failed to start the installer, but it was downloaded successfully.\nYour system permissions may not allow running applications from your downloads folder.\n\nYou will have to start the installer manually."),
172
+
Loc.Tr("VolumeControl.Dialogs.UpdatePrompt.StartFailed.Caption","Failed to Start Installer"),
173
+
MessageBoxButton.OK,
174
+
MessageBoxImage.Error);
175
+
}
176
+
}
177
+
else
178
+
{
179
+
MessageBox.Show(
180
+
Loc.Tr("VolumeControl.Dialogs.UpdatePrompt.DownloadFailed.Message","An error occurred while downloading the installer, check the log for more information."),
Copy file name to clipboardexpand all lines: VolumeControl/Localization/en.loc.json
+24-2
Original file line number
Diff line number
Diff line change
@@ -603,8 +603,30 @@
603
603
"DontShowInFutureMsg": {
604
604
"English (US/CA)": "Update prompts will not be shown in the future."
605
605
},
606
-
"NewVersionAvailableFormatMsg": {
607
-
"English (US/CA)": "A new version of Volume Control is available!\nDo you want to go to the releases page?\nCurrent Version: ${CURRENT_VERSION}\nLatest Version: ${LATEST_VERSION}\n\nClick 'Yes' to go to the releases page.\nClick 'No' if you don't want to update right now.\nClick 'Cancel' to disable these prompts."
606
+
"NewVersionAvailableMessage": {
607
+
"English (US/CA)": "A new version of Volume Control is available!\nDo you want to go to the releases page?\nCurrent Version: ${CURRENT_VERSION}\nLatest Version: ${LATEST_VERSION}"
608
+
},
609
+
"NewVersionAvailableOptions_AutoUpdate": {
610
+
"English (US/CA)": "Click 'Yes' to install the latest release.\nClick 'No' if you don't want to update right now.\nClick 'Cancel' to disable these prompts."
611
+
},
612
+
"NewVersionAvailableOptions_OpenBrowser": {
613
+
"English (US/CA)": "Click 'Yes' to go to the releases page.\nClick 'No' if you don't want to update right now.\nClick 'Cancel' to disable these prompts."
614
+
},
615
+
"DownloadFailed": {
616
+
"Caption": {
617
+
"English (US/CA)": "Download Failed"
618
+
},
619
+
"Message": {
620
+
"English (US/CA)": "An error occurred while downloading the installer, check the log for more information."
621
+
}
622
+
},
623
+
"StartFailed": {
624
+
"Caption": {
625
+
"English (US/CA)": "Failed to Start Installer"
626
+
},
627
+
"Message": {
628
+
"English (US/CA)": "Failed to start the installer, but it was downloaded successfully.\nYour system permissions may not allow running applications from your downloads folder.\n\nYou will have to start the installer manually."
Copy file name to clipboardexpand all lines: VolumeControl/Program.cs
+29-4
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,31 @@ internal static class Program
25
25
privateconststringappMutexIdentifier="VolumeControlSingleInstance";//< Don't change this without also changing the installer script (vcsetup.iss)
26
26
privatestaticMutexappMutex=null!;
27
27
privatestaticConfigSettings=null!;
28
+
/// <summary>
29
+
/// Occurs when the application failed to start.
30
+
/// </summary>
31
+
publicconstintEXITCODE_FAILED=-1;
32
+
/// <summary>
33
+
/// Occurs when the application succeeded.
34
+
/// </summary>
35
+
publicconstintEXITCODE_SUCCESS=0;
36
+
/// <summary>
37
+
/// Occurs when the application closed due to a fatal error.
38
+
/// </summary>
39
+
publicconstintEXITCODE_ERROR=1;
40
+
/// <summary>
41
+
/// Occurs when the application failed to acquire the mutex because another instance has it locked.
42
+
/// </summary>
43
+
publicconstintEXITCODE_MUTEX=2;
44
+
/// <summary>
45
+
/// Occurs when the application is restarting itself.
46
+
/// </summary>
47
+
publicconstintEXITCODE_RESTARTING=3;
48
+
/// <summary>
49
+
/// Occurs when the application launched the installer for a new version, and is shutting down to let it take over.
50
+
/// Only used in RELEASE_FORINSTALLER configuration.
51
+
/// </summary>
52
+
publicconstintEXITCODE_UPDATING=4;
28
53
#endregion Fields
29
54
30
55
#region Methods
@@ -47,7 +72,7 @@ public static int Main(string[] args)
47
72
#if DEBUG
48
73
throw;//< rethrow in DEBUG configuration
49
74
#else
50
-
return1;//< otherwise return error
75
+
returnEXITCODE_ERROR;//< otherwise return error
51
76
#endif
52
77
}
53
78
}
@@ -96,7 +121,7 @@ private static int Main_Impl(string[] args)
96
121
Console.Error.WriteLine($"Failed to acquire mutex \"{appMutexName}\" because another instance of Volume Control is using it!");
97
122
LocalizationHelper.Initialize(false,false,null);
98
123
MessageBox.Show(Loc.Tr($"VolumeControl.Dialogs.AnotherInstanceIsRunning.{(Settings.AllowMultipleDistinctInstances?"MultiInstance":"SingleInstance")}","Another instance of Volume Control is already running!").Replace("${PATH}",Settings.Location));
0 commit comments