private static void ConvertPackageRebuilding(string unpackedDir, string targetFileName, Platform sourcePlatform, Platform targetPlatform, string appId)
        {
            var data = DLCPackageData.LoadFromFolder(unpackedDir, targetPlatform, sourcePlatform);

            // Update AppID
            if (!targetPlatform.IsConsole)
            {
                data.AppId = appId;
            }

            // Build
            DLCPackageCreator.Generate(targetFileName, data, new Platform(targetPlatform.platform, GameVersion.RS2014));
        }
        /// <summary>
        /// Repacks DLCPackage Data
        /// </summary>
        /// <param name="srcPath">if provided (optional) sets the Platform to same as source file</param>
        public void WritePackage(string destPath, DLCPackageData packageData, string srcPath = "")
        {
            // if the srcPath does not exist GetPlatform returns 'None'
            // this generates an error condition so need to check platform of srcPath
            Platform platform;

            if (String.IsNullOrEmpty(srcPath))
            {
                platform = destPath.GetPlatform();
            }
            else
            {
                platform = srcPath.GetPlatform();
            }

            DLCPackageCreator.Generate(destPath, packageData, platform);
        }
Exemplo n.º 3
0
        static int Main(string[] args)
        {
            Console.WindowWidth     = 85;
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Green;

#if (DEBUG)
            // give the progie some dumby file to work on
            args = new string[] { "D:\\Temp\\Test" };
#endif

            // catch if there are no cmd line arguments
            if (args.GetLength(0) == 0)
            {
                args = new string[] { "?" }
            }
            ;
            if (args[0].Contains("?") || args[0].ToLower().Contains("help"))
            {
                Console.WriteLine(@"Rocksmith 2012 CDCL Converter DropletApp");
                Console.WriteLine(@" - Version: " + ProjectVersion());
                Console.WriteLine(@"   Copywrite (C) 2015 CST Developers");
                Console.WriteLine();
                Console.WriteLine(@" - Purpose: Converts RS2012 CDLC dat file to RS2014 CDLC psarc file");
                Console.WriteLine();
                Console.WriteLine(@" - Usage: Drag/Drop folder with *.dat files onto the console executable icon.");
                Console.Read();
                return(0);
            }

            Console.WriteLine(@"Initializing Rocksmith 2012 CDLC Converter CLI ...");
            Console.WriteLine();
            var srcDir = args[0];

            // iterate through cdlc folders and find *.dat files
            var cdlcFilesPaths = Directory.GetFiles(srcDir, "*.dat", SearchOption.AllDirectories);
            var cdlcSaveDir    = Path.Combine(Path.GetDirectoryName(cdlcFilesPaths[0]), "Converted CDLC");

            if (!Directory.Exists(cdlcSaveDir))
            {
                Directory.CreateDirectory(cdlcSaveDir);
            }

            foreach (var cdlcFilePath in cdlcFilesPaths)
            {
                // Unpack
                Console.WriteLine(@"Unpacking: " + Path.GetFileName(cdlcFilePath));
                var unpackedDirPath = Path.Combine(Path.GetDirectoryName(cdlcFilePath), String.Format("{0}_Pc", Path.GetFileNameWithoutExtension(cdlcFilePath)));
                var unpackedDest    = Path.GetDirectoryName(cdlcFilePath);

                if (Directory.Exists(unpackedDirPath))
                {
                    DirectoryExtension.SafeDelete(unpackedDirPath);
                }

                try
                {
                    Packer.Unpack(cdlcFilePath, unpackedDest, true, true);

                    // Load Package Data
                    Console.WriteLine(@"Converting RS2012 CDLC to RS2014 CDLC ...");
                    DLCPackageData info = new DLCPackageData(); // DLCPackageData specific to RS2
                    info = DLCPackageData.RS1LoadFromFolder(unpackedDirPath, new Platform(GamePlatform.Pc, GameVersion.RS2014), true);

                    // Convert Audio to Wem Format
                    info = ConvertAudio(info);

                    // Update Albmum Art
                    info = ConvertAlbumArt(cdlcFilePath, info);

                    foreach (var arr in info.Arrangements)
                    {
                        Console.WriteLine(@"Converting XML Arrangement: " + arr);
                        arr.SongFile.File = "";

                        if (arr.ArrangementType != ArrangementType.Vocal)
                        {
                            UpdateXml(arr, info);
                        }
                    }

                    // Repack
                    var cdlcVersion  = "c1"; // conversion 1
                    var cdlcFileName = GeneralExtensions.GetShortName("{0}_{1}_{2}", info.SongInfo.Artist, info.SongInfo.SongDisplayName, cdlcVersion, ConfigRepository.Instance().GetBoolean("creator_useacronyms"));
                    var cdlcSavePath = Path.Combine(cdlcSaveDir, cdlcFileName);
                    Console.WriteLine(@"Repacking as RS2014 CDLC: " + cdlcFileName + @".psarc");
                    Console.WriteLine("");
                    DLCPackageCreator.Generate(cdlcSavePath, info, new Platform(GamePlatform.Pc, GameVersion.RS2014), pnum: 1);
                    DirectoryExtension.SafeDelete(unpackedDirPath);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(@"Conversion could not be completed: " + ex.Message);
                    Console.WriteLine();
                }
            }

            Console.WriteLine();
            Console.WriteLine(@"Done Processing CDLC Folder ...");
            Console.WriteLine(@"Converted CDLC Saved To: " + cdlcSaveDir);
            Console.WriteLine(@"Remember ... CDLC Arrangements, Tones, Volumes, etc");
            Console.WriteLine(@"can be modified using the toolkit GUI, Creator tab");
            Console.WriteLine();
            Console.WriteLine(@"Press any key to continue ...");
            Console.Read();
            return(0);
        }
        static int Main(string[] args)
        {
            var arguments = DefaultArguments();
            var options   = GetOptions(arguments);

            try
            {
                options.Parse(args);
                if (arguments.ShowHelp)
                {
                    options.WriteOptionDescriptions(Console.Out);
                    return(0);
                }

                if (!arguments.Pack && !arguments.Unpack && !arguments.Build)
                {
                    ShowHelpfulError("Must especify a primary command as 'pack', 'unpack', 'build'.");
                    return(1);
                }
                if (arguments.Build && arguments.Pack ||
                    arguments.Build && arguments.Unpack ||
                    arguments.Pack && arguments.Unpack)
                {
                    ShowHelpfulError("The primary command 'build', 'pack' and 'unpack' can't be used at same time.");
                    return(1);
                }
                if (arguments.Pack || arguments.Unpack)
                {
                    if (arguments.Input == null && arguments.Input.Length <= 0)
                    {
                        ShowHelpfulError("Must specify an 'input' file or directory.");
                        return(1);
                    }
                    if (string.IsNullOrEmpty(arguments.Output))
                    {
                        ShowHelpfulError("Must specified an 'output' file or directory.");
                        return(1);
                    }
                    if ((arguments.Platform.platform == GamePlatform.None && arguments.Platform.version != GameVersion.None) ||
                        (arguments.Platform.platform != GamePlatform.None && arguments.Platform.version == GameVersion.None))
                    {
                        ShowHelpfulError("'platform' argument require 'version' and vice-versa to define platform. Use this option only if you have problem with platform auto identifier");
                        return(1);
                    }
                }

                // BUILD PACKAGE FROM TEMPLATE
                if (arguments.Build)
                {
                    if (string.IsNullOrEmpty(arguments.Template))
                    {
                        ShowHelpfulError("Must specify an 'template' argument with path of the Rocksmith DLC template (*.dlc.xml).");
                        return(1);
                    }
                    if (string.IsNullOrEmpty(arguments.Output))
                    {
                        ShowHelpfulError("Must specified an 'output' file.");
                        return(1);
                    }
                    if (arguments.Output.IsDirectory())
                    {
                        ShowHelpfulError("The 'output' argument in 'build' command must be a file.");
                        return(1);
                    }

                    try
                    {
                        Console.WriteLine("Warning: You should load and save XML with 'RocksmithToolkitGUI 2.3.0.0' or above to make sure it is still valid and compatible with this feature!");

                        DLCPackageData info       = null;
                        var            serializer = new DataContractSerializer(typeof(DLCPackageData));
                        using (var stm = new XmlTextReader(arguments.Template))
                        {
                            info = (DLCPackageData)serializer.ReadObject(stm);
                        }

                        var gameVersion = info.GameVersion;
                        FixPaths(info, arguments.Template, gameVersion);

                        if (info.Pc)
                        {
                            DLCPackageCreator.Generate(arguments.Output, info, new Platform(GamePlatform.Pc, gameVersion));
                        }
                        if (gameVersion == GameVersion.RS2014)
                        {
                            if (info.Mac)
                            {
                                DLCPackageCreator.Generate(arguments.Output, info, new Platform(GamePlatform.Mac, gameVersion));
                            }
                        }
                        if (info.XBox360)
                        {
                            DLCPackageCreator.Generate(Path.Combine(Path.GetDirectoryName(arguments.Output), Path.GetFileNameWithoutExtension(arguments.Output)), info, new Platform(GamePlatform.XBox360, gameVersion));
                        }
                        if (info.PS3)
                        {
                            DLCPackageCreator.Generate(Path.Combine(Path.GetDirectoryName(arguments.Output), Path.GetFileNameWithoutExtension(arguments.Output)), info, new Platform(GamePlatform.PS3, gameVersion));
                        }

                        Console.WriteLine("Package was generated.");
                        return(0);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(String.Format("{0}\n{1}\n{2}", "Build error!", ex.Message, ex.InnerException));
                        return(1);
                    }
                }

                // PACK A FOLDER TO A PACKAGE
                if (arguments.Pack)
                {
                    if (!arguments.Input[0].IsDirectory())
                    {
                        ShowHelpfulError("The 'input' argument in 'pack' command must be a directory.");
                        return(1);
                    }

                    var srcFiles = arguments.Input;
                    foreach (string srcFileName in srcFiles)
                    {
                        try
                        {
                            if (arguments.Platform.platform != GamePlatform.None && arguments.Platform.version != GameVersion.None)
                            {
                                Packer.Pack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), arguments.UpdateSng, arguments.Platform, arguments.UpdateManifest);
                            }
                            else
                            {
                                Packer.Pack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), arguments.UpdateSng, updateManifest: arguments.UpdateManifest);
                            }

                            Console.WriteLine("Packing is complete.");
                            return(0);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(String.Format("Packing error!\nFile: {0}\n{1}\n{2}", srcFileName, ex.Message, ex.InnerException));
                            return(1);
                        }
                    }
                }

                // UNPACK A PACKAGE FILE
                if (arguments.Unpack)
                {
                    if (!arguments.Output.IsDirectory())
                    {
                        ShowHelpfulError("The 'output' argument in 'unpack' command must be a directory.");
                        return(1);
                    }

                    var srcFiles = new List <string>();

                    foreach (var name in arguments.Input)
                    {
                        if (name.IsDirectory())
                        {
                            srcFiles.AddRange(Directory.EnumerateFiles(Path.GetFullPath(name), "*.psarc", SearchOption.AllDirectories));
                        }
                        if (File.Exists(name))
                        {
                            srcFiles.Add(name);
                        }
                    }

                    foreach (string srcFileName in srcFiles)
                    {
                        Platform platform = Packer.GetPlatform(srcFileName);
                        if (platform.platform == GamePlatform.None)
                        {
                            Console.WriteLine("Error: Platform not found or invalid 'input' file:" + srcFileName);
                            continue;
                        }

                        try
                        {
                            Packer.Unpack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), arguments.DecodeOGG, arguments.OverwriteSongXml);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(String.Format("Unpacking error!\nFile: {0}\n{1}\n{2}", srcFileName, ex.Message, ex.InnerException));
                            return(1);
                        }
                    }
                    Console.WriteLine("Unpacking is complete.");
                    return(0);
                }
            }
            catch (OptionException ex)
            {
                ShowHelpfulError(ex.Message);
                return(1);
            }

            return(0);
        }
