internal static byte[] CreateEwlNuGetPackage(DevelopmentInstallation installation, bool useDebugAssembly, string outputFolderPath, bool?prerelease)
        {
            var localExportDateAndTime = prerelease.HasValue ? null as DateTime? : DateTime.Now;

            IoMethods.ExecuteWithTempFolder(folderPath => {
                var ewlOutputFolderPath = StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path,
                                                                              "Standard Library",
                                                                              StandardLibraryMethods.GetProjectOutputFolderPath(useDebugAssembly));
                var libFolderPath = StandardLibraryMethods.CombinePaths(folderPath, @"lib\net451-full");
                foreach (var fileName in new[] { "dll", "pdb", "xml" }.Select(i => "EnterpriseWebLibrary." + i))
                {
                    IoMethods.CopyFile(StandardLibraryMethods.CombinePaths(ewlOutputFolderPath, fileName), StandardLibraryMethods.CombinePaths(libFolderPath, fileName));
                }

                IoMethods.CopyFile(StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path, @"Development Utility\Package Manager Console Commands.ps1"),
                                   StandardLibraryMethods.CombinePaths(folderPath, @"tools\init.ps1"));

                var webSitePath = StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path, "Web Site");
                var webProjectFilesFolderPath = StandardLibraryMethods.CombinePaths(folderPath, AppStatics.WebProjectFilesFolderName);
                IoMethods.CopyFolder(StandardLibraryMethods.CombinePaths(webSitePath, AppStatics.EwfFolderName),
                                     StandardLibraryMethods.CombinePaths(webProjectFilesFolderPath, AppStatics.EwfFolderName),
                                     false);
                IoMethods.CopyFile(StandardLibraryMethods.CombinePaths(webSitePath, AppStatics.StandardLibraryFilesFileName),
                                   StandardLibraryMethods.CombinePaths(webProjectFilesFolderPath, AppStatics.StandardLibraryFilesFileName));

                const string duProjectAndFolderName = "Development Utility";
                IoMethods.CopyFolder(
                    StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path,
                                                        duProjectAndFolderName,
                                                        StandardLibraryMethods.GetProjectOutputFolderPath(useDebugAssembly)),
                    StandardLibraryMethods.CombinePaths(folderPath, duProjectAndFolderName),
                    false);
                packageGeneralFiles(installation, folderPath, false);
                IoMethods.CopyFolder(
                    StandardLibraryMethods.CombinePaths(installation.ExistingInstallationLogic.RuntimeConfiguration.ConfigurationFolderPath,
                                                        InstallationConfiguration.InstallationConfigurationFolderName,
                                                        InstallationConfiguration.InstallationsFolderName,
                                                        (!prerelease.HasValue || prerelease.Value ? "Testing" : "Live")),
                    StandardLibraryMethods.CombinePaths(folderPath,
                                                        InstallationConfiguration.ConfigurationFolderName,
                                                        InstallationConfiguration.InstallationConfigurationFolderName),
                    false);

                var manifestPath = StandardLibraryMethods.CombinePaths(folderPath, "Package.nuspec");
                using (var writer = IoMethods.GetTextWriterForWrite(manifestPath))
                    writeNuGetPackageManifest(installation, prerelease, localExportDateAndTime, writer);

                StatusStatics.SetStatus(StandardLibraryMethods.RunProgram(StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path, @"Solution Files\nuget"),
                                                                          "pack \"" + manifestPath + "\" -OutputDirectory \"" + outputFolderPath + "\"",
                                                                          "",
                                                                          true));
            });

            return
                (File.ReadAllBytes(StandardLibraryMethods.CombinePaths(outputFolderPath,
                                                                       EwlNuGetPackageSpecificationStatics.GetNuGetPackageFileName(installation.ExistingInstallationLogic.RuntimeConfiguration.SystemShortName,
                                                                                                                                   installation.CurrentMajorVersion,
                                                                                                                                   !prerelease.HasValue || prerelease.Value ? installation.NextBuildNumber as int? : null,
                                                                                                                                   localExportDateAndTime: localExportDateAndTime))));
        }
 private static IEnumerable <string> getAssemblyPaths(DevelopmentInstallation installation, bool debug)
 {
     return(StandardLibraryMethods.CombinePaths(installation.DevelopmentInstallationLogic.LibraryPath,
                                                StandardLibraryMethods.GetProjectOutputFolderPath(debug),
                                                installation.DevelopmentInstallationLogic.DevelopmentConfiguration.LibraryNamespaceAndAssemblyName + ".dll")
            .ToSingleElementArray()
            .Concat(from i in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.webProjects ?? new WebProject[0]
                    select StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path, i.name, "bin", i.NamespaceAndAssemblyName + ".dll"))
            .Concat(from i in installation.ExistingInstallationLogic.RuntimeConfiguration.WindowsServices
                    select
                    StandardLibraryMethods.CombinePaths(installation.ExistingInstallationLogic.GetWindowsServiceFolderPath(i, debug),
                                                        i.NamespaceAndAssemblyName + ".exe"))
            .Concat(from i in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.ServerSideConsoleProjectsNonNullable
                    select
                    StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path,
                                                        i.Name,
                                                        StandardLibraryMethods.GetProjectOutputFolderPath(debug),
                                                        i.NamespaceAndAssemblyName + ".exe"))
            .Concat(installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject != null
                                          ? StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path,
                                                                                installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name,
                                                                                StandardLibraryMethods.GetProjectOutputFolderPath(debug),
                                                                                installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.assemblyName + ".exe").ToSingleElementArray()
                                          : new string[0]));
 }
 private void packageClientSideApp(DevelopmentInstallation installation, string clientSideAppFolder)
 {
     IoMethods.CopyFolder(
         StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path,
                                             installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name,
                                             StandardLibraryMethods.GetProjectOutputFolderPath(false)),
         StandardLibraryMethods.CombinePaths(clientSideAppFolder, installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name),
         false);
 }
        public string GetWindowsServiceFolderPath(WindowsService service, bool useDebugFolderIfDevelopmentInstallation)
        {
            var path = StandardLibraryMethods.CombinePaths(generalInstallationLogic.Path, service.Name);

            if (runtimeConfiguration.InstallationType == InstallationType.Development)
            {
                path = StandardLibraryMethods.CombinePaths(path, StandardLibraryMethods.GetProjectOutputFolderPath(useDebugFolderIfDevelopmentInstallation));
            }
            return(path);
        }
 private void copyServerSideProject(DevelopmentInstallation installation, string serverSideLogicFolderPath, string project)
 {
     IoMethods.CopyFolder(
         StandardLibraryMethods.CombinePaths(installation.GeneralLogic.Path, project, StandardLibraryMethods.GetProjectOutputFolderPath(false)),
         StandardLibraryMethods.CombinePaths(serverSideLogicFolderPath, project),
         false);
 }