-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from micahmo/release/v1.7.4
Release/v1.7.4
- Loading branch information
Showing
18 changed files
with
549 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- Keep in sync with WS4WSetupScript.iss and VersionInfo.xml --> | ||
<AssemblyVersion>1.7.3.0</AssemblyVersion> | ||
<FileVersion>1.7.3.0</FileVersion> | ||
<InformationalVersion>1.7.3.0</InformationalVersion> | ||
<AssemblyVersion>1.7.4.0</AssemblyVersion> | ||
<FileVersion>1.7.4.0</FileVersion> | ||
<InformationalVersion>1.7.4.0</InformationalVersion> | ||
<Authors>Micah Morrison</Authors> | ||
<Product>WS4W</Product> | ||
</PropertyGroup> | ||
</Project> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This script is intended to be run from the root of the repo, like .\Installer\UpdateVersions.ps1 | ||
|
||
$newVersion = Read-Host "Enter the new version number (without 'v' and without trailing '.0')" | ||
|
||
# Directory.Build.props | ||
$directoryBuildPropsFile = Get-Content "Directory.Build.props" | ||
for ($i = 0; $i -lt $directoryBuildPropsFile.Length; $i += 1) { | ||
$line = $directoryBuildPropsFile[$i] | ||
|
||
if ($line -match "AssemblyVersion") { | ||
$directoryBuildPropsFile[$i] = " <AssemblyVersion>$($newVersion).0</AssemblyVersion>" | ||
} | ||
|
||
if ($line -match "FileVersion") { | ||
$directoryBuildPropsFile[$i] = " <FileVersion>$($newVersion).0</FileVersion>" | ||
} | ||
|
||
if ($line -match "InformationalVersion") { | ||
$directoryBuildPropsFile[$i] = " <InformationalVersion>$($newVersion).0</InformationalVersion>" | ||
} | ||
} | ||
|
||
Set-Content "Directory.Build.props" $directoryBuildPropsFile | ||
|
||
# WS4WSetupScript.iss | ||
$setupScript = Get-Content "Installer\WS4WSetupScript.iss" | ||
for ($i = 0; $i -lt $setupScript.Length; $i += 1) { | ||
$line = $setupScript[$i] | ||
|
||
if ($line -match "#define MyAppVersion") { | ||
$setupScript[$i] = "#define MyAppVersion ""$($newVersion)""" | ||
} | ||
} | ||
|
||
Set-Content "Installer\WS4WSetupScript.iss" $setupScript | ||
|
||
# VersionInfo2.xml | ||
$versionInfo = Get-Content "WireGuardServerForWindows\VersionInfo2.xml" | ||
for ($i = 0; $i -lt $versionInfo.Length; $i += 1) { | ||
$line = $versionInfo[$i] | ||
|
||
if ($line -match "<Version>") { | ||
$versionInfo[$i] = " <Version>$($newVersion).0</Version>" | ||
} | ||
|
||
if ($line -match "ReleaseDate") { | ||
$versionInfo[$i] = " <ReleaseDate>$(Get-Date -Format "yyyy-MM-dd")</ReleaseDate>" | ||
} | ||
|
||
if ($line -match "DownloadLink") { | ||
$versionInfo[$i] = " <DownloadLink>https://github.com/micahmo/WireGuardServerForWindows/releases/download/v$($newVersion)/WS4WSetup-$($newVersion).exe</DownloadLink>" | ||
} | ||
|
||
if ($line -match "DownloadFileName") { | ||
$versionInfo[$i] = " <DownloadFileName>WS4WSetup-$($newVersion).exe</DownloadFileName>" | ||
} | ||
} | ||
|
||
Set-Content "WireGuardServerForWindows\VersionInfo2.xml" $versionInfo | ||
|
||
Write-Host -ForegroundColor Red "Don't forget to update VersionNotes!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.IO; | ||
using GalaSoft.MvvmLight; | ||
using Jot; | ||
using Jot.Storage; | ||
|
||
namespace WireGuardServerForWindows.Models | ||
{ | ||
/// <summary> | ||
/// Defines application-wide settings which will be persisted across sessions | ||
/// </summary> | ||
internal class AppSettings : ObservableObject | ||
{ | ||
/// <summary> | ||
/// Singleton instance | ||
/// </summary> | ||
public static AppSettings Instance { get; } = new AppSettings(); | ||
|
||
public void Load() | ||
{ | ||
Tracker.Configure<AppSettings>() | ||
.Property(a => a.CustomServerConfigDirectory) | ||
.Property(a => a.CustomClientConfigDirectory) | ||
.Track(this); | ||
} | ||
|
||
public void Save() | ||
{ | ||
Tracker.Persist(this); | ||
} | ||
|
||
/// <summary> | ||
/// The parent directory of the server configuration files | ||
/// </summary> | ||
public string CustomServerConfigDirectory | ||
{ | ||
get => _customServerConfigDirectory; | ||
set => Set(nameof(CustomServerConfigDirectory), ref _customServerConfigDirectory, value); | ||
} | ||
private string _customServerConfigDirectory; | ||
|
||
/// <summary> | ||
/// The parent directory of the client configuration files | ||
/// </summary> | ||
public string CustomClientConfigDirectory | ||
{ | ||
get => _customClientConfigDirectory; | ||
set => Set(nameof(CustomClientConfigDirectory), ref _customClientConfigDirectory, value); | ||
} | ||
private string _customClientConfigDirectory; | ||
|
||
#region Private fields | ||
|
||
private static readonly Tracker Tracker = new Tracker(new JsonFileStore(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WS4W"))); | ||
|
||
#endregion | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
WireGuardServerForWindows/Models/ChangeClientConfigDirectorySubCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.IO; | ||
using System.Windows.Input; | ||
using Microsoft.WindowsAPICodePack.Dialogs; | ||
using WireGuardServerForWindows.Properties; | ||
|
||
namespace WireGuardServerForWindows.Models | ||
{ | ||
public class ChangeClientConfigDirectorySubCommand : PrerequisiteItem | ||
{ | ||
public ChangeClientConfigDirectorySubCommand() : base | ||
( | ||
title: string.Empty, | ||
successMessage: string.Empty, | ||
errorMessage: string.Empty, | ||
resolveText: string.Empty, | ||
configureText: Resources.ChangeClientConfigDirectoryConfigureText | ||
) | ||
{ | ||
AppSettings.Instance.PropertyChanged += (_, args) => | ||
{ | ||
if (args.PropertyName == nameof(AppSettings.Instance.CustomClientConfigDirectory)) | ||
{ | ||
RaisePropertyChanged(nameof(SuccessMessage)); | ||
} | ||
}; | ||
} | ||
|
||
#region PrerequisiteItem members | ||
|
||
public override string SuccessMessage | ||
{ | ||
get => string.Format(Resources.ChangeClientConfigDirectorySuccessMessage, ClientConfigurationsPrerequisite.ClientConfigDirectory); | ||
set { } | ||
} | ||
|
||
public override void Configure() | ||
{ | ||
using CommonOpenFileDialog commonOpenFileDialog = new CommonOpenFileDialog | ||
{ | ||
IsFolderPicker = true, | ||
InitialDirectory = ClientConfigurationsPrerequisite.ClientConfigDirectory | ||
}; | ||
|
||
if (commonOpenFileDialog.ShowDialog() == CommonFileDialogResult.Ok | ||
&& Directory.Exists(commonOpenFileDialog.FileName) | ||
&& !commonOpenFileDialog.FileName.Equals(ClientConfigurationsPrerequisite.ClientConfigDirectory, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
Mouse.OverrideCursor = Cursors.Wait; | ||
|
||
if (Directory.Exists(ClientConfigurationsPrerequisite.ClientWGDirectory)) | ||
{ | ||
Directory.Move(ClientConfigurationsPrerequisite.ClientWGDirectory, Path.Combine(commonOpenFileDialog.FileName, Path.GetFileName(ClientConfigurationsPrerequisite.ClientWGDirectory))); | ||
} | ||
|
||
if (Directory.Exists(ClientConfigurationsPrerequisite.ClientDataDirectory)) | ||
{ | ||
Directory.Move(ClientConfigurationsPrerequisite.ClientDataDirectory, Path.Combine(commonOpenFileDialog.FileName, Path.GetFileName(ClientConfigurationsPrerequisite.ClientDataDirectory))); | ||
} | ||
|
||
AppSettings.Instance.CustomClientConfigDirectory = commonOpenFileDialog.FileName; | ||
AppSettings.Instance.Save(); | ||
|
||
Mouse.OverrideCursor = null; | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
WireGuardServerForWindows/Models/ChangeServerConfigDirectorySubCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.IO; | ||
using System.Windows.Input; | ||
using Microsoft.WindowsAPICodePack.Dialogs; | ||
using WireGuardServerForWindows.Properties; | ||
|
||
namespace WireGuardServerForWindows.Models | ||
{ | ||
public class ChangeServerConfigDirectorySubCommand : PrerequisiteItem | ||
{ | ||
public ChangeServerConfigDirectorySubCommand() : base | ||
( | ||
title: string.Empty, | ||
successMessage: string.Empty, | ||
errorMessage: string.Empty, | ||
resolveText: string.Empty, | ||
configureText: Resources.ChangeServerConfigDirectoryConfigureText | ||
) | ||
{ | ||
AppSettings.Instance.PropertyChanged += (_, args) => | ||
{ | ||
if (args.PropertyName == nameof(AppSettings.Instance.CustomServerConfigDirectory)) | ||
{ | ||
RaisePropertyChanged(nameof(SuccessMessage)); | ||
} | ||
}; | ||
} | ||
|
||
#region PrerequisiteItem members | ||
|
||
public override string SuccessMessage | ||
{ | ||
get => string.Format(Resources.ChangeServerConfigDirectorySuccessMessage, ServerConfigurationPrerequisite.ServerConfigDirectory); | ||
set { } | ||
} | ||
|
||
public override void Configure() | ||
{ | ||
using CommonOpenFileDialog commonOpenFileDialog = new CommonOpenFileDialog | ||
{ | ||
IsFolderPicker = true, | ||
InitialDirectory = ServerConfigurationPrerequisite.ServerConfigDirectory | ||
}; | ||
|
||
if (commonOpenFileDialog.ShowDialog() == CommonFileDialogResult.Ok | ||
&& Directory.Exists(commonOpenFileDialog.FileName) | ||
&& !commonOpenFileDialog.FileName.Equals(ServerConfigurationPrerequisite.ServerConfigDirectory, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
Mouse.OverrideCursor = Cursors.Wait; | ||
|
||
if (Directory.Exists(ServerConfigurationPrerequisite.ServerWGDirectory)) | ||
{ | ||
Directory.Move(ServerConfigurationPrerequisite.ServerWGDirectory, Path.Combine(commonOpenFileDialog.FileName, Path.GetFileName(ServerConfigurationPrerequisite.ServerWGDirectory))); | ||
} | ||
|
||
if (Directory.Exists(ServerConfigurationPrerequisite.ServerDataDirectory)) | ||
{ | ||
Directory.Move(ServerConfigurationPrerequisite.ServerDataDirectory, Path.Combine(commonOpenFileDialog.FileName, Path.GetFileName(ServerConfigurationPrerequisite.ServerDataDirectory))); | ||
} | ||
|
||
AppSettings.Instance.CustomServerConfigDirectory = commonOpenFileDialog.FileName; | ||
AppSettings.Instance.Save(); | ||
|
||
Mouse.OverrideCursor = null; | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Oops, something went wrong.