private dynamic ExtractEngineFromLua(PackageDownloader.Version ver)
 {
     if (ver != null)
     {
         var mi = ver.ReadFile(paths, "modinfo.lua");
         var lua = new Lua();
         var luaEnv = lua.CreateEnvironment();
         dynamic result = luaEnv.DoChunk(new StreamReader(mi), "dummy.lua");
         var engineVersion = result.engine;
         return engineVersion;
     }
     return null;
 }
 private static void ExtractDefaultConfigs(SpringPaths paths, PackageDownloader.Version ver)
 {
     if (ver != null)
     {
         foreach (var f in defaultConfigs)
         {
             var target = Path.Combine(paths.WritableDirectory, Path.GetFileName(f));
             if (!File.Exists(target))
             {
                 var content = ver.ReadFile(paths, f);
                 if (content != null) File.WriteAllBytes(target, content.ToArray());
             }
         }
     }
 }