You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fixing up of existing code which used these facilities - this fixes the 'You are attempting to compile on a machine that does not have a supported compiler!' UAT error on machines with really long PATH variables, and exceptions in envvars with non-ASCII characters. #codereview robert.manuszewski [CL 2572445 by Steve Robb in Main branch]
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Tools.DotNETCommon.ExecutingAssembly
|
|
{
|
|
public static class ExecutingAssembly
|
|
{
|
|
/// <summary>
|
|
/// Gets the executing assembly path (including filename).
|
|
/// This method is using Assembly.CodeBase property to properly resolve original
|
|
/// assembly path in case shadow copying is enabled.
|
|
/// </summary>
|
|
/// <returns>Absolute path to the executing assembly including the assembly filename.</returns>
|
|
public static string GetFilename()
|
|
{
|
|
return new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the executing assembly directory.
|
|
/// This method is using Assembly.CodeBase property to properly resolve original
|
|
/// assembly directory in case shadow copying is enabled.
|
|
/// </summary>
|
|
/// <returns>Absolute path to the directory containing the executing assembly.</returns>
|
|
public static string GetDirectory()
|
|
{
|
|
return Path.GetDirectoryName(GetFilename());
|
|
}
|
|
}
|
|
}
|