Skip to content

Commit

Permalink
remove the old updater before unpacking the new one, refs #32
Browse files Browse the repository at this point in the history
  • Loading branch information
jackeri committed Dec 18, 2014
1 parent eb6b0b6 commit 71f7f0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/client/cl_update.c
Expand Up @@ -222,6 +222,17 @@ static qboolean CL_UnpackUpdatePackage(const char *pack, const char *bin, const
return qfalse;
}

static void CL_CLeanUpdateFolder(const char *bin)
{
//We just remove the old updater here, if it exists.
//The update installer itself does other cleanups
char *fn1 = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), AUTOUPDATE_DIR, bin);
if (FS_FileInPathExists(fn1))
{
FS_Remove(fn1);
}
}

qboolean CL_CheckUpdateDownloads(void)
{
#ifdef FEATURE_AUTOUPDATE
Expand All @@ -234,6 +245,8 @@ qboolean CL_CheckUpdateDownloads(void)
return qtrue;
}

CL_CLeanUpdateFolder(UPDATE_BINARY);

if (CL_UnpackUpdatePackage(UPDATE_PACKAGE, UPDATE_BINARY, UPDATE_CONFIG))
{
CL_RunUpdateBinary(UPDATE_BINARY, UPDATE_CONFIG);
Expand Down

0 comments on commit 71f7f0a

Please sign in to comment.