Ejemplo n.º 1
0
        public string ExtractNatives()
        {
            string path = gamePath.GetNativePath(version.Id);

            Directory.CreateDirectory(path);

            if (version.Libraries == null)
            {
                return(path);
            }

            foreach (var item in version.Libraries)
            {
                try
                {
                    if (item.IsRequire && item.IsNative && !string.IsNullOrEmpty(item.Path))
                    {
                        string zPath = Path.Combine(gamePath.Library, item.Path);
                        if (File.Exists(zPath))
                        {
                            var z = new SharpZip(zPath);
                            z.Unzip(path);
                        }
                    }
                }
                catch
                {
                    // ignore invalid native library file
                }
            }

            return(path);
        }
Ejemplo n.º 2
0
        public string ExtractNatives()
        {
            var path = gamePath.GetNativePath(version.Id);

            Directory.CreateDirectory(path);

            foreach (var item in version.Libraries)
            {
                try
                {
                    if (item.IsRequire && item.IsNative)
                    {
                        var z = new SharpZip(Path.Combine(gamePath.Library, item.Path));
                        z.Unzip(path);
                    }
                }
                catch { }
            }

            return(path);
        }