Skip to content

Commit

Permalink
Update mutex, change minimum OS version
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Nov 23, 2024
1 parent 4e0600d commit b67d0f9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Guard.Core/Guard.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<DebugType>embedded</DebugType>
<Authors>Timo Kössler and Open Source Contributors</Authors>
<Title>Guard.Core</Title>
<Version>1.5.1</Version>
<Version>1.5.2</Version>
<Copyright>$(Authors)</Copyright>
<PackageProjectUrl>https://2faguard.app</PackageProjectUrl>
<FileVersion>$(Version)</FileVersion>
Expand Down
18 changes: 14 additions & 4 deletions Guard.Core/InstallationContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Guard.Core
using System.Security.Cryptography;
using System.Text;
using Guard.Core.Security;

namespace Guard.Core
{
public enum InstallationType
{
Expand Down Expand Up @@ -110,16 +114,22 @@ public static string GetAppEditionString()

public static string GetMutexName()
{
string prefix = "2FAGuard-";
// Used for Mutex to allow multiple users on the same machine or multiple portable installations to run at the same time
string hashContent = Environment.UserDomainName + Environment.UserName;

if (installationType == InstallationType.CLASSIC_PORTABLE)
{
return "2FAGuardPortable";
prefix = "2FAGuardPortable-";
hashContent += AppContext.BaseDirectory;
}
else if (installationType == InstallationType.MICROSOFT_STORE)
{
return "2FAGuardStore";
prefix = "2FAGuardStore-";
}

return "2FAGuard";
return prefix
+ Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(hashContent)));
}
}
}
2 changes: 1 addition & 1 deletion Guard.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Process process in Process.GetProcessesByName(
return;
}

if (Environment.OSVersion.Version.Build < 18362)
if (Environment.OSVersion.Version.Build < 17763)
{
var uiMessageBox = new Wpf.Ui.Controls.MessageBox
{
Expand Down
4 changes: 2 additions & 2 deletions Guard.WPF/Guard.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<Title>2FAGuard</Title>
<Version>1.5.1</Version>
<Version>1.5.2</Version>
<Authors>Timo Kössler and Open Source Contributors</Authors>
<Copyright>$(Authors)</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/timokoessler/2FAGuard</RepositoryUrl>
<FileVersion>$(Version)</FileVersion>
<ApplicationIcon>totp.ico</ApplicationIcon>
<AssemblyVersion>$(Version)</AssemblyVersion>
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<SignAssembly>False</SignAssembly>
<!--<PublishSingleFile>true</PublishSingleFile>-->
<SelfContained>true</SelfContained>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The secret keys, the account names and your notes are encrypted using the AEGIS-
Yes, you can export your tokens at any time. Currently you have three options: encrypted 2FAGuard backup, generic TOTP Uri list or Authenticator Pro backup. But it is also possible to export single tokens as QR codes or view the secret key.

**Which devices are supported?**
This app is only available for Windows 10 1903 and higher. For Android I recommend [Authenticator Pro](https://github.com/jamie-mh/AuthenticatorPro) that is fully compatible with 2FAGuard. It also requires the C++ Redistributable Runtimes by Microsoft to be installed, but they are usually already installed on most systems. If not, the installer will take care of it.
This app is only available for Windows 10 1903 and higher. It also requires the C++ Redistributable Runtimes by Microsoft to be installed, but they are usually already installed on most systems. If not, the installer will take care of it.

**What can I do if I lost my login data?**
If you lost your password and cannot use an additional login method like Windows Hello, you will no longer have access to your tokens. If you want to reset the app and start over, you can delete the app data. Note that this will delete all your tokens and settings. For the Windows Store version, you can delete the app data in the Windows settings under Apps -> 2FAGuard -> Advanced Options -> Reset. If you are using the classic installation, delete the directory C:\Users\%username%\AppData\Local\2FAGuard.
Expand Down
4 changes: 2 additions & 2 deletions publish/installer.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "2FAGuard"
#define MyAppVersion "1.5.1"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "Timo Kössler"
#define MyAppURL "https://2faguard.app"
#define MyAppExeName "2FAGuard.exe"
Expand Down Expand Up @@ -28,7 +28,7 @@ WizardStyle=modern
ArchitecturesAllowed=x64compatible
UninstallDisplayIcon={app}\{#MyAppExeName}
AppCopyright=Timo Kössler and Open Source Contributors
MinVersion=10.0.18362
MinVersion=10.0.17763
ShowLanguageDialog=auto
DisableReadyPage=yes
UsePreviousTasks=yes
Expand Down

0 comments on commit b67d0f9

Please sign in to comment.