You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* InternalUtils::ExecutingAssemblyLocation * InternalUtils::ExecutingAssemblyDirectory * InternalUtils::ExecutableVersion * CommandUtils::WriteToFile (one overload not used) * CommandUtils::ExeFilename * CommandUtils::ExeDirectory * CommandUtils::CurrentDirectory Added: * Tools.DotNETCommon.AssemblyUtils::ExecutableVersion [CL 2629222 by Wes Hunt in Main branch]
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
|
|
namespace Tools.DotNETCommon
|
|
{
|
|
public static class AssemblyUtils
|
|
{
|
|
/// <summary>
|
|
/// Gets the original location (path and filename) of an assembly.
|
|
/// This method is using Assembly.CodeBase property to properly resolve original
|
|
/// assembly path in case shadow copying is enabled.
|
|
/// </summary>
|
|
/// <returns>Absolute path and filename to the assembly.</returns>
|
|
public static string GetOriginalLocation(this Assembly ThisAssembly)
|
|
{
|
|
return new Uri(ThisAssembly.CodeBase).LocalPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Version info of the executable which runs this code.
|
|
/// </summary>
|
|
public static FileVersionInfo ExecutableVersion
|
|
{
|
|
get
|
|
{
|
|
return FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().GetOriginalLocation());
|
|
}
|
|
}
|
|
}
|
|
}
|