summaryrefslogtreecommitdiffstats
path: root/source/install-zip.c
diff options
context:
space:
mode:
authorGentoo <installgentoo@endianness.com>2021-03-27 10:36:05 +1100
committerGentoo <installgentoo@endianness.com>2021-03-27 10:36:05 +1100
commit0349c6d6572f59770898d3f40287ebdcd2f8ed30 (patch)
tree4f55d594e5343a7d4f4e6d4dea34d9c35caa0b99 /source/install-zip.c
downloadYetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.tar.gz
YetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.tar.bz2
YetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.zip
initial commitHEADmaster
Diffstat (limited to 'source/install-zip.c')
-rw-r--r--source/install-zip.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source/install-zip.c b/source/install-zip.c
new file mode 100644
index 0000000..93553b3
--- /dev/null
+++ b/source/install-zip.c
@@ -0,0 +1,41 @@
+#ifndef INSTALL_ZIP_H
+#define INSTALL_ZIP_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "unzip/unzip.h"
+#include "unzip/miniunz.h"
+
+#include "gecko.h"
+
+void unZip(char zipFilePath[])
+{
+ char newZipFilePath[strlen(zipFilePath)+4];
+ sprintf(newZipFilePath, "sd:/%s", zipFilePath);
+
+ unzFile zip = unzOpen(newZipFilePath);
+ if (!zip)
+ {
+ printf("Cannot open %s, aborting\n", newZipFilePath);
+ #ifndef GECKO
+ gprintf("Cannot open %s, aborting\n", newZipFilePath);
+ #endif
+ exit(1);
+ }
+
+ printf("%s opened\n", newZipFilePath);
+ gprintf("%s opened\n", newZipFilePath);
+// if (chdir(unzipFolderPath))//can't access dir
+// {
+// create_folders(unzipFolderPath);//create dir
+// chdir(NewUnzipFolderPath);//change to created dir (create_folders() will exit(1) if it can't create the folder)
+// }
+
+ extractZip(zip,0,1,0);//extract zip
+ unzCloseCurrentFile(zip);
+ printf("Extracted Zip\n");
+}
+
+#endif