Skip to content

Commit 1e91cf7

Browse files
authored
Set version to Year.Month.Day.Path (BornToBeRoot#478)
* Update version, remove preview label * build script improved, set version to current date Co-authored-by: BornToBeRoot <BornToBeRoot@users.noreply.github.com>
1 parent 816b8b2 commit 1e91cf7

10 files changed

Lines changed: 35 additions & 24 deletions

File tree

InnoSetup.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
; Script generated by the Inno Setup Script Wizard.
1+
; Script generated by the Inno Setup Script Wizard.
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

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

Source/GlobalAssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using System.Reflection;
1+
using System.Reflection;
22

33
[assembly: AssemblyConfiguration("")]
44
[assembly: AssemblyCompany("")]
5-
[assembly: AssemblyCopyright("Copyright © 2016-2021 BornToBeRoot")]
5+
[assembly: AssemblyCopyright("Copyright © 2016-2021 BornToBeRoot")]
66
[assembly: AssemblyTrademark("")]
77
[assembly: AssemblyCulture("")]
88

9-
[assembly: AssemblyVersion("2021.2.0.0")]
10-
[assembly: AssemblyFileVersion("2022.2.0.0")]
9+
[assembly: AssemblyVersion("2021.2.15.0")]
10+
[assembly: AssemblyFileVersion("2021.2.15.0")]

Source/NETworkManager.Settings/ConfigurationInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName
1818
public string ApplicationFullName { get; set; }
1919
public string ApplicationName { get; set; }
2020
public bool IsPortable { get; set; }
21-
public bool IsPreview { get; set; }
2221
public Version OSVersion { get; set; }
2322

2423
// Everything below will be set dynamically in the application

Source/NETworkManager.Settings/ConfigurationManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ static ConfigurationManager()
1919
ApplicationFullName = Path.Combine(AssemblyManager.Current.Location, AssemblyManager.Current.Name + ".exe"),
2020
ApplicationName = AssemblyManager.Current.Name,
2121
OSVersion = System.Environment.OSVersion.Version,
22-
IsPortable = File.Exists(Path.Combine(AssemblyManager.Current.Location, $"{IsPortableFileName}.{IsPortableExtension}")),
23-
IsPreview = File.Exists(Path.Combine(AssemblyManager.Current.Location, "IsPreview.settings"))
22+
IsPortable = File.Exists(Path.Combine(AssemblyManager.Current.Location, $"{IsPortableFileName}.{IsPortableExtension}"))
2423
};
2524
}
2625
}

