minor fixes
This commit is contained in:
@@ -58,7 +58,7 @@ public class UpdateClient(string updateUrl, AppVersion currentVersion, AppChanne
|
||||
public async Task UpdateInteractive(UpdatePackageInfo package)
|
||||
{
|
||||
if (await DownloadPackageAsync(package))
|
||||
await InstallPackageAsync(package);
|
||||
await InstallPackageAsync(package, HostApplicationPath);
|
||||
}
|
||||
|
||||
// F e a t u r e s
|
||||
@@ -148,9 +148,9 @@ public class UpdateClient(string updateUrl, AppVersion currentVersion, AppChanne
|
||||
return true;
|
||||
}
|
||||
|
||||
public void InstallPackage(UpdatePackageInfo package)
|
||||
public void InstallPackage(UpdatePackageInfo package, string? localInstallPath)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(HostApplicationPath) || !dicPackagePaths.TryGetValue(package, out var packagePath))
|
||||
if (string.IsNullOrWhiteSpace(localInstallPath) || !dicPackagePaths.TryGetValue(package, out var packagePath))
|
||||
{
|
||||
RaiseStatusChanged(UpdateStatus.Failed);
|
||||
return;
|
||||
@@ -182,8 +182,8 @@ public class UpdateClient(string updateUrl, AppVersion currentVersion, AppChanne
|
||||
|
||||
// Install Package
|
||||
RaiseStatusChanged(UpdateStatus.Copying, UpdateStatusEvent.PreEvent);
|
||||
var dataPathDir = new DirectoryInfo(dataPath);
|
||||
var destDir = new DirectoryInfo(HostApplicationPath);
|
||||
var dataPathDir = Directory.CreateDirectory(dataPath);
|
||||
var destDir = Directory.CreateDirectory(localInstallPath);
|
||||
Utils.CopyFiles(dataPathDir, destDir);
|
||||
RaiseStatusChanged(UpdateStatus.Copying, UpdateStatusEvent.PostEvent);
|
||||
|
||||
@@ -200,8 +200,8 @@ public class UpdateClient(string updateUrl, AppVersion currentVersion, AppChanne
|
||||
RaiseStatusChanged(UpdateStatus.Done, UpdateStatusEvent.Default);
|
||||
}
|
||||
|
||||
public Task InstallPackageAsync(UpdatePackageInfo package)
|
||||
public Task InstallPackageAsync(UpdatePackageInfo package, string? localInstallPath)
|
||||
{
|
||||
return Task.Run(() => InstallPackage(package));
|
||||
return Task.Run(() => InstallPackage(package, localInstallPath));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user