private void FileLockWait()
{
int attempt = 0;
while (FileSystem.IsFileLocked(new FileInfo(_destinationFile)))
{
Thread.Sleep(500);
attempt++;
if (attempt == 10)
{
throw new UpdateProcessFailedException("Failed to update, the file is locked: " + _destinationFile);
}
}
}