Exemplo n.º 1
0
        public static void BuildExeAndInstaller()
        {
            CommandLineArgs args = new CommandLineArgs();

            string[] scenes = new string[] {
                "Assets/VR-Navigation/Scenes/Intro.unity",
                "Assets/VR-Navigation/Scenes/Main.unity"
            };

            string branch = args.GetBinaryArgument("-branch");

            if (string.IsNullOrEmpty(branch))
            {
                branch = "dev/test";
            }

            const string targetDir = "Builds/Windows";

            string baseName = "VR-Wasawasa";

            string version   = args.GetBinaryArgument("-version");
            string setupName = args.GetBinaryArgument("-setupName");

            if (string.IsNullOrEmpty(setupName))
            {
                setupName = baseName + "-setup" + "-" + branch;
            }
            setupName = setupName.Replace('/', '-');

            if (!UpdateUpdaterAsset(setupName, branch))
            {
                FailIfBatchMode(args);
            }
            else
            {
                int buildNumber = PlayerBuilder.GetBuildNumber(args);
                if (!PlayerBuilder.BuildWindows64BitsExe(targetDir, exeBaseName: baseName, scenes: scenes, branch: branch, version: version, buildNumber: buildNumber))
                {
                    FailIfBatchMode(args);
                }
                else
                {
                    string sourceDir = Application.dataPath + "/../" + targetDir;
                    Debug.LogFormat("Installer sourceDir: {0}", sourceDir);
                    if (!string.IsNullOrEmpty(branch))
                    {
                        baseName += "-" + branch.Replace("/", "-");
                    }
                    if (!BuildInstaller(args, baseName, setupName, sourceDir, version, buildNumber))
                    {
                        FailIfBatchMode(args);
                    }
                }
            }
        }