Ejemplo n.º 1
0
        private static void AddPackageElement(string target, Package package, PackageElement element, ReleaseFlags flags)
        {
            //Filter by framework.
            if (element.Flags.HasFlag(PackageElementFlags.FrameworkNET40) || element.Flags.HasFlag(PackageElementFlags.FrameworkNET461))
            {
                if (flags.HasFlag(ReleaseFlags.FrameworkNET40) && !element.Flags.HasFlag(PackageElementFlags.FrameworkNET40))
                {
                    return;
                }
                if (flags.HasFlag(ReleaseFlags.FrameworkNET461) && !element.Flags.HasFlag(PackageElementFlags.FrameworkNET461))
                {
                    return;
                }
            }

            //Filter by platform.
            if (element.Flags.HasFlag(PackageElementFlags.PlatformX86) || element.Flags.HasFlag(PackageElementFlags.PlatformX64))
            {
                if (flags.HasFlag(ReleaseFlags.PlatformX86) && !element.Flags.HasFlag(PackageElementFlags.PlatformX86))
                {
                    return;
                }
                if (flags.HasFlag(ReleaseFlags.PlatformX64) && !element.Flags.HasFlag(PackageElementFlags.PlatformX64))
                {
                    return;
                }
            }

            var source      = GetSource(target, package, element, flags);
            var destination = GetDestination(target, package, element, flags);

            CopyFile(source, destination, flags);
        }
Ejemplo n.º 2
0
        private static string GetSource(string target, Package package, PackageElement element, ReleaseFlags flags)
        {
            var parts = new List <string>()
            {
                "..",
                DISTRIBUTION
            };

            if (flags.HasFlag(ReleaseFlags.PlatformX86))
            {
                parts.Add(X86);
            }
            if (flags.HasFlag(ReleaseFlags.PlatformX64))
            {
                parts.Add(X64);
            }
            if (flags.HasFlag(ReleaseFlags.FrameworkNET40))
            {
                parts.Add(NET40);
            }
            if (flags.HasFlag(ReleaseFlags.FrameworkNET461))
            {
                parts.Add(NET461);
            }
            parts.Add(element.FileName);
            return(Path.Combine(parts.ToArray()));
        }
Ejemplo n.º 3
0
        private static void MakeLargeAddressAware(string fileName, ReleaseFlags flags)
        {
            var tool = default(string);

            if (flags.HasFlag(ReleaseFlags.PlatformX86))
            {
                tool = @"..\.tools\x86\editbin.exe";
            }
            else if (flags.HasFlag(ReleaseFlags.PlatformX64))
            {
                tool = @"..\.tools\x64\editbin.exe";
            }
            else
            {
                return;
            }
            var arguments = string.Format("/largeaddressaware \"{0}\"", fileName);

            Console.WriteLine("Running tool: {0} {1}", tool, arguments);
            var info = new ProcessStartInfo(tool, arguments)
            {
                CreateNoWindow         = true,
                UseShellExecute        = false,
                RedirectStandardInput  = true,
                RedirectStandardOutput = true,
                RedirectStandardError  = true
            };

            Process.Start(info).WaitForExit();
        }
Ejemplo n.º 4
0
 private static void CopyResouces(string source, string destination, ReleaseFlags flags)
 {
     if (flags.HasFlag(ReleaseFlags.L10N_FR))
     {
         CopyResouces(source, destination, L10N_FR, flags);
     }
 }
Ejemplo n.º 5
0
        private static string GetTarget(ReleaseFlags flags)
        {
            var parts = new List <string>();

            if (flags.HasFlag(ReleaseFlags.PlatformX86))
            {
                parts.Add(X86);
            }
            if (flags.HasFlag(ReleaseFlags.PlatformX64))
            {
                parts.Add(X64);
            }
            if (flags.HasFlag(ReleaseFlags.FrameworkNET40))
            {
                parts.Add(NET40);
            }
            if (flags.HasFlag(ReleaseFlags.FrameworkNET461))
            {
                parts.Add(NET461);
            }
            return(Path.Combine(parts.ToArray()));
        }