clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
427 stars 39 forks source link

Can it support custom download paths at runtime (needed for offline environments)? #174

Closed ColinZeb closed 1 year ago

ColinZeb commented 1 year ago

For example, placing the runtime in the 'runtime' folder on the update website

KennyTK commented 1 year ago

Yes.

Modified from README.md:

string UPDATEPATH = "https://the.place/you-host/updates";

private static async Task UpdateMyApp()
{
  if(offline = true)
  {
    UPDATEPATH = "\\server\my\offline\path\"
  }

   using var mgr = new UpdateManager(UPDATEPATH);
   var newVersion = await mgr.UpdateApp();

   // optionally restart the app automatically, or ask the user if/when they want to restart
   if (newVersion != null) {
      UpdateManager.RestartApp();
   }
}

Use UpdateManager to specify different paths.

ColinZeb commented 1 year ago

@KennyTK My issue is whether it is possible to customize the runtime path during execution. For example, if I deploy an update website locally or on an intranet server, can the client detect the absence of a runtime and download it from the intranet instead of from the Microsoft website?

KennyTK commented 1 year ago

@ColinZeb I think there may be a conflation between runtime, framework, and the purpose of Clowd. When you are referring to runtime, do you mean dot net framework?

possibly related to #152

ColinZeb commented 1 year ago

@KennyTK Yes, I need to be able to install the .net framework automatically when installing in a brand new environment, not from the Internet, but from an update site.

caesay commented 1 year ago

No this is not supported. If you think this can be implemented in a generic way which would be useful to others, feel free to submit a PR though!

KennyTK commented 1 year ago

This method gets the url for downloading runtime.

Squirrel::Runtimes::DotnetInfo::GetDotNetDownloadUrl