Beispiel #1
0
        public override void Execute()
        {
            Log.Information("Extrating...");

            CabLib.Extract.kHeaderInfo k_Info;
            if (Extractor.IsFileCabinet(this.Filename, out k_Info))
            {
                Extractor.ExtractFile(this.Filename, this.SourcePath);

                string manifestFilename = Path.Combine(this.SourcePath, "manifest.xml");
                this.Manifest = FileSystem.Load <Solution>(manifestFilename);

                this.Manifest.Move(this);

                DirectorySystem.DeleteEmptyFolders(this.SourcePath);
                //Directory.Delete(this.SourcePath, true);
            }
            else
            {
                Log.Error("The file is not a valid Cabinet: " + this.Filename);
            }
        }
    public void Move(Extractwsp handler)
    {
        Log.Verbose("Moving site definition:" + this.Location);

        string sourcePath = Path.Combine(handler.SourcePath, this.Location);
        string targetPath = Path.Combine(handler.TargetPath, @"12\template\SiteTemplates\" + this.Location);

        DirectorySystem.Move(sourcePath, targetPath, handler.Overwrite);

        if (this.WebTempFile != null)
        {
            foreach (WebTempFileDefinition webTempFileDef in this.WebTempFile)
            {
                targetPath = Path.Combine(handler.TargetPath, String.Format(@"12\template\{0}", webTempFileDef.Location));
                sourcePath = Path.Combine(handler.SourcePath, webTempFileDef.Location);

                // The file may have been move previously
                if (File.Exists(sourcePath))
                {
                    FileSystem.Move(sourcePath, targetPath, handler.Overwrite);
                }
            }
        }
    }