public ControlInfo(XElement node)
        {
            if (node.Attribute("name") != null)
            {
                Name = node.Attribute("name").Value;
            }
            if (node.Attribute("link") != null)
            {
                Link = node.Attribute("link").Value;
            }
            if (node.Attribute("tooltip") != null)
            {
                Tooltip = node.Attribute("tooltip").Value;
            }
            if (node.Attribute("group") != null)
            {
                Group = node.Attribute("group").Value;
            }
            if (node.Attribute("status") != null)
            {
                foreach (string val in node.Attribute("status").Value.Split(','))
                {
                    switch (val)
                    {
                    case "new":
                        IsNew = true;
                        break;

                    case "popular":
                        IsPopular = true;
                        break;
                    }
                }
            }
            else
            {
                IsNew     = false;
                IsPopular = false;
            }
            if (node.Attribute("newFeatureName") != null)
            {
                NewFeatureName = node.Attribute("newFeatureName").Value;
            }
            Icon     = ControlIcons.GetControlIcon(Name, IsNew, IsPopular);
            Features = new List <FeatureInfo>();
            foreach (XElement fNode in node.Elements())
            {
                if (fNode.Name == "sample")
                {
                    SampleInfo sample = new SampleInfo(fNode);
                    Features.Add(sample);
                }
                else if (fNode.Name == "category")
                {
                    CategoryInfo category = new CategoryInfo(fNode);
                    if (category.Samples.Count > 0)
                    {
                        Features.Add(category);
                    }
                }
            }
        }
