Esempio n. 1
0
        private static bool RegenerateProjectUsingSystemUVS(Lifetime lifetime, ISolution solution, UnrealHost unrealHost,
                                                            VirtualFileSystemPath uprojectFile)
        {
            if (PlatformUtil.RuntimePlatform != PlatformUtil.Platform.Windows || uprojectFile.IsNullOrEmpty())
            {
                return(false);
            }

            var programFiles = Environment.GetEnvironmentVariable("ProgramFiles(x86)");

            if (programFiles.IsNullOrEmpty())
            {
                return(false);
            }

            var programFilesPath = VirtualFileSystemPath.Parse(programFiles, solution.GetInteractionContext());

            if (!programFilesPath.ExistsDirectory)
            {
                return(false);
            }

            var pathToUnrealVersionSelector =
                programFilesPath / "Epic Games" / "Launcher" / "Engine" / "Binaries" / "Win64" / "UnrealVersionSelector.exe";

            return(RegenerateProjectUsingUVS(lifetime, unrealHost, uprojectFile, pathToUnrealVersionSelector));
        }