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:
@ -67,9 +67,9 @@ namespace DisplayMagician.Processes
|
|||||||
{
|
{
|
||||||
logger.Warn($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute, so attempting with TryExecute_Impersonate");
|
logger.Warn($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute, so attempting with TryExecute_Impersonate");
|
||||||
ImpersonationProcess impProcessCreated;
|
ImpersonationProcess impProcessCreated;
|
||||||
if (IsImpersonated())
|
//if (IsImpersonated())
|
||||||
{
|
//{
|
||||||
logger.Trace($"ProcessUtils/StartProcess: Useer CAN be impersonated, so trying to run {executable} {arguments} with TryExecute_Impersonated");
|
//logger.Trace($"ProcessUtils/StartProcess: Useer CAN be impersonated, so trying to run {executable} {arguments} with TryExecute_Impersonated");
|
||||||
if (TryExecute_Impersonated(executable, arguments, out impProcessCreated))
|
if (TryExecute_Impersonated(executable, arguments, out impProcessCreated))
|
||||||
{
|
{
|
||||||
logger.Trace($"ProcessUtils/StartProcess: {executable} {arguments} has successfully been started by TryExecute_Impersonated");
|
logger.Trace($"ProcessUtils/StartProcess: {executable} {arguments} has successfully been started by TryExecute_Impersonated");
|
||||||
@ -79,11 +79,11 @@ namespace DisplayMagician.Processes
|
|||||||
{
|
{
|
||||||
logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute_Impersonated, so giving up");
|
logger.Error($"ProcessUtils/StartProcess: {executable} {arguments} was unable to be started by TryExecute_Impersonated, so giving up");
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
else
|
//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 attempted by TryExecute_Impersonated as the User can't be impersonated, so giving up");
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processCreated != null && processCreated.Id > 0)
|
if (processCreated != null && processCreated.Id > 0)
|
||||||
|
@ -26,8 +26,8 @@ using System.Resources;
|
|||||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("2.1.0.358")]
|
[assembly: AssemblyVersion("2.1.0.361")]
|
||||||
[assembly: AssemblyFileVersion("2.1.0.358")]
|
[assembly: AssemblyFileVersion("2.1.0.361")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user