Esempio n. 2
0
        private void Button_BuildNSP_Click(object sender, RoutedEventArgs e)
        {
            string imp      = Box_ImportantHTML.Text;
            string ipn      = Box_IPNoticesHTML.Text;
            string sup      = Box_SupportHTML.Text;
            bool   hasimp   = !string.IsNullOrEmpty(imp);
            bool   hasipn   = !string.IsNullOrEmpty(ipn);
            bool   hassup   = !string.IsNullOrEmpty(sup);
            bool   haslinfo = (hasimp || hasipn || hassup);

            if (haslinfo)
            {
                if (hasimp)
                {
                    if (!Directory.Exists(imp))
                    {
                        GUI.Resources.log("Important HTML directory does not exist.");
                        return;
                    }
                    if (Directory.GetFileSystemEntries(imp).Length is 0)
                    {
                        GUI.Resources.log("Important HTML directory is empty.");
                        return;
                    }
                }

                if (hasipn)
                {
                    if (!Directory.Exists(ipn))
                    {
                        GUI.Resources.log("IPNotices HTML directory does not exist.");
                        return;
                    }
                    if (Directory.GetFileSystemEntries(ipn).Length is 0)
                    {
                        GUI.Resources.log("IPNotices HTML directory is empty.");
                        return;
                    }
                }

                if (hassup)
                {
                    if (!Directory.Exists(sup))
                    {
                        GUI.Resources.log("Support HTML directory does not exist.");
                        return;
                    }
                    if (Directory.GetFileSystemEntries(sup).Length is 0)
                    {
                        GUI.Resources.log("Support HTML directory is empty.");
                        return;
                    }
                }
            }
            string tid = Box_TitleID.Text;

            if (tid.Length != 16)
            {
                GUI.Resources.log("Title ID doesn't have 16 characters.");
                return;
            }
            if (!Regex.IsMatch(tid, @"\A\b[0-9a-fA-F]+\b\Z"))
            {
                GUI.Resources.log("Title ID is not a valid hex string.");
                return;
            }
            byte   keygen = 5;
            string kgen   = Combo_KeyGen.Text;

            if (kgen is "1 (1.0.0 - 2.3.0)")
            {
                keygen = 1;
            }
            else if (kgen is "2 (3.0.0)")
            {
                keygen = 2;
            }
            else if (kgen is "3 (3.0.1 - 3.0.2)")
            {
                keygen = 3;
            }
            else if (kgen is "4 (4.0.0 - 4.1.0)")
            {
                keygen = 4;
            }
            else if (kgen is "5 (5.0.0 - 5.1.0)")
            {
                keygen = 5;
            }
            else if (kgen is "6 (6.0.0 - Latest)")
            {
                keygen = 6;
            }
            if (string.IsNullOrEmpty(Box_Name.Text))
            {
                GUI.Resources.log("No application name was set.");
                return;
            }
            if (string.IsNullOrEmpty(Box_Version.Text))
            {
                GUI.Resources.log("No application version string was set.");
                return;
            }
            string ccwd  = Utils.Cwd;
            string exefs = null;
            string romfs = null;
            string logo  = null;
            string off   = null;

            if (string.IsNullOrEmpty(Box_ExeFS.Text))
            {
                GUI.Resources.log("ExeFS directory was not selected.");
                return;
            }
            if (!Directory.Exists(Box_ExeFS.Text))
            {
                GUI.Resources.log("ExeFS directory does not exist.");
                return;
            }
            exefs = Box_ExeFS.Text;
            if (!string.IsNullOrEmpty(Box_RomFS.Text))
            {
                if (!Directory.Exists(Box_RomFS.Text))
                {
                    GUI.Resources.log("RomFS directory does not exist.");
                    return;
                }
                romfs = Box_RomFS.Text;
            }
            if (!string.IsNullOrEmpty(Box_CustomLogo.Text))
            {
                if (!Directory.Exists(Box_CustomLogo.Text))
                {
                    GUI.Resources.log("Custom logo directory does not exist.");
                    return;
                }
                if (!File.Exists(Box_CustomLogo.Text + "\\NintendoLogo.png"))
                {
                    GUI.Resources.log("NintendoLogo.png logo file does not exist in custom logo's directory.");
                    return;
                }
                if (!File.Exists(Box_CustomLogo.Text + "\\StartupMovie.gif"))
                {
                    GUI.Resources.log("StartupMovie.giflogo file does not exist in custom logo's directory.");
                    return;
                }
                if (Directory.GetFileSystemEntries(Box_CustomLogo.Text).Length > 2)
                {
                    GUI.Resources.log("There are too many files or directories in custom logo directory.");
                    return;
                }
                logo = Box_CustomLogo.Text;
            }
            bool hasoff = !string.IsNullOrEmpty(Box_OfflineHTML.Text);

            if (hasoff)
            {
                if (!Directory.Exists(Box_OfflineHTML.Text))
                {
                    GUI.Resources.log("Offline HTML directory does not exist.");
                    return;
                }
                off = Box_OfflineHTML.Text;
            }
            if (string.IsNullOrEmpty(Box_KeySet.Text))
            {
                GUI.Resources.log("Keyset file was not selected. This file is required to build the NSP package.");
                return;
            }
            if (!File.Exists(Box_KeySet.Text))
            {
                GUI.Resources.log("Keyset file does not exist. This file is required to build the NSP package.");
                return;
            }
            string kset   = Box_KeySet.Text;
            bool   screen = Utils.nullableBoolValue(Check_AllowScreenshots.IsChecked);
            bool   video  = Utils.nullableBoolValue(Check_AllowVideo.IsChecked);
            byte   user   = Convert.ToByte(Utils.nullableBoolValue(Check_UserAccount.IsChecked));

            GUI.Resources.CurrentApp         = new NSP(kset);
            GUI.Resources.CurrentApp.TitleID = tid;
            NCA program = new NCA(kset);

            program.TitleID       = tid;
            program.KeyGeneration = keygen;
            program.Type          = NCAType.Program;
            program.ExeFS         = exefs;
            program.RomFS         = romfs;
            program.Logo          = logo;
            GUI.Resources.CurrentApp.Contents.Add(program);
            NCA control = new NCA(kset);

            control.TitleID       = tid;
            control.KeyGeneration = keygen;
            control.Type          = NCAType.Control;
            NACP      controlnacp = new NACP();
            NACPEntry ent         = new NACPEntry();

            ent.Name                       = Box_Name.Text;
            ent.Author                     = Box_Author.Text;
            controlnacp.Screenshot         = screen;
            controlnacp.VideoCapture       = video;
            controlnacp.StartupUserAccount = user;
            controlnacp.ProductCode        = Box_ProductCode.Text;
            controlnacp.ApplicationId      = tid;
            controlnacp.Version            = Box_Version.Text;
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\control");
            controlnacp.generate(HacPack.Utils.TemporaryDirectory + "\\control");
            ControlIcons.generate(logopath, HacPack.Utils.TemporaryDirectory + "\\control");
            control.RomFS = HacPack.Utils.TemporaryDirectory + "\\control";
            GUI.Resources.CurrentApp.Contents.Add(control);
            if (haslinfo)
            {
                NCA linfo = new NCA(kset);
                linfo.TitleID       = tid;
                linfo.KeyGeneration = keygen;
                linfo.Type          = NCAType.LegalInformation;
                if (Directory.Exists(HacPack.Utils.TemporaryDirectory + "\\legalinfo"))
                {
                    Directory.Delete(HacPack.Utils.TemporaryDirectory + "\\legalinfo", true);
                }
                Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\legalinfo");
                if (hasimp)
                {
                    FileSystem.CopyDirectory(imp, HacPack.Utils.TemporaryDirectory + "\\legalinfo\\important.htdocs");
                }
                if (hasipn)
                {
                    FileSystem.CopyDirectory(ipn, HacPack.Utils.TemporaryDirectory + "\\legalinfo\\ipnotices.htdocs");
                }
                if (hassup)
                {
                    FileSystem.CopyDirectory(sup, HacPack.Utils.TemporaryDirectory + "\\legalinfo\\support.htdocs");
                }
                linfo.RomFS = HacPack.Utils.TemporaryDirectory + "\\legalinfo";
                GUI.Resources.CurrentApp.Contents.Add(linfo);
            }
            if (hasoff)
            {
                NCA noff = new NCA(kset);
                noff.TitleID       = tid;
                noff.KeyGeneration = keygen;
                noff.Type          = NCAType.OfflineHTML;
                if (Directory.Exists(HacPack.Utils.TemporaryDirectory + "\\offline"))
                {
                    Directory.Delete(HacPack.Utils.TemporaryDirectory + "\\offline", true);
                }
                Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\offline");
                Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\offline\\html-document");
                Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\offline\\html-document\\main.htdocs");
                FileSystem.CopyDirectory(off, HacPack.Utils.TemporaryDirectory + "\\offline\\html-document\\main.htdocs");
                noff.RomFS = HacPack.Utils.TemporaryDirectory + "\\offline";
                GUI.Resources.CurrentApp.Contents.Add(noff);
            }
            SaveFileDialog nsp = new SaveFileDialog()
            {
                Title            = "Build an installable NSP package",
                Filter           = "Nintendo Submission Package (*.nsp)|*.nsp",
                AddExtension     = true,
                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
            };
            DialogResult res = nsp.ShowDialog();

            if (res is DialogResult.OK)
            {
                string outnsp = nsp.FileName;
                GUI.Resources.CurrentApp.generate(outnsp);
                if (File.Exists(outnsp))
                {
                    long nspsize = new FileInfo(outnsp).Length;
                    if (nspsize is 0)
                    {
                        GUI.Resources.log("The build failed. The built NSP seems to be empty.");
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("The NSP was successfully built:\n" + outnsp + " (" + Utils.formattedSize(nspsize) + ")", GUI.Resources.Program + " - Build succeeded!");
                    }
                }
                else
                {
                    GUI.Resources.log("The build failed. The built NSP does not exist.");
                }
            }
        }
