diff --git a/Build.cmd b/Build.cmd index b89cf10..14ccd03 100755 --- a/Build.cmd +++ b/Build.cmd @@ -71,12 +71,10 @@ OSXPublish (){ AndroidPublish (){ if ! [ -d "${AndroidSdkDirectory}build-tools" ]; then - printf "\x1b[31mINVALID ANDROID SDK PATH\x1b[0m\n"; - return; + echo "POSSIBLE INVALID ANDROID SDK PATH"; fi if ! [ -f "${AndroidNdkDirectory}ndk-build" ]; then - printf "\x1b[31mINVALID ANDROID NDK PATH\x1b[0m\n"; - return; + echo "POSSIBLE INVALID ANDROID NDK PATH"; fi dotnet workload restore diff --git a/DirectPackageInstaller/DirectPackageInstaller/IO/PartialHttpStream.cs b/DirectPackageInstaller/DirectPackageInstaller/IO/PartialHttpStream.cs index 8f6a0a2..1be4436 100644 --- a/DirectPackageInstaller/DirectPackageInstaller/IO/PartialHttpStream.cs +++ b/DirectPackageInstaller/DirectPackageInstaller/IO/PartialHttpStream.cs @@ -61,7 +61,7 @@ public PartialHttpStream(string url, int cacheLen = CacheLen) public override bool CanRead => true; public override bool CanWrite => false; - public override bool CanSeek => true; + public override bool CanSeek => Length > 0; public override long Position { get; set; } @@ -238,7 +238,7 @@ private int HttpRead(byte[] buffer, ref int offset, ref int count, int Tries = 0 foreach (var Header in Headers) req.Headers[Header.Key] = Header.Value; - if (length != null || Position > 0) + if (length > 0 || Position > 0) req.AddRange(Position, Length - 1); resp = req.GetResponse(); @@ -274,6 +274,9 @@ private int HttpRead(byte[] buffer, ref int offset, ref int count, int Tries = 0 nread += Readed; } while (Readed > 0 && count > 0); + if (Readed == 0 && length is null or -1) + length = nread; + offset += nread; count -= nread; diff --git a/DirectPackageInstaller/DirectPackageInstaller/SelfUpdate.cs b/DirectPackageInstaller/DirectPackageInstaller/SelfUpdate.cs index 6c6d788..965273a 100644 --- a/DirectPackageInstaller/DirectPackageInstaller/SelfUpdate.cs +++ b/DirectPackageInstaller/DirectPackageInstaller/SelfUpdate.cs @@ -46,7 +46,7 @@ public static string? MainExecutable const string UpdateList = "Update.ini"; - public static Version CurrentVersion = new Version("6.1.8"); + public static Version CurrentVersion = new Version("6.1.9"); public static Version? LastVersion = null; @@ -156,14 +156,17 @@ public async Task DownloadUpdate() public bool FinishUpdatePending() { - if (!App.IsAndroid) + if (App.IsAndroid) { try { if (Directory.Exists(TempUpdateDir)) + { Directory.Delete(TempUpdateDir, true); + } } catch { } + return false; }