forked from Mirrors/openclonk
update: Log an error message when extracting the update program fails
parent
8602298f0d
commit
ce49a25d20
|
@ -1589,7 +1589,7 @@ bool C4Group::ExtractEntry(const char *szFilename, const char *szExtractTo)
|
|||
case GRPF_File: // Copy entry to target
|
||||
// Get entry
|
||||
C4GroupEntry *pEntry;
|
||||
if (!(pEntry=GetEntry(szFilename))) return false;
|
||||
if (!(pEntry=GetEntry(szFilename))) return Error("Extract: Entry not found");
|
||||
// Create dummy file to reserve target file name
|
||||
hDummy.Create(szTargetFName,false);
|
||||
hDummy.Write("Dummy",5);
|
||||
|
|
|
@ -209,10 +209,17 @@ bool C4UpdateDlg::ApplyUpdate(const char *strUpdateFile, bool fDeleteUpdate, C4G
|
|||
if (IsWindowsWithUAC()) strUpdateProgEx.Copy(Config.AtTempPath("setup.exe"));
|
||||
// Extract update program (the update should be applied using the new version)
|
||||
C4Group UpdateGroup, SubGroup;
|
||||
if (!UpdateGroup.Open(strUpdateFile)) return false;
|
||||
if (!UpdateGroup.Open(strUpdateFile))
|
||||
{
|
||||
LogF("Error opening \"%s\": %s", strUpdateFile, UpdateGroup.GetError());
|
||||
return false;
|
||||
}
|
||||
// Look for update program at top level
|
||||
if (!UpdateGroup.ExtractEntry(strUpdateProg.getData(), strUpdateProgEx.getData()))
|
||||
{
|
||||
LogF("Error extracting \"%s\": %s", strUpdateProg.getData(), UpdateGroup.GetError());
|
||||
return false;
|
||||
}
|
||||
#if 0
|
||||
char strSubGroup[1024+1];
|
||||
// ASK: What is this? Why should an update program not be found at the top
|
||||
|
|
Loading…
Reference in New Issue