diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index aae07b0c50..28c420ca86 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -392,7 +392,7 @@ impl Updater { let mut raw_json: Option = None; let mut last_error: Option = None; for url in &self.endpoints { - // replace {{current_version}}, {{target}} and {{arch}} in the provided URL + // replace {{current_version}}, {{target}}, {{arch}} and {{bundle_type}} in the provided URL // this is useful if we need to query example // https://releases.myapp.com/update/{{target}}/{{arch}}/{{current_version}} // will be translated into -> @@ -404,6 +404,9 @@ impl Updater { const CONTROLS_ADD: &AsciiSet = &CONTROLS.add(b'+'); let encoded_version = percent_encoding::percent_encode(version, CONTROLS_ADD); let encoded_version = encoded_version.to_string(); + let installer = installer_for_bundle_type(bundle_type()) + .map(|i| i.name()) + .unwrap_or("unknown"); let url: Url = url .to_string() @@ -411,10 +414,12 @@ impl Updater { .replace("%7B%7Bcurrent_version%7D%7D", &encoded_version) .replace("%7B%7Btarget%7D%7D", target) .replace("%7B%7Barch%7D%7D", self.arch) + .replace("%7B%7Bbundle_type%7D%7D", installer) // but not query parameters .replace("{{current_version}}", &encoded_version) .replace("{{target}}", target) .replace("{{arch}}", self.arch) + .replace("{{bundle_type}}", installer) .parse()?; log::debug!("checking for updates {url}");