Skip to content

Commit

Permalink
ui: Add Logwolf software updates.
Browse files Browse the repository at this point in the history
Set Logwolf information in the Appcast URL template as needed.
  • Loading branch information
geraldcombs committed Jun 17, 2022
1 parent e11c755 commit 5db7ddb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion cmakeconfig.h.in
Expand Up @@ -10,12 +10,15 @@

#define VERSION_EXTRA "$ENV{WIRESHARK_VERSION_EXTRA}"

/* Version number of package */
/* Version number of Wireshark and associated utilities */
#define VERSION "${PROJECT_VERSION}${VERSION_EXTRA}"
#define VERSION_MAJOR ${PROJECT_MAJOR_VERSION}
#define VERSION_MINOR ${PROJECT_MINOR_VERSION}
#define VERSION_MICRO ${PROJECT_PATCH_VERSION}

/* Version number of Logwolf and associated utilities */
#define LOG_VERSION "${LOG_PROJECT_VERSION}${VERSION_EXTRA}"

#define PLUGIN_PATH_ID "${PLUGIN_PATH_ID}"
#define VERSION_FLAVOR "${VERSION_FLAVOR}"

Expand Down
14 changes: 10 additions & 4 deletions ui/software_update.c
Expand Up @@ -13,12 +13,13 @@
#include "software_update.h"
#include "language.h"
#include "../epan/prefs.h"
#include "../wsutil/filesystem.h"

/*
* Version 0 of the update URI path has the following elements:
* - The update path prefix (fixed, "update")
* - The schema version (fixed, 0)
* - The application name (fixed, "Wireshark")
* - The application name (variable, "Wireshark" or "Logwolf")
* - The application version ("<major>.<minor>.<micro>")
* - The operating system (variable, one of "Windows" or "macOS")
* - The architecture name (variable, one of "x86", "x86-64", or "arm64")
Expand All @@ -34,7 +35,6 @@
#ifdef HAVE_SOFTWARE_UPDATE
#define SU_SCHEMA_PREFIX "update"
#define SU_SCHEMA_VERSION 0
#define SU_APPLICATION "Wireshark"
#define SU_LOCALE "en-US"
#endif /* HAVE_SOFTWARE_UPDATE */

Expand Down Expand Up @@ -66,6 +66,12 @@
static char *get_appcast_update_url(software_update_channel_e chan) {
GString *update_url_str = g_string_new("");;
const char *chan_name;
const char *su_application = get_configuration_namespace();
const char *su_version = VERSION;

if (g_str_has_prefix(su_application, "Log")) {
su_version = LOG_VERSION;
}

switch (chan) {
case UPDATE_CHANNEL_DEVELOPMENT:
Expand All @@ -78,8 +84,8 @@ static char *get_appcast_update_url(software_update_channel_e chan) {
g_string_printf(update_url_str, "https://www.wireshark.org/%s/%u/%s/%s/%s/%s/en-US/%s.xml",
SU_SCHEMA_PREFIX,
SU_SCHEMA_VERSION,
SU_APPLICATION,
VERSION,
su_application,
su_version,
SU_OSNAME,
SU_ARCH,
chan_name);
Expand Down

0 comments on commit 5db7ddb

Please sign in to comment.