Beispiel #1
0
        private static void AddInstallerArtifactToContext(
            BuildTargetContext c,
            string artifactPrefix,
            string contextPrefix,
            string version)
        {
            var  productName  = Monikers.GetProductMoniker(c, artifactPrefix, version);
            bool linkPortable = c.BuildContext.Get <bool>("LinkPortable");

            if (linkPortable)
            {
                // If we are building portable binaries, then reflect the same in the installer binary name as well.
                productName = productName + "-portable";
            }

            var extension = CurrentPlatform.IsWindows ? ".zip" : ".tar.gz";

            c.BuildContext[contextPrefix + "CompressedFile"] = Path.Combine(Dirs.Packages, productName + extension);

            string installer = "";

            switch (CurrentPlatform.Current)
            {
            case BuildPlatform.Windows:
                if (contextPrefix.Contains("Combined"))
                {
                    installer = productName + ".exe";
                }
                else
                {
                    installer = productName + ".msi";
                }
                break;

            case BuildPlatform.OSX:
                installer = productName + ".pkg";
                break;

            case BuildPlatform.Ubuntu:
            case BuildPlatform.Debian:
                installer = productName + ".deb";
                break;

            default:
                break;
            }

            if (!string.IsNullOrEmpty(installer))
            {
                c.BuildContext[contextPrefix + "InstallerFile"] = Path.Combine(Dirs.Packages, installer);
            }
        }
Beispiel #2
0
        private static void AddInstallerArtifactToContext(
            BuildTargetContext c,
            string artifactPrefix,
            string contextPrefix,
            string version)
        {
            var productName = Monikers.GetProductMoniker(c, artifactPrefix, version);

            var extension = CurrentPlatform.IsWindows ? ".zip" : ".tar.gz";

            c.BuildContext[contextPrefix + "CompressedFile"] = Path.Combine(Dirs.Packages, productName + extension);

            string installer = "";

            switch (CurrentPlatform.Current)
            {
            case BuildPlatform.Windows:
                if (contextPrefix.Contains("Combined"))
                {
                    installer = productName + ".exe";
                }
                else
                {
                    installer = productName + ".msi";
                }
                break;

            case BuildPlatform.OSX:
                installer = productName + ".pkg";
                break;

            case BuildPlatform.Ubuntu:
            case BuildPlatform.Debian:
                installer = productName + ".deb";
                break;

            default:
                break;
            }

            if (!string.IsNullOrEmpty(installer))
            {
                c.BuildContext[contextPrefix + "InstallerFile"] = Path.Combine(Dirs.Packages, installer);
            }
        }