This commit is contained in:
dborth 2009-12-23 00:36:42 +00:00
parent 04821154e0
commit 4b39e3a509

View File

@ -147,19 +147,12 @@ bool DownloadUpdate()
// since we're saving a file // since we're saving a file
HaltDeviceThread(); HaltDeviceThread();
// find devoptab name int device;
char dev[10]; FindDevice(appPath, &device);
int i;
for(i=0; i < 8; i++)
{
dev[i] = appPath[i];
if(appPath[i] == '/') break;
}
dev[i+1] = 0;
FILE * hfile; FILE * hfile;
char updateFile[50]; char updateFile[50];
sprintf(updateFile, "%s%s Update.zip", dev, APPNAME); sprintf(updateFile, "%s%s Update.zip", pathPrefix[device], APPNAME);
hfile = fopen (updateFile, "wb"); hfile = fopen (updateFile, "wb");
if (hfile > 0) if (hfile > 0)
@ -169,7 +162,7 @@ bool DownloadUpdate()
fclose (hfile); fclose (hfile);
} }
result = unzipArchive(updateFile, dev); result = unzipArchive(updateFile, (char *)pathPrefix[device]);
remove(updateFile); // delete update file remove(updateFile); // delete update file
// go back to checking if devices were inserted/removed // go back to checking if devices were inserted/removed