Esempio n. 3
0
        private void Button_BuildControl_Click(object sender, RoutedEventArgs e)
        {
            string tid = Box_TitleID.Text;

            if (tid.Length != 16)
            {
                GUI.Resources.log("Title ID doesn't have 16 characters.");
                return;
            }
            if (!Regex.IsMatch(tid, @"\A\b[0-9a-fA-F]+\b\Z"))
            {
                GUI.Resources.log("Title ID is not a valid hex string.");
                return;
            }
            byte   keygen = 5;
            string kgen   = Combo_KeyGen.Text;

            if (kgen is "1 (1.0.0 - 2.3.0)")
            {
                keygen = 1;
            }
            else if (kgen is "2 (3.0.0)")
            {
                keygen = 2;
            }
            else if (kgen is "3 (3.0.1 - 3.0.2)")
            {
                keygen = 3;
            }
            else if (kgen is "4 (4.0.0 - 4.1.0)")
            {
                keygen = 4;
            }
            else if (kgen is "5 (5.0.0 - 5.1.0)")
            {
                keygen = 5;
            }
            else if (kgen is "6 (6.0.0 - 6.0.1)")
            {
                keygen = 6;
            }
            else if (kgen is "7 (6.2.0 - 6.2.0)")
            {
                keygen = 7;
            }
            else if (kgen is "8 (7.0.0 - 8.0.1)")
            {
                keygen = 8;
            }
            string ccwd = Utils.Cwd;

            if (string.IsNullOrEmpty(Box_KeySet.Text))
            {
                GUI.Resources.log("Keyset file was not selected. This file is required to build the NSP package.");
                return;
            }
            if (!File.Exists(Box_KeySet.Text))
            {
                GUI.Resources.log("Keyset file does not exist. This file is required to build the NSP package.");
                return;
            }
            if (string.IsNullOrEmpty(Box_Name.Text))
            {
                GUI.Resources.log("No application name was set.");
                return;
            }
            if (string.IsNullOrEmpty(Box_Version.Text))
            {
                GUI.Resources.log("No application version string was set.");
                return;
            }
            if (string.IsNullOrEmpty(Box_ProductCode.Text))
            {
                GUI.Resources.log("No application product code string was set.\nRetail games use 'LA-H-XXXXX' (SMO uses LA-H-AAACA)");
                return;
            }
            string kset    = Box_KeySet.Text;
            bool   screen  = Utils.nullableBoolValue(Check_AllowScreenshots.IsChecked);
            bool   video   = Utils.nullableBoolValue(Check_AllowVideo.IsChecked);
            byte   user    = Convert.ToByte(Utils.nullableBoolValue(Check_UserAccount.IsChecked));
            NCA    control = new NCA(kset);

            control.TitleID       = tid;
            control.KeyGeneration = keygen;
            control.Type          = NCAType.Control;
            NACP      controlnacp = new NACP();
            NACPEntry ent         = new NACPEntry();

            ent.Name                       = Box_Name.Text;
            ent.Author                     = Box_Author.Text;
            controlnacp.Screenshot         = screen;
            controlnacp.VideoCapture       = video;
            controlnacp.StartupUserAccount = user;
            controlnacp.ProductCode        = Box_ProductCode.Text;
            controlnacp.ApplicationId      = tid;
            controlnacp.Version            = Box_Version.Text;
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            controlnacp.Entries.Add(ent);
            Directory.CreateDirectory(HacPack.Utils.TemporaryDirectory + "\\control");
            controlnacp.generate(HacPack.Utils.TemporaryDirectory + "\\control");
            ControlIcons.generate(logopath, HacPack.Utils.TemporaryDirectory + "\\control");
            control.RomFS = HacPack.Utils.TemporaryDirectory + "\\control";
            FolderBrowserDialog cnca = new FolderBrowserDialog()
            {
                Description         = "Select directory to save control NCA content (will create a 'Control' directory)",
                ShowNewFolderButton = true,
            };
            DialogResult res = cnca.ShowDialog();

            if (res is DialogResult.OK)
            {
                string outnca = cnca.SelectedPath + "\\Control";
                if (!Directory.Exists(outnca))
                {
                    Directory.CreateDirectory(outnca);
                }
                control.generate(outnca);
                if (Directory.Exists(outnca))
                {
                    string[] files = Directory.GetFiles(outnca);
                    if (files.Length <= 0)
                    {
                        GUI.Resources.log("The build failed. No NCA was generated.");
                    }
                    bool ncafound = false;
                    foreach (string file in files)
                    {
                        if (file.ToLower().EndsWith("nca"))
                        {
                            long size = new FileInfo(file).Length;
                            GUI.Resources.log("The build succeeded: \n" + file + "\nFile size: " + Utils.formattedSize(size), LogType.Information);
                            ncafound = true;
                            Directory.Delete(HacPack.Utils.TemporaryDirectory + "\\control", true);
                            break;
                        }
                    }
                    if (!ncafound)
                    {
                        GUI.Resources.log("The build failed. No NCA was generated.");
                    }
                }
                else
                {
                    GUI.Resources.log("The build failed. The NCA's directory does not exist.");
                }
            }
        }
