コード例 #1
0
        private static void CreateWixFile(
            string groupId,
            string frameworkMoniker,
            string groupDirectory = null,
            string filePrefix     = null,
            GacStatus gac         = GacStatus.NotInGac)
        {
            Console.WriteLine($"Creating the {groupId} Group");

            groupDirectory = groupDirectory ?? $"{frameworkMoniker}";
            filePrefix     = filePrefix ?? $"{frameworkMoniker.Replace(".", string.Empty)}_";

            var solutionDirectory = EnvironmentHelper.GetSolutionDirectory();

            var wixProjectRoot =
                Path.Combine(
                    solutionDirectory,
                    "src",
                    "WindowsInstaller");

            var filePaths = DependencyHelpers.GetTracerBinContent(frameworkMoniker);

            var components = string.Empty;

            foreach (var filePath in filePaths)
            {
                var fileName  = Path.GetFileName(filePath);
                var component =
                    ItemTemplate
                    .Replace(FileIdPrefixTemplate, filePrefix)
                    .Replace(FrameworkMonikerTemplate, frameworkMoniker)
                    .Replace(FileNameTemplate, fileName);

                if (gac == GacStatus.NotInGac)
                {
                    component = component.Replace(@" Assembly="".net""", string.Empty);
                    component = component.Replace(Net461Condition, string.Empty);
                }
                else if (gac == GacStatus.Net45)
                {
                    component = component.Replace(Net461Property, $"NOT {Net461Property}");
                }

                components += component;
            }

            var wixFileContent =
                FileTemplate
                .Replace(ComponentGroupDirectoryTemplate, groupDirectory)
                .Replace(ComponentGroupIdTemplate, groupId)
                .Replace(ComponentListTemplate, components);

            var wixFilePath = Path.Combine(wixProjectRoot, groupId + ".wxs");

            File.WriteAllText(wixFilePath, wixFileContent, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));

            Console.WriteLine($"{groupId} Group successfully created.");
        }
コード例 #2
0
        private static void CopyNativeProfiler(string architecture)
        {
            var outputDirectory = Path.Combine(_tracerHomeDirectory, architecture);

            if (Directory.Exists(outputDirectory))
            {
                Directory.Delete(outputDirectory, recursive: true);
            }

            Directory.CreateDirectory(outputDirectory);

            var sourceFiles = DependencyHelpers.GetTracerBinContent(architecture);

            foreach (var sourceFile in sourceFiles)
            {
                var fileName        = Path.GetFileName(sourceFile);
                var destinationPath = Path.Combine(outputDirectory, fileName);
                File.Copy(sourceFile, destinationPath);
            }
        }
コード例 #3
0
        private static void CopyTargetFrameworkPrivateBin(string frameworkMoniker)
        {
            var outputDirectory = Path.Combine(_tracerHomeDirectory, frameworkMoniker);

            if (Directory.Exists(outputDirectory))
            {
                Directory.Delete(outputDirectory, recursive: true);
            }

            Directory.CreateDirectory(outputDirectory);

            var sourceFiles = DependencyHelpers.GetTracerBinContent(frameworkMoniker);

            foreach (var sourceFile in sourceFiles)
            {
                var fileName        = Path.GetFileName(sourceFile);
                var destinationPath = Path.Combine(outputDirectory, fileName);
                File.Copy(sourceFile, destinationPath);
            }
        }