Skip to content

Commit

Permalink
Ensure User Elevation on application global Settings
Browse files Browse the repository at this point in the history
Update version
  • Loading branch information
Maxhy committed May 22, 2024
1 parent f0f3622 commit b12aecd
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion KeyManager.Library.KeyGen/KeyManager.Library.KeyGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager Key Generation Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager File Key Store Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Leosac.WpfApp" Version="1.18.0">
<PackageReference Include="Leosac.WpfApp" Version="1.19.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="MaterialDesignThemes" Version="4.9.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager LCP Key Store Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Leosac.WpfApp" Version="1.18.0">
<PackageReference Include="Leosac.WpfApp" Version="1.19.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="MaterialDesignThemes" Version="4.9.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Leosac.WpfApp" Version="1.18.0">
<PackageReference Include="Leosac.WpfApp" Version="1.19.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="MaterialDesignThemes" Version="4.9.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager Plugin UI Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
2 changes: 1 addition & 1 deletion KeyManager.Library.Plugin/KeyManager.Library.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager Plugin Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
2 changes: 1 addition & 1 deletion KeyManager.Library.UI/Favorites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Favorites()
{
try
{
_settings = KMSettings.LoadFromFile(true);
_settings = KMSettings.LoadFromFile(false);
if (!string.IsNullOrEmpty(_settings?.FavoritesPath))
{
_singleton = LoadFromFile(_settings.FavoritesPath);
Expand Down
4 changes: 2 additions & 2 deletions KeyManager.Library.UI/KeyManager.Library.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager UI Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand All @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Leosac.WpfApp" Version="1.18.0" />
<PackageReference Include="Leosac.WpfApp" Version="1.19.0" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion KeyManager.Library/KeyManager.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Leosac.$(AssemblyName)</PackageId>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Title>Leosac Key Manager Core Library</Title>
<Company>Leosac SAS</Company>
<Product>Leosac Key Manager</Product>
Expand Down
8 changes: 7 additions & 1 deletion KeyManager.Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@
<Merge Id="LLAMSM" Language="1033" DiskId="1" SourceFile="$(var.LLAMSMPath)" />
</Directory>
</Directory>
</StandardDirectory>
</StandardDirectory>

<StandardDirectory Id="CommonAppDataFolder">
<Directory Id="COMMONCOMPANYFOLDER" Name="$(var.Manufacturer)">
<Directory Id="COMMONAPPLICATIONFOLDER" Name="Key Manager" />
</Directory>
</StandardDirectory>

<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
Expand Down
2 changes: 1 addition & 1 deletion KeyManager.Setup/config.wxi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Include xmlns="http:https://wixtoolset.org/schemas/v4/wxs">
<?define Manufacturer = "Leosac" ?>
<?define ProductName = "Leosac Key Manager" ?>
<?define Version = "1.16.0.0" ?>
<?define Version = "1.16.1.0" ?>
<?define AboutURL = "https://www.leosac.com" ?>
<?define SupportURL = "https://www.leosac.com" ?>
<?define UpdatesURL = "https://www.leosac.com" ?>
Expand Down
10 changes: 7 additions & 3 deletions KeyManager/KMLeosacAppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ public KMLeosacAppInfo()
ApplicationLogo = "/images/leosac_key.png";
SettingsCommand = new RelayCommand(() =>
{
var settingsWindow = new SettingsWindow();
settingsWindow.DataContext = KMSettings.LoadFromFile(false);
settingsWindow.ShowDialog();
var settings = KMSettings.LoadFromFile(false);
if (settings != null && settings.EnsureElevation())
{
var settingsWindow = new SettingsWindow();
settingsWindow.DataContext = settings;
settingsWindow.ShowDialog();
}
});
PerUserInstallation = null; // Automatic decision based on program installation
}
Expand Down
4 changes: 2 additions & 2 deletions KeyManager/KeyManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<Version>1.16.0</Version>
<Version>1.16.1</Version>
<Product>Leosac Key Manager</Product>
<Description>Key Manager for Access Control and RFID related technologies, by Leosac.</Description>
<Company>Leosac SAS</Company>
Expand All @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Leosac.WpfApp" Version="1.18.0" />
<PackageReference Include="Leosac.WpfApp" Version="1.19.0" />
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
10 changes: 9 additions & 1 deletion KeyManager/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Leosac.KeyManager.Library.UI;
using Microsoft.Win32;
using System;
using System.Windows;

namespace Leosac.KeyManager
Expand All @@ -18,7 +19,14 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
{
if (DataContext is KMSettings settings)
{
settings.SaveToFile();
try
{
settings.SaveToFile();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}

Expand Down

0 comments on commit b12aecd

Please sign in to comment.