Esempio n. 4
0
        private void Button_BuildNSP_Click(object sender, RoutedEventArgs e)
        {
            string appid = Box_ApplicationId.Text;

            if (string.IsNullOrEmpty(appid))
            {
                Log("No application Id was set.");
                return;
            }
            else if (appid.Length != 16)
            {
                Log("Application Id is not 16 characters long.");
                return;
            }
            else if (!Regex.IsMatch(appid, @"\A\b[0-9a-fA-F]+\b\Z"))
            {
                Log("Application Id is not a valid hexadecimal string.");
                return;
            }
            byte   keygen = 5;
            string kgen   = Combo_KeyGen.Text;

            if (kgen is "1 (1.0.0 - 2.3.0)")
            {
                keygen = 1;
            }
            else if (kgen is "2 (3.0.0)")
            {
                keygen = 2;
            }
            else if (kgen is "3 (3.0.1 - 3.0.2)")
            {
                keygen = 3;
            }
            else if (kgen is "4 (4.0.0 - 4.1.0)")
            {
                keygen = 4;
            }
            else if (kgen is "5 (5.0.0 - 5.1.0)")
            {
                keygen = 5;
            }
            else if (kgen is "6 (6.0.0 - Latest)")
            {
                keygen = 6;
            }
            if (string.IsNullOrEmpty(Box_Name.Text))
            {
                Log("No application name was set.");
                return;
            }
            if (string.IsNullOrEmpty(Box_Version.Text))
            {
                Log("No application version string was set.");
                return;
            }
            if (string.IsNullOrEmpty(Box_ProductCode.Text))
            {
                Log("No product code was set.");
                return;
            }
            bool screen = (Check_AllowScreenshots.IsChecked.HasValue) ? false : Check_AllowScreenshots.IsChecked.Value;
            bool video  = (Check_AllowVideo.IsChecked.HasValue) ? false : Check_AllowVideo.IsChecked.Value;
            byte user   = Convert.ToByte((Check_UserAccount.IsChecked.HasValue) ? false : Check_UserAccount.IsChecked.Value);

            byte[] bappid = StringToByteArray(appid);
            Array.Reverse(bappid, 0, bappid.Length);
            byte[] npdm       = Properties.Resources.main;
            int    aci0offset = 0;

            for (int i = 0; i < npdm.Length; i++)
            {
                char   c1  = Convert.ToChar(npdm[i]);
                char   c2  = Convert.ToChar(npdm[i + 1]);
                char   c3  = Convert.ToChar(npdm[i + 2]);
                char   c4  = Convert.ToChar(npdm[i + 3]);
                string str = new string(new char[] { c1, c2, c3, c4 });
                if (str == "ACI0")
                {
                    aci0offset = i;
                    break;
                }
            }
            int appidoffset = aci0offset + 0x10;

            byte[] rappid = ReverseApplicationId(appid);
            foreach (byte rb in rappid)
            {
                npdm[appidoffset] = rb;
                appidoffset++;
            }
            if (Directory.Exists(Brew.Pack.Utils.TemporaryDirectory + "\\gen"))
            {
                Directory.Delete(Brew.Pack.Utils.TemporaryDirectory + "\\gen", true);
            }
            Directory.CreateDirectory(Brew.Pack.Utils.TemporaryDirectory + "\\gen");
            Directory.CreateDirectory(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\exefs");
            Directory.CreateDirectory(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\romfs");
            File.WriteAllBytes(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\exefs\\main", Properties.Resources.Packager);
            File.WriteAllBytes(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\exefs\\main.npdm", npdm);
            FileSystem.CopyDirectory(Box_SourcePath.Text, Brew.Pack.Utils.TemporaryDirectory + "\\gen\\romfs");
            Directory.CreateDirectory(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\out");
            NACP          n  = new NACP();
            LanguageEntry en = new LanguageEntry();

            en.Name              = Box_Name.Text;
            en.Author            = Box_Author.Text;
            n.Version            = Box_Version.Text;
            n.ApplicationId      = appid;
            n.Screenshot         = screen;
            n.VideoCapture       = video;
            n.StartupUserAccount = user;
            n.ProductCode        = Box_ProductCode.Text;
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            n.Entries.Add(en);
            Directory.CreateDirectory(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\control");
            ControlIcons.Save(logopath, Brew.Pack.Utils.TemporaryDirectory + "\\gen\\control");
            n.Save(Brew.Pack.Utils.TemporaryDirectory + "\\gen\\control");
            string cmd = "-k \"" + Box_KeySet.Text + "\"";

            cmd += " --exefsdir=\"" + Brew.Pack.Utils.TemporaryDirectory + "\\gen\\exefs\"";
            cmd += " --romfsdir=\"" + Brew.Pack.Utils.TemporaryDirectory + "\\gen\\romfs\"";
            cmd += " --controldir=\"" + Brew.Pack.Utils.TemporaryDirectory + "\\gen\\control\"";
            cmd += " --nologo";
            cmd += " --keygeneration=" + keygen.ToString();
            cmd += " --tempdir=\"" + Brew.Pack.Utils.TemporaryDirectory + "\\bin\\temp\"";
            cmd += " --nspdir=\"" + Brew.Pack.Utils.TemporaryDirectory + "\\out\"";
            SaveFileDialog nsp = new SaveFileDialog()
            {
                Title            = "Package as an installable NSP package",
                Filter           = "Nintendo Submission Package (*.nsp)|*.nsp",
                AddExtension     = true,
                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
            };
            DialogResult res = nsp.ShowDialog();

            if (res is System.Windows.Forms.DialogResult.OK)
            {
                string outnsp = nsp.FileName;
                Brew.Pack.Utils.ExecuteCommand(Brew.Pack.Utils.TemporaryDirectory + "\\bin\\hacbrewpack.exe", cmd, true);
                if (File.Exists(Brew.Pack.Utils.TemporaryDirectory + "\\out\\" + appid + ".nsp"))
                {
                    File.Move(Brew.Pack.Utils.TemporaryDirectory + "\\out\\" + appid + ".nsp", outnsp);
                }
                if (File.Exists(outnsp))
                {
                    long nspsize = new FileInfo(outnsp).Length;
                    if (nspsize is 0)
                    {
                        Log("The build failed. The built NSP seems to be empty.");
                    }
                    else
                    {
                        Log("The NSP was successfully built:\n" + outnsp + " (" + Brew.Pack.Utils.FormatSize(nspsize) + ")", LogMode.Information);
                    }
                }
                else
                {
                    Log("The build failed. The built NSP does not exist.");
                }
            }
        }