Exemplo n.º 5
0
        static int Main(string[] args)
        {
            Console.WindowWidth     = 85;
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Green;

#if (DEBUG)
            // give the progie some dumby directory to work on for testing
            // args = new string[] { "--input=D:\\Temp\\Test", "--output=D:\\Temp" }; //, "platform=Pc", "version=RS2014" };
            args = new string[] { "D:\\Temp\\Test" };
#endif

            var      arguments = DefaultArguments();
            var      options   = GetOptions(arguments);
            string[] srcDirs   = null;
            options.Parse(args);

            try
            {
                // drag/drop a directory onto executable application
                if (arguments.Input == null && args.GetLength(0) != 0)
                {
                    try
                    {
                        if (args[0].IsDirectory())
                        {
                            srcDirs = args;
                            if (srcDirs.Length == 1)
                            {
                                srcDirs          = Directory.GetDirectories(srcDirs[0]);
                                arguments.Output = Path.GetDirectoryName(srcDirs[0]);
                            }
                            else
                            {
                                arguments.Output = Path.GetDirectoryName(args[0]);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ShowHelpfulError(ex.Message + "  Check that RootFolder structure has SubFolder(s).");
                        return(1); // failure
                    }
                }
                else // command line error checking
                {
                    if (arguments.ShowHelp || args.GetLength(0) == 0)
                    {
                        options.WriteOptionDescriptions(Console.Out);
                        Console.ReadLine();
                        return(-1); // neither success or failure
                    }

                    if (!arguments.Package)
                    {
                        ShowHelpfulError("Must specify the primary command as 'package'");
                        return(1);
                    }

                    if (arguments.Package)
                    {
                        if ((arguments.Input == null && arguments.Input.Length <= 0) || !arguments.Input[0].IsDirectory())
                        {
                            ShowHelpfulError("Must specify and 'input' directory.");
                            return(1);
                        }

                        if (string.IsNullOrEmpty(arguments.Output))
                        {
                            ShowHelpfulError("Must specify an 'output' directory.");
                            return(1);
                        }
                    }

                    if ((arguments.Platform.platform == GamePlatform.None && arguments.Platform.version != GameVersion.None) || (arguments.Platform.platform != GamePlatform.None && arguments.Platform.version == GameVersion.None))
                    {
                        ShowHelpfulError("'platform' argument requires 'version' and vice-versa to define platform.\r\nUse this option only if you have problem with platform auto identifier");
                        return(1);
                    }

                    srcDirs = arguments.Input;
                }

                Console.WriteLine(@"Initializing Package Creator CLI ...");
                Console.WriteLine("");

                var songCount = srcDirs.Length;
                for (int i = 0; i < songCount; i++)
                {
                    Console.WriteLine(@"Parsing Input Directory (" + (i + 1) + @"/" + songCount + @") for CDLC Package Data: " + Path.GetFileName(srcDirs[i]));

                    try
                    {
                        // get package data
                        DLCPackageData packageData = DLCPackageData.LoadFromFolder(srcDirs[i], arguments.Platform, arguments.Platform, false);
                        packageData.AppId = arguments.AppId;
                        packageData.ToolkitInfo.PackageVersion = arguments.Revision;
                        packageData.Name          = Path.GetFileName(srcDirs[i]).GetValidFileName();
                        packageData.Volume        = packageData.Volume == 0 ? Convert.ToInt16(arguments.Decibels) : packageData.Volume;
                        packageData.PreviewVolume = packageData.PreviewVolume == 0 ? Convert.ToInt16(arguments.Decibels) : packageData.PreviewVolume;

                        // check Album Artwork
                        if (arguments.Platform.version == GameVersion.RS2014)
                        {
                            CheckAlbumArt(srcDirs[i], packageData.Name);
                        }

                        // generate CDLC file name
                        var artist = packageData.SongInfo.ArtistSort;
                        var title  = packageData.SongInfo.SongDisplayNameSort;
                        // var destDir = Path.Combine(arguments.Output, Path.GetFileName(srcDirs[i]).GetValidName());
                        var fileName     = StringExtensions.GetValidShortFileName(artist, title, arguments.Revision.Replace(".", "_"), ConfigRepository.Instance().GetBoolean("creator_useacronyms"));
                        var destPath     = Path.Combine(arguments.Output, fileName);
                        var fullFileName = String.Format("{0}{1}.psarc", fileName, DLCPackageCreator.GetPathName(arguments.Platform)[2]);
                        Console.WriteLine(@"Packing: " + Path.GetFileName(fullFileName));
                        Console.WriteLine("");
                        // pack the data
                        DLCPackageCreator.Generate(destPath, packageData, new Platform(arguments.Platform.platform, arguments.Platform.version));
                        packageData.CleanCache();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("");
                        Console.WriteLine(String.Format("Packaging error!\nDirectory: {0}\n{1}\n{2}", srcDirs[i], ex.Message, ex.InnerException));
                        Console.ReadLine();
                    }
                }

                Console.WriteLine(@"All Finished");
                Console.WriteLine(@"Press any key to continue ...");
                Console.ReadLine();
                return(0); // success
            }
            catch (Exception ex)
            {
                ShowHelpfulError(ex.Message);
                return(1); // failure
            }
        }
        static int Main(string[] args)
        {
            try
            {
                Console.SetWindowSize(85, 40); // to prevent ioexceptions
                Console.BackgroundColor = ConsoleColor.Black;
                Console.ForegroundColor = ConsoleColor.Green;
            }
            catch { /* DO NOTHING */ }

#if (DEBUG)
            // give the progie some dumby data to work with
            args = new string[]
            {
                "-u",
                "-x",
                "-d",
                "-input=D:\\Temp\\PeppaPig_p.psarc",
                "-output=D:\\Temp",
                "-v=RS2014",
                "-c",
                "-f=Pc"
            };

            // args = new string[] {"-?"};
            Console.WriteLine("Running in Debug Mode ... help is not available");
#endif

            var arguments = DefaultArguments();
            var options   = GetOptions(arguments);

            try
            {
                options.Parse(args);
                if (arguments.ShowHelp)
                {
                    options.WriteOptionDescriptions(Console.Out);
                    Console.WriteLine("");
                    Console.WriteLine("Press any key to close window ...");
                    Console.ReadLine();
                    return(0);
                }

                if (!arguments.Pack && !arguments.Unpack && !arguments.Build)
                {
                    ShowHelpfulError("Must especify a primary command as 'pack', 'unpack', 'build'.");
                    return(1);
                }
                if (arguments.Build && arguments.Pack ||
                    arguments.Build && arguments.Unpack ||
                    arguments.Pack && arguments.Unpack)
                {
                    ShowHelpfulError("The primary command 'build', 'pack' and 'unpack' can't be used at same time.");
                    return(1);
                }
                if (arguments.Pack || arguments.Unpack)
                {
                    if (arguments.Input == null && arguments.Input.Length <= 0)
                    {
                        ShowHelpfulError("Must specify an 'input' file or directory.");
                        return(1);
                    }
                    if (string.IsNullOrEmpty(arguments.Output))
                    {
                        ShowHelpfulError("Must specified an 'output' file or directory.");
                        return(1);
                    }
                    if ((arguments.Platform.platform == GamePlatform.None && arguments.Platform.version != GameVersion.None) ||
                        (arguments.Platform.platform != GamePlatform.None && arguments.Platform.version == GameVersion.None))
                    {
                        ShowHelpfulError("'platform' argument require 'version' and vice-versa to define platform. Use this option only if you have problem with platform auto identifier");
                        return(1);
                    }
                }

                // BUILD PACKAGE FROM TEMPLATE
                if (arguments.Build)
                {
                    if (string.IsNullOrEmpty(arguments.Template))
                    {
                        ShowHelpfulError("Must specify an 'template' argument with path of the Rocksmith DLC template (*.dlc.xml).");
                        return(1);
                    }
                    if (string.IsNullOrEmpty(arguments.Output))
                    {
                        ShowHelpfulError("Must specified an 'output' file.");
                        return(1);
                    }
                    if (arguments.Output.IsDirectory())
                    {
                        ShowHelpfulError("The 'output' argument in 'build' command must be a file.");
                        return(1);
                    }

                    try
                    {
                        Console.WriteLine("Warning: You should load and save XML with 'RocksmithToolkitGUI 2.3.0.0' or above to make sure it is still valid and compatible with this feature!");

                        DLCPackageData info       = null;
                        var            serializer = new DataContractSerializer(typeof(DLCPackageData));
                        using (var stm = new XmlTextReader(arguments.Template))
                        {
                            info = (DLCPackageData)serializer.ReadObject(stm);
                        }

                        var gameVersion = info.GameVersion;
                        FixPaths(info, arguments.Template, gameVersion);

                        if (info.Pc)
                        {
                            DLCPackageCreator.Generate(arguments.Output, info, new Platform(GamePlatform.Pc, gameVersion));
                        }
                        if (gameVersion == GameVersion.RS2014)
                        {
                            if (info.Mac)
                            {
                                DLCPackageCreator.Generate(arguments.Output, info, new Platform(GamePlatform.Mac, gameVersion));
                            }
                        }
                        if (info.XBox360)
                        {
                            DLCPackageCreator.Generate(Path.Combine(Path.GetDirectoryName(arguments.Output), Path.GetFileNameWithoutExtension(arguments.Output)), info, new Platform(GamePlatform.XBox360, gameVersion));
                        }
                        if (info.PS3)
                        {
                            DLCPackageCreator.Generate(Path.Combine(Path.GetDirectoryName(arguments.Output), Path.GetFileNameWithoutExtension(arguments.Output)), info, new Platform(GamePlatform.PS3, gameVersion));
                        }

                        Console.WriteLine("Package was generated.");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(String.Format("{0}\n{1}\n{2}", "Build error!", ex.Message, ex.InnerException));
                        return(1);
                    }
                }

                // PACK A FOLDER TO A PACKAGE
                if (arguments.Pack)
                {
                    if (!arguments.Input[0].IsDirectory())
                    {
                        ShowHelpfulError("The 'input' argument in 'pack' command must be a directory.");
                        return(1);
                    }

                    var srcFiles = arguments.Input;
                    foreach (string srcFileName in srcFiles)
                    {
                        try
                        {
                            if (arguments.Platform.platform != GamePlatform.None && arguments.Platform.version != GameVersion.None)
                            {
                                Packer.Pack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), arguments.Platform, arguments.UpdateSng, arguments.UpdateManifest);
                            }
                            else
                            {
                                Packer.Pack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), null, arguments.UpdateSng, arguments.UpdateManifest);
                            }

                            Console.WriteLine("Packing is complete.");
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(String.Format("Packing error!\nFile: {0}\n{1}\n{2}", srcFileName, ex.Message, ex.InnerException));
                            return(1);
                        }
                    }
                }

                // UNPACK A PACKAGE FILE
                if (arguments.Unpack)
                {
                    if (!arguments.Output.IsDirectory())
                    {
                        ShowHelpfulError("The 'output' argument in 'unpack' command must be a directory.");
                        return(1);
                    }

                    var srcFiles = new List <string>();

                    foreach (var name in arguments.Input)
                    {
                        if (name.IsDirectory())
                        {
                            srcFiles.AddRange(Directory.EnumerateFiles(Path.GetFullPath(name), "*.psarc", SearchOption.AllDirectories));
                        }
                        if (File.Exists(name))
                        {
                            srcFiles.Add(name);
                        }
                    }

                    foreach (string srcFileName in srcFiles)
                    {
                        Console.WriteLine(String.Format("Unpacking File: {0}", srcFileName));
                        Platform platform = Packer.GetPlatform(srcFileName);
                        if (platform.platform == GamePlatform.None)
                        {
                            Console.WriteLine("Error: Platform not found or invalid 'input' file:" + srcFileName);
                            continue;
                        }

                        try
                        {
                            var unpackedDir = Packer.Unpack(Path.GetFullPath(srcFileName), Path.GetFullPath(arguments.Output), null, arguments.DecodeOGG, arguments.OverwriteSongXml);

                            // create template xml file
                            if (arguments.CreateTemplateXml)
                            {
                                Console.WriteLine(String.Format("Creating Template XML file for: '{0}'", Path.GetFileName(srcFileName)));
                                CreateTemplate(unpackedDir, platform);
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(String.Format("Unpacking error!\nFile: {0}\n{1}\n{2}", srcFileName, ex.Message, ex.InnerException));
                            return(1);
                        }
                    }

                    Console.WriteLine("Unpacking is complete.");
                }
            }
            catch (OptionException ex)
            {
                ShowHelpfulError(ex.Message);
                return(1);
            }

#if DEBUG
            Console.WriteLine("");
            Console.WriteLine("Press any key to close window ...");
            Console.ReadLine();
#endif
            return(0);
        }
Exemplo n.º 7
0
        public void WritePackage(string outputPath, DLCPackageData packageData)
        {
            Platform platform = outputPath.GetPlatform();

            DLCPackageCreator.Generate(outputPath, packageData, platform);
        }