Exemplo n.º 1
0
        public void CopyFreeFiles(string workingFolder, string destinationFolder)
        {
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\BVAdmin\\SetupWizard\\Eula.txt", _Writer);
            FileTools.SingleFileCopy("App\\MerchantTribeStore\\BVAdmin\\SetupWizard\\Eula-Free.txt", destinationFolder + "\\MerchantTribeStore\\BVAdmin\\SetupWizard\\Eula.txt", _Writer);

            string configFile = destinationFolder + "\\MerchantTribeStore\\Web.config";

            PackagingUpdateConfigForFree(configFile);
        }
Exemplo n.º 2
0
        private void PackageApp(string destinationFolder)
        {
            _Writer.WriteLine("Copying App Files to Output");

            List <string> foldersToIgnoreDuringCopy = new List <string>();

            foldersToIgnoreDuringCopy.Add("obj");
            foldersToIgnoreDuringCopy.Add("debug");
            foldersToIgnoreDuringCopy.Add("release-hostedstaging");
            foldersToIgnoreDuringCopy.Add("release-hostedproduction");
            foldersToIgnoreDuringCopy.Add("release-source");

            // keep bin folder off ignore list so that bin from web app is copied
            FileTools.FileCopyNoBackup("App\\MerchantTribeStore", destinationFolder + "\\MerchantTribeStore", _Writer, foldersToIgnoreDuringCopy);

            // Add bin folder so source is smaller
            foldersToIgnoreDuringCopy.Add("bin");
            FileTools.FileCopyNoBackup("App\\lib", destinationFolder + "\\lib", _Writer, foldersToIgnoreDuringCopy);
            FileTools.FileCopyNoBackup("App\\packages", destinationFolder + "\\packages", _Writer, foldersToIgnoreDuringCopy);
            FileTools.FileCopyNoBackup("App\\src", destinationFolder + "\\src", _Writer, foldersToIgnoreDuringCopy);

            FileTools.SingleFileCopy("App\\MerchantTribeStore.sln", destinationFolder + "\\MerchantTribeStore.sln", _Writer);

            // Copy Web Platform Installer Files
            _Writer.WriteLine("Copying Web Platform Installer Files");
            FileTools.SingleFileCopy("Installer\\MicrosoftWebDeploy\\Manifest.xml", destinationFolder + "\\Manifest.xml", _Writer);
            FileTools.SingleFileCopy("Installer\\MicrosoftWebDeploy\\parameters.xml", destinationFolder + "\\Parameters.xml", _Writer);
            FileTools.SingleFileCopy("App\\MerchantTribeStore\\BVAdmin\\SqlScripts\\Full\\CreateTables.sql", destinationFolder + "\\CreateTables.sql", _Writer);
            FileTools.SingleFileCopy("App\\MerchantTribeStore\\BVAdmin\\SqlScripts\\Full\\CreateProcedures.sql", destinationFolder + "\\CreateProcedures.sql", _Writer);
            FileTools.SingleFileCopy("App\\MerchantTribeStore\\BVAdmin\\SqlScripts\\Full\\PopulateData.sql", destinationFolder + "\\PopulateData.sql", _Writer);
            FileTools.SingleFileCopy("App\\MerchantTribeStore\\BVAdmin\\SqlScripts\\Full\\UserAccount.sql", destinationFolder + "\\UserAccount.sql", _Writer);

            // Create placeholder for "Sites"
            _Writer.WriteLine("Creating placeholder for sites at " + destinationFolder + "\\MerchantTribeStore\\images\\sites\\placeholder.txt");
            FileTools.CreateAndCheckDirectory(destinationFolder + "\\MerchantTribeStore\\images\\sites");
            File.WriteAllText(destinationFolder + "\\MerchantTribeStore\\images\\sites\\placeholder.txt", "This is a placeholder");

            // Clean Unwanted Files
            _Writer.WriteLine("Cleaning Unwanted Files");
            //FileTools.RemoveDirectory(destinationFolder + "\\src\\BVSoftware.AcumaticaTools", true, _Writer);
            //FileTools.RemoveDirectory(destinationFolder + "\\src\\BVSoftware.AcumaticaTools.Console", true, _Writer);
            //FileTools.RemoveDirectory(destinationFolder + "\\src\\BVSoftware.Shipping.FedEx", true, _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\Web.Debug.config", _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\Web.Release.config", _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\Web.Release-Hosted.config", _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\Web.Release-HostedStaging.config", _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\Web.Release-Source.config", _Writer);
            FileTools.RemoveFile(destinationFolder + "\\MerchantTribeStore\\MerchantTribeStore.csproj.orig", _Writer);

            _Writer.WriteLine("Updating Config Files");
            PackagingUpdateConfig(destinationFolder + "\\MerchantTribeStore\\Web.config");

            _Writer.WriteLine("Finished Packaging App");
        }
Exemplo n.º 3
0
        public void GenerateWebPiFeed(string workingFolder, string builtFileName)
        {
            _Writer.WriteLine("Genering Web PI Sample Feed File");

            string sourceFile = "Installer\\MicrosoftWebDeploy\\SampleFeed.txt";
            string outputFile = "Builds\\LatestBuildFeed.xml";
            string zipFile    = workingFolder + "\\" + builtFileName;
            string hashFile   = workingFolder + "\\" + builtFileName + ".sha1.txt";

            _Writer.WriteLine("Source Feed: " + sourceFile);
            _Writer.WriteLine("Output Feed: " + outputFile);
            _Writer.WriteLine("Zip File: " + zipFile);
            _Writer.WriteLine("Hash File: " + hashFile);

            string hash    = string.Empty;
            string zipSize = "0";

            if (File.Exists(hashFile))
            {
                string[] hashLines = File.ReadAllLines(hashFile);
                if (hashLines.Length > 0)
                {
                    hash = hashLines[0];
                    _Writer.WriteLine("Hash = " + hash);
                }
            }
            else
            {
                _Writer.WriteLine("FAIL: Missing Hash File");
            }
            if (File.Exists(zipFile))
            {
                FileInfo zipInfo = new FileInfo(zipFile);
                if (zipInfo != null)
                {
                    decimal zipSizeInKb = Math.Ceiling((zipInfo.Length / 1024m));
                    zipSize = zipSizeInKb.ToString();
                    _Writer.WriteLine("Zip Size: " + zipSize);
                }
            }
            else
            {
                _Writer.WriteLine("FAIL: Missing Zip File");
            }

            if (File.Exists(sourceFile))
            {
                string fullDir = FileTools.CurrentWorkingDirectory();
                fullDir = Path.Combine(fullDir, workingFolder);
                fullDir = Path.Combine(fullDir, builtFileName);
                string fileUrl = "file:///" + fullDir;

                string versionNumber = VersionGetFullBuildNumber();
                string appName       = "MerchantTribe " + versionNumber;

                string sourceFeedText = File.ReadAllText(sourceFile);
                sourceFeedText = sourceFeedText.Replace("!!FILESIZEINKB!!", zipSize);
                sourceFeedText = sourceFeedText.Replace("!!INSTALLERURL!!", fileUrl);
                sourceFeedText = sourceFeedText.Replace("!!SHA1!!", hash);
                sourceFeedText = sourceFeedText.Replace("!!APPNAME!!", appName);

                FileTools.RemoveFile(outputFile, _Writer);
                File.WriteAllText(outputFile, sourceFeedText);
                _Writer.WriteLine("Sample Feed written: " + outputFile);
            }
            else
            {
                _Writer.WriteLine("FAIL: Could not locate source feed file");
            }
        }