Source/NETworkManager.Update/Updater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void CheckOnGitHub(string userName, string projectName, Version currentVe
6868

6969
var latestVersion = new Version(client.Repository.Release.GetLatest(userName, projectName).Result.TagName);
7070

71-
// Compare versions (tag=2019.12.0, version=2019.12.0)
71+
// Compare versions (tag=2021.2.15.0, version=2021.2.15.0)
7272
if (latestVersion > currentVersion)
7373
OnUpdateAvailable(new UpdateAvailableArgs(latestVersion));
7474
else

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public MainWindow()
316316
AppearanceManager.Load();
317317

318318
// Set title
319-
Title = $"NETworkManager {AssemblyManager.Current.Version.Major}.{AssemblyManager.Current.Version.Minor}.{AssemblyManager.Current.Version.Build}";
319+
Title = $"NETworkManager {AssemblyManager.Current.Version}";
320320

321321
// NotifyIcon for autostart
322322
if (CommandLineManager.Current.Autostart && SettingsManager.Current.Autostart_StartMinimizedInTray || SettingsManager.Current.TrayIcon_AlwaysShowIcon)

Source/NETworkManager/ViewModels/AboutViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace NETworkManager.ViewModels
1414
public class AboutViewModel : ViewModelBase
1515
{
1616
#region Variables
17-
public string Version => $"{Strings.Version} {AssemblyManager.Current.Version.Major}.{AssemblyManager.Current.Version.Minor}.{AssemblyManager.Current.Version.Build}";
17+
public string Version => $"{Strings.Version} {AssemblyManager.Current.Version}";
1818

1919
private bool _isUpdateCheckRunning;
2020
public bool IsUpdateCheckRunning

Source/NETworkManager/Views/AboutView.xaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@
3939
<StackPanel Grid.Column="1" Margin="20,0,0,0">
4040
<TextBlock FontSize="32" Text="{x:Static resources:Resources.NETworkManager_ProjectName}" Style="{StaticResource HeaderTextBlock}" />
4141
<TextBlock Text="{x:Static localization:Strings.Slogan}" Style="{DynamicResource WrapTextBlock}" Margin="0,0,0,5" />
42-
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
43-
<TextBlock Text="{Binding Version}" Style="{StaticResource DefaultTextBlock}" FontWeight="Bold" VerticalAlignment="Center" />
44-
<TextBlock Text="{x:Static localization:Strings.Preview}" Style="{StaticResource DefaultTextBlock}" Padding="5" Background="{DynamicResource MahApps.Brushes.Gray8}" Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsPreview, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" VerticalAlignment="Center" Margin="5,0,0,0" />
45-
</StackPanel>
42+
<TextBlock Text="{Binding Version}" Style="{StaticResource DefaultTextBlock}" FontWeight="Bold" VerticalAlignment="Center" Margin="0,0,0,5" />
4643
<TextBlock Text="{x:Static resources:Resources.NETworkManager_License}" Style="{StaticResource LinkTextBlock}" HorizontalAlignment="Left" Margin="0,0,0,5">
4744
<TextBlock.InputBindings>
4845
<MouseBinding Command="{Binding OpenWebsiteCommand}" CommandParameter="{x:Static resources:Resources.NETworkManager_LicenseUrl}" MouseAction="LeftClick" />

build.ps1

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
$IsPreview = $false
2-
31
$BuildPath = "$PSScriptRoot\Build"
42

53
Set-Location -Path $PSScriptRoot
@@ -8,6 +6,29 @@ if (Test-Path -Path $BuildPath) {
86
Remove-Item -Path $BuildPath -Recurse -ErrorAction Stop
97
}
108

9+
$Date = Get-Date
10+
$VersionString = "$($Date.Year).$($Date.Month).$($Date.Day).0"
11+
12+
# Set assembly version
13+
$PatternVersion = '\[assembly: AssemblyVersion\("(.*)"\)\]'
14+
$PatternFileVersion = '\[assembly: AssemblyFileVersion\("(.*)"\)\]'
15+
16+
$AssemblyFile = "$PSScriptRoot\Source\GlobalAssemblyInfo.cs"
17+
18+
$AssemlbyContent = Get-Content -Path $AssemblyFile -Encoding utf8
19+
$AssemlbyContent = $AssemlbyContent -replace $PatternVersion,"[assembly: AssemblyVersion(""$($VersionString)"")]"
20+
$AssemlbyContent = $AssemlbyContent -replace $PatternFileVersion,"[assembly: AssemblyFileVersion(""$($VersionString)"")]"
21+
$AssemlbyContent | Set-Content -Path $AssemblyFile -Encoding utf8
22+
23+
# Set inno setup version
24+
$PatternSetupVersion = '#define MyAppVersion "(.*)"'
25+
26+
$InnoSetupFile = "$PSScriptRoot\InnoSetup.iss"
27+
28+
$SetupContent = Get-Content -Path $InnoSetupFile -Encoding utf8
29+
$SetupContent = $SetupContent -replace $PatternSetupVersion,"#define MyAppVersion ""$($VersionString)"""
30+
$SetupContent | Set-Content -Path $InnoSetupFile -Encoding utf8
31+
1132
# Dotnet clean, restore, build and publish
1233
dotnet clean "$PSScriptRoot\Source\NETworkManager.sln"
1334
dotnet restore "$PSScriptRoot\Source\NETworkManager.sln"
@@ -31,11 +52,6 @@ Remove-Item "$BuildPath\NETworkManager\x86" -Recurse
3152
# Cleanup .pdb files
3253
Get-ChildItem -Recurse | Where-Object {$_.Name.EndsWith(".pdb")} | Remove-Item
3354

34-
# Is preview?
35-
if ($IsPreview) {
36-
New-Item -Path "$BuildPath\NETworkManager" -Name "IsPreview.settings" -ItemType File
37-
}
38-
3955
# Archiv Build
4056
Compress-Archive -Path "$BuildPath\NETworkManager" -DestinationPath "$BuildPath\NETworkManager_$($Version)_Archiv.zip"
4157

docs/04_Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Date: **xx.xx.2021**
2121
- Profile files can be encrypted with a master password. Backup your profile files `%AppData%\NETworkManager\Profiles` or in `APPLICATIONROOT\Profiles` (portable version) before you use this feature. There may be some issues :) More infos in the [FAQ](https://borntoberoot.net/NETworkManager/FAQ){:target="_blank"}. You can review the changes and code here [#226](https://github.com/BornToBeRoot/NETworkManager/issues/226){:target="_blank"} [#464](https://github.com/BornToBeRoot/NETworkManager/pull/464){:target="_blank"}
2222
- CodeQL for automated code security analysis added
2323
- Code of conduct, security policy and contributing guidelines added [#450](https://github.com/BornToBeRoot/NETworkManager/issues/450){:target="_blank"}
24-
- Change version number to `YEAR.MONTH.DAY.PATCH`
24+
- Change version number to `YEAR.MONTH.DAY.PATCH` [#474](https://github.com/BornToBeRoot/NETworkManager/issues/474){:target="_blank"}
2525

2626
## Improvements
2727
- Move profile files reworked / improved [#226](https://github.com/BornToBeRoot/NETworkManager/issues/226){:target="_blank"} [#472](https://github.com/BornToBeRoot/NETworkManager/issues/472){:target="_blank"} [#473](https://github.com/BornToBeRoot/NETworkManager/issues/473){:target="_blank"}

0 commit comments

Comments
 (0)