Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions BundleManager/BundleManager.csproj.DotSettings

This file was deleted.

18 changes: 18 additions & 0 deletions BundleManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.IO;
using System.Numerics;
using System.Security.Principal;
using System.Windows.Forms;
using Microsoft.Win32;

Expand Down Expand Up @@ -39,6 +40,8 @@ public static void Main(string[] args)
fileModeForm = new MainForm();
folderModeForm = new FileView();

CheckElevation();

if (args.Length == 0)
{
bool? preferFolderMode = null;
Expand Down Expand Up @@ -111,7 +114,22 @@ public static void Main(string[] args)
}
}
}
}

public static void CheckElevation()
{
using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
{
WindowsPrincipal principal = new(identity);
if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
{
MessageBox.Show("Bundle Manager is running with standard permissions.\n"
+ "Saving may fail in write-protected locations.",
"Running non-elevated",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
}
}
}

public static void SavePreferredMode(bool useFolderMode)
Expand Down