diff --git a/subprojects/extensions-tool/src/command-uninstall.c b/subprojects/extensions-tool/src/command-uninstall.c index 4b902f403..344b720b8 100644 --- a/subprojects/extensions-tool/src/command-uninstall.c +++ b/subprojects/extensions-tool/src/command-uninstall.c @@ -29,14 +29,27 @@ static gboolean uninstall_extension (const char *uuid) { g_autoptr (GDBusProxy) proxy = NULL; + g_autoptr (GVariant) info = NULL; g_autoptr (GVariant) response = NULL; g_autoptr (GError) error = NULL; gboolean success = FALSE; + double type; proxy = get_shell_proxy (&error); if (proxy == NULL) return FALSE; + info = get_extension_property (proxy, uuid, "type"); + if (info == NULL) + return FALSE; + + type = g_variant_get_double (info); + if (type == TYPE_SYSTEM) + { + g_printerr (_("Cannot uninstall system extensions\n")); + return FALSE; + } + response = g_dbus_proxy_call_sync (proxy, "UninstallExtension", g_variant_new ("(s)", uuid), @@ -44,11 +57,6 @@ uninstall_extension (const char *uuid) -1, NULL, &error); - if (response == NULL) - { - g_printerr (_("Failed to connect to GNOME Shell")); - return FALSE; - } g_variant_get (response, "(b)", &success);