Beispiel #1
0
        public static void RequirePackDm(bool force = false)
        {
            RequireToolsPath();

#if WINDOWS
            var packExe      = "pack.exe";
            var bootstrapExe = "pack-bootstrap.exe";
#else
            var packFile      = "pack";
            var bootstrapFile = "pack-bootstrap";
#endif

            var bootstrapPath = Path.GetFullPath($@"{ToolsFolder}\{bootstrapExe}");
            if (force || !File.Exists(bootstrapPath))
            {
                using (var output = new FileStream(bootstrapPath, FileMode.Create))
                {
                    EmbeddedFiles.CopyTo(bootstrapExe, output);
                }
            }

            var packPath = Path.GetFullPath($@"{ToolsFolder}\{packExe}");
            if (force || !File.Exists(packPath))
            {
                using (Shell.ChDir(ToolsFolder))
                {
                    Shell.Run(bootstrapExe);
                }
            }

            Prompt.PrintInfo("PackDm detectado:\n" + bootstrapPath);
        }