mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Trying to get process to launch with UAC
Not really much luck at present, so have decided to add this functionality later.
This commit is contained in:
parent
6a9f3abc6d
commit
f6be9e04b2
@ -67,23 +67,23 @@ namespace DisplayMagician.Processes
|
||||
{
|
||||
logger.Warn($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute, so attempting with TryExecute_Impersonate");
|
||||
ImpersonationProcess impProcessCreated;
|
||||
if (IsImpersonated())
|
||||
//if (IsImpersonated())
|
||||
//{
|
||||
//logger.Trace($"ProcessUtils/StartProcess: Useer CAN be impersonated, so trying to run {executable} {arguments} with TryExecute_Impersonated");
|
||||
if (TryExecute_Impersonated(executable, arguments, out impProcessCreated))
|
||||
{
|
||||
logger.Trace($"ProcessUtils/StartProcess: Useer CAN be impersonated, so trying to run {executable} {arguments} with TryExecute_Impersonated");
|
||||
if (TryExecute_Impersonated(executable, arguments, out impProcessCreated))
|
||||
{
|
||||
logger.Trace($"ProcessUtils/StartProcess: {executable} {arguments} has successfully been started by TryExecute_Impersonated");
|
||||
processCreated = impProcessCreated;
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute_Impersonated, so giving up");
|
||||
}
|
||||
logger.Trace($"ProcessUtils/StartProcess: {executable} {arguments} has successfully been started by TryExecute_Impersonated");
|
||||
processCreated = impProcessCreated;
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be attempted by TryExecute_Impersonated as the User can't be impersonated, so giving up");
|
||||
logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute_Impersonated, so giving up");
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be attempted by TryExecute_Impersonated as the User can't be impersonated, so giving up");
|
||||
//}
|
||||
}
|
||||
|
||||
if (processCreated != null && processCreated.Id > 0)
|
||||
|
@ -26,8 +26,8 @@ using System.Resources;
|
||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||
|
||||
// Version information
|
||||
[assembly: AssemblyVersion("2.1.0.358")]
|
||||
[assembly: AssemblyFileVersion("2.1.0.358")]
|
||||
[assembly: AssemblyVersion("2.1.0.361")]
|
||||
[assembly: AssemblyFileVersion("2.1.0.361")]
|
||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user