#ifndef INSTALL_ZIP_H #define INSTALL_ZIP_H #include #include #include #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