mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-26 12:08:37 +08:00
Compare commits
4 Commits
copilot/fi
...
v1.78.2-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e23b3d76b1 | ||
|
|
31314c19f6 | ||
|
|
706b1b5659 | ||
|
|
7ec5eb8467 |
@@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="AWSSDK.Core" Version="4.0.3.15" />
|
||||
<PackageVersion Include="AWSSDK.EC2" Version="4.0.76.1" />
|
||||
<PackageVersion Include="AWSSDK.EC2" Version="4.0.77" />
|
||||
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
|
||||
<PackageVersion Include="Castle.Core" Version="5.2.1" />
|
||||
<PackageVersion Include="ConsoleControl" Version="1.3.0" />
|
||||
|
||||
@@ -64,9 +64,7 @@ namespace mRemoteNG.App
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(downloadUrl) &&
|
||||
downloadUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
||||
Process.Start(new ProcessStartInfo(fileName: downloadUrl) { UseShellExecute = true });
|
||||
Process.Start(new ProcessStartInfo(fileName: downloadUrl) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -127,6 +127,10 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
Properties.OptionsUpdatesPage.Default.UpdateProxyAuthUser = txtProxyUsername.Text;
|
||||
LegacyRijndaelCryptographyProvider cryptographyProvider = new();
|
||||
Properties.OptionsUpdatesPage.Default.UpdateProxyAuthPass = cryptographyProvider.Encrypt(txtProxyPassword.Text, Runtime.EncryptionKey);
|
||||
|
||||
// Mark that the user has explicitly configured their update preference so the
|
||||
// first-run preference prompt does not appear again.
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
|
||||
}
|
||||
|
||||
public override void LoadRegistrySettings()
|
||||
|
||||
@@ -416,6 +416,15 @@ namespace mRemoteNG.UI.Forms
|
||||
if (!CommonRegistrySettings.AllowCheckForUpdatesAutomatical) return;
|
||||
|
||||
if (Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked) return;
|
||||
|
||||
// If the user has already explicitly disabled automatic updates via settings, don't ask again
|
||||
if (!Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup)
|
||||
{
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
|
||||
Properties.OptionsUpdatesPage.Default.Save();
|
||||
return;
|
||||
}
|
||||
|
||||
string[] commandButtons =
|
||||
[
|
||||
Language.AskUpdatesCommandRecommended,
|
||||
@@ -425,16 +434,25 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
CTaskDialog.ShowTaskDialogBox(this, GeneralAppInfo.ProductName, Language.AskUpdatesMainInstruction, string.Format(Language.AskUpdatesContent, GeneralAppInfo.ProductName), "", "", "", "", string.Join(" | ", commandButtons), ETaskDialogButtons.None, ESysIcons.Question, ESysIcons.Question);
|
||||
|
||||
if (CTaskDialog.CommandButtonResult == 0 | CTaskDialog.CommandButtonResult == 1)
|
||||
if (CTaskDialog.CommandButtonResult == 0)
|
||||
{
|
||||
// Use Recommended Settings: enable automatic updates with the default frequency
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesOnStartup = true;
|
||||
if (Properties.OptionsUpdatesPage.Default.CheckForUpdatesFrequencyDays < 1)
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesFrequencyDays = 14;
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
|
||||
Properties.OptionsUpdatesPage.Default.Save();
|
||||
}
|
||||
|
||||
if (CTaskDialog.CommandButtonResult != 1) return;
|
||||
|
||||
AppWindows.Show(WindowType.Options);
|
||||
if (AppWindows.OptionsFormWindow != null)
|
||||
AppWindows.OptionsFormWindow.SetActivatedPage(Language.Updates);
|
||||
else if (CTaskDialog.CommandButtonResult == 1)
|
||||
{
|
||||
// Customize: let the user configure update settings manually, then open Options
|
||||
Properties.OptionsUpdatesPage.Default.CheckForUpdatesAsked = true;
|
||||
Properties.OptionsUpdatesPage.Default.Save();
|
||||
AppWindows.Show(WindowType.Options);
|
||||
if (AppWindows.OptionsFormWindow != null)
|
||||
AppWindows.OptionsFormWindow.SetActivatedPage(Language.Updates);
|
||||
}
|
||||
// For "Ask Later" (button 2), CheckForUpdatesAsked remains false so the dialog will show again next startup
|
||||
}
|
||||
|
||||
private async Task CheckForUpdates()
|
||||
|
||||
@@ -204,11 +204,6 @@ namespace mRemoteNG.UI.Menu
|
||||
|
||||
private static void OpenUrl(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url) ||
|
||||
(!url.StartsWith("https://", StringComparison.OrdinalIgnoreCase) &&
|
||||
!url.StartsWith("http://", StringComparison.OrdinalIgnoreCase)))
|
||||
return;
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = url,
|
||||
|
||||
@@ -99,13 +99,6 @@ namespace mRemoteNG.UI.Window
|
||||
return;
|
||||
}
|
||||
|
||||
// Only allow http/https URLs to prevent exploitation via custom URI schemes
|
||||
if (!linkUri.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase) &&
|
||||
!linkUri.Scheme.Equals("http", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = linkUri.ToString(),
|
||||
|
||||
Reference in New Issue
Block a user