Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public static void Initialize()
 {
     AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(
         (o, a) =>
     {
         var assemblyName = a.Name.Split(',').First();
         var filename     = assemblyName + ".dll";
         if (EmbeddedFiles.Exists(filename))
         {
             var bytes = EmbeddedFiles.RetrieveBinary(filename);
             return(Assembly.Load(bytes));
         }
         return(null);
     }
         );
 }
Ejemplo n.º 3
0
        public static void RequireNuGet(bool force = false)
        {
            RequireToolsPath();

            var exe = Path.GetFullPath($@"{ToolsFolder}\nuget.exe");

            if (force || !File.Exists(exe))
            {
                using (var output = new FileStream(exe, FileMode.Create))
                {
                    EmbeddedFiles.UnpackTo("nuget.exe.gz", output);
                }
            }

            Prompt.PrintInfo("NuGet detectado:\n" + exe);
        }