Skip to content

Commit 1be23ab

Browse files
authored
Chore: Settings upgrade to latest version (#2036)
* Chore: Move 2023.3.7.0 to method * Chore: Suppress warning & update submodule
1 parent 7f908af commit 1be23ab

File tree

5 files changed

+31
-39
lines changed

5 files changed

+31
-39
lines changed

InnoSetup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "NETworkManager"
5-
#define MyAppVersion "2023.3.7.0"
5+
#define MyAppVersion "2023.3.13.0"
66
#define MyAppPublisher "BornToBeRoot"
77
#define MyAppURL "https://github.com/BornToBeRoot/NETworkManager/"
88
#define MyAppExeName "NETworkManager.exe"

Source/3rdparty/Dragablz

Source/GlobalAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
[assembly: AssemblyTrademark("")]
77
[assembly: AssemblyCulture("")]
88

9-
[assembly: AssemblyVersion("2023.3.7.0")]
10-
[assembly: AssemblyFileVersion("2023.3.7.0")]
9+
[assembly: AssemblyVersion("2023.3.13.0")]
10+
[assembly: AssemblyFileVersion("2023.3.13.0")]

Source/NETworkManager.Settings/SettingsManager.cs

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ public static void Upgrade(Version fromVersion, Version toVersion)
170170
{
171171
_log.Info($"Start settings upgrade from {fromVersion} to {toVersion}...");
172172

173-
// 2022.12.22.0
174-
if (fromVersion < new Version(2022, 12, 22, 0))
175-
UpgradeTo202212220();
173+
// 2022.12.20.0
174+
if (fromVersion < new Version(2022, 12, 20, 0))
175+
UpgradeTo_2022_12_20_0();
176+
177+
// 2023.3.7.0
178+
if (fromVersion < new Version(2023, 3, 7, 0))
179+
UpgradeTo_2023_3_7_0();
176180

177181
// Latest
178182
if (fromVersion < toVersion)
@@ -186,11 +190,11 @@ public static void Upgrade(Version fromVersion, Version toVersion)
186190
}
187191

188192
/// <summary>
189-
/// Method to apply changes for version 2022.12.22.0.
193+
/// Method to apply changes for version 2022.12.20.0.
190194
/// </summary>
191-
private static void UpgradeTo202212220()
195+
private static void UpgradeTo_2022_12_20_0()
192196
{
193-
_log.Info("Apply update to 2022.12.22.0...");
197+
_log.Info("Apply update to 2022.12.20.0...");
194198

195199
// Add AWS Session Manager application
196200
_log.Info("Add new app \"AWSSessionManager\"...");
@@ -215,43 +219,23 @@ private static void UpgradeTo202212220()
215219
}
216220

217221
/// <summary>
218-
/// Method to apply changes for the latest version.
222+
/// Method to apply changes for version 2023.3.7.0.
219223
/// </summary>
220-
/// <param name="version">Latest version.</param>
221-
private static void UpgradeToLatest(Version version)
224+
private static void UpgradeTo_2023_3_7_0()
222225
{
223-
_log.Info($"Apply upgrade to {version}...");
224-
226+
_log.Info("Apply update to 2023.3.7.0...");
227+
225228
// Add NTP Lookup application
226229
_log.Info($"Add new app \"SNTPLookup\"...");
227230
Current.General_ApplicationList.Add(ApplicationManager.GetList().First(x => x.Name == ApplicationName.SNTPLookup));
228231
Current.SNTPLookup_SNTPServers = new ObservableCollection<ServerConnectionInfoProfile>(SNTPServer.GetDefaultList());
229-
230-
// Update some default settings values, if necessary
231-
if (Current.IPScanner_MaxHostThreads > 1024)
232-
{
233-
_log.Info("Change \"IPScanner_Threads\" to \"1024\"...");
234-
Current.IPScanner_MaxHostThreads = 1024;
235-
}
236-
237-
if (Current.PortScanner_MaxHostThreads > 256)
238-
{
239-
_log.Info("Change \"PortScanner_HostThreads\" to \"256\"...");
240-
Current.PortScanner_MaxHostThreads = 256;
241-
}
242-
243-
if (Current.PortScanner_MaxPortThreads > 1024)
244-
{
245-
_log.Info("Change \"PortScanner_PortThreads\" to \"1024\"...");
246-
Current.PortScanner_MaxPortThreads = 1024;
247-
}
248-
232+
249233
// Add IP Scanner custom commands
250-
foreach(var customCommand in IPScannerCustomCommand.GetDefaultList())
234+
foreach (var customCommand in IPScannerCustomCommand.GetDefaultList())
251235
{
252236
var customCommandFound = Current.IPScanner_CustomCommands.FirstOrDefault(x => x.Name == customCommand.Name);
253237

254-
if(customCommandFound == null)
238+
if (customCommandFound == null)
255239
{
256240
_log.Info($"Add \"{customCommand.Name}\" to \"IPScanner_CustomCommands\"...");
257241
Current.IPScanner_CustomCommands.Add(customCommand);
@@ -280,6 +264,14 @@ private static void UpgradeToLatest(Version version)
280264
_log.Info("Init \"DNSLookup_DNSServers_v2\" with default DNS servers...");
281265
Current.DNSLookup_DNSServers_v2 = new ObservableCollection<DNSServerConnectionInfoProfile>(DNSServer.GetDefaultList());
282266
}
283-
#endregion
284267

268+
/// <summary>
269+
/// Method to apply changes for the latest version.
270+
/// </summary>
271+
/// <param name="version">Latest version.</param>
272+
private static void UpgradeToLatest(Version version)
273+
{
274+
_log.Info($"Apply upgrade to {version}...");
275+
}
276+
#endregion
285277
}

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ if(-not(Test-Path -Path $MSBuildPath -PathType Leaf))
6767
}
6868

6969
# Build with msbuild
70-
Start-Process -FilePath $MSBuildPath -ArgumentList "$PSScriptRoot\Source\NETworkManager.sln /restore /t:Clean,Build /p:Configuration=Release /p:TargetFramework=$TargetFramework /p:RuntimeIdentifier=$RuntimeIdentifier" -Wait -NoNewWindow
70+
Start-Process -FilePath $MSBuildPath -ArgumentList "$PSScriptRoot\Source\NETworkManager.sln /restore /t:Clean,Build /p:Configuration=Release /p:TargetFramework=$TargetFramework /p:RuntimeIdentifier=$RuntimeIdentifier /p:WarningLevel=0" -Wait -NoNewWindow
7171

7272
# Test if build is available
7373
if(-not(Test-Path -Path "$PSScriptRoot\Source\NETworkManager\bin\Release\$TargetFramework\$RuntimeIdentifier\NETworkManager.exe" -PathType Leaf))

0 commit comments

Comments
 (0)