Delete archive even on failure so we won't re-try the same update
This commit is contained in:
parent
587d3c1908
commit
9553c8b14c
|
@ -269,22 +269,13 @@ namespace MediaBrowser.Installer
|
||||||
{
|
{
|
||||||
ExtractPackage(archive);
|
ExtractPackage(archive);
|
||||||
// We're done with it so delete it (this is necessary for update operations)
|
// We're done with it so delete it (this is necessary for update operations)
|
||||||
try
|
TryDelete(archive);
|
||||||
{
|
|
||||||
File.Delete(archive);
|
|
||||||
}
|
|
||||||
catch (FileNotFoundException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
SystemClose("Error Removing Archive - " + e.GetType().FullName + "\n\n" + e.Message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
SystemClose("Error Extracting - " + e.GetType().FullName + "\n\n" + e.Message);
|
SystemClose("Error Extracting - " + e.GetType().FullName + "\n\n" + e.Message);
|
||||||
|
// Delete archive even if failed so we don't try again with this one
|
||||||
|
TryDelete(archive);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,6 +328,23 @@ namespace MediaBrowser.Installer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool TryDelete(string file)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Delete(file);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void PismoInstall()
|
private void PismoInstall()
|
||||||
{
|
{
|
||||||
// Kick off the Pismo installer and wait for it to end
|
// Kick off the Pismo installer and wait for it to end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user