ZeroInstall.Commands.ProgramUtils.TryRunOtherInstance C# (CSharp) Method

TryRunOtherInstance() private static method

Tries to run a command in another instance of Zero Install deployed on this system.
There was a problem launching the target instance. The target process requires elevation.
private static TryRunOtherInstance ( [ exeName, [ args, [ handler, bool needsMachineWide ) : ExitCode?
exeName [ The name of the executable to call in the target instance.
args [ The arguments to pass to the target instance.
handler [ A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
needsMachineWide bool true if a machine-wide install location is required; false if a user-specific location will also do.
return ExitCode?
        private static ExitCode? TryRunOtherInstance([NotNull] string exeName, [NotNull] string[] args, [NotNull] ICommandHandler handler, bool needsMachineWide)
        {
            string installLocation = FindOtherInstance(needsMachineWide);
            if (installLocation == null) return null;

            Log.Warn("Redirecting to instance at " + installLocation);
            handler.DisableUI();
            return (ExitCode)ProcessUtils.Assembly(Path.Combine(installLocation, exeName), args).Run();
        }