Пример #1
0
        private static async Task <int> RunPrerequisitesInstaller()
        {
            Initialize(out Config config, out GoogleOAuthFlow.ApplicationOAuthConfiguration applicationOAuthConfiguration);
            int result = await Prerequisites.RunPrerequisitesInstaller(config.UE4Folder);

            return(result);
        }
Пример #2
0
        private static async Task <int> UpdateLocalUE4Version()
        {
            Initialize(out Config config, out GoogleOAuthFlow.ApplicationOAuthConfiguration applicationOAuthConfiguration);

            const string installedUE4VersionFile = "InstalledUE4Version.json";
            const string desiredUE4VersionFile   = "DesiredUE4Version.json";

            UE4Version installedUE4Version = ReadUE4Version(installedUE4VersionFile);
            UE4Version desiredUE4Version   = ReadUE4Version(desiredUE4VersionFile);

            if (installedUE4Version.BuildId != desiredUE4Version.BuildId)
            {
                Console.WriteLine($"Installing UE4 version {desiredUE4Version.BuildId}...");

                int result = await DownsyncWithAuthentication(config, applicationOAuthConfiguration, Path.GetFullPath(config.UE4Folder), desiredUE4Version.BuildId);

                if (result != 0)
                {
                    Console.WriteLine("Download failed.");
                    return(result);
                }
                else
                {
                    WriteUE4Version(desiredUE4Version, installedUE4VersionFile);
                    Console.WriteLine($"UE4 version {desiredUE4Version.BuildId} has been downloaded");

                    result = await Prerequisites.RunPrerequisitesInstaller(config.UE4Folder);

                    return(result);
                }
            }
            else
            {
                Console.WriteLine($"UE4 version {desiredUE4Version.BuildId} is already installed");
                return(0);
            }
        }