Updating Your Branded Desktop App

Introduction

The Client Updater Server provides a Web service that will tell an ownCloud Desktop app whether or not an update is available. If an update is available, it will also provide metadata for the update, such as the Download URL, signatures or a fallback URL that the client can resort to in case the update goes wrong.

Clients for macOS and Windows will update themselves automatically. Linux clients will not. You have two options for your Linux users:

  • Set up your own download repository so your Linux users can update your branded clients with their package managers when they receive an update notification.

  • Upload new versions of your branded client to your Web server. Your Linux users receive update notifications, then download and install the client manually.

There are times when you may want to disable update notifications. See the examples below to learn how to do this.

Prerequisites

  1. Configure Update URL in the Desktop section of your ownBrander account (available for advanced users only).

    • Example:
      https://mycloud.example.com/updates/
      (note the forward slash at the end)

  2. Generate branded clients.

  3. Upload branded clients to your Web server.

    • Windows example:
      https://mycloud.example.com/install/mycloud-2.1.1.240-setup.exe

    • macOS examples:
      https://mycloud.example.com/install/mycloud-2.1.1.787.pkg
      https://mycloud.example.com/install/mycloud-2.1.1.787.pkg.tbz
      https://mycloud.example.com/install/mycloud-2.1.1.787.pkg.tbz.sig

    • You should have a Web page with links to your branded clients, so your users can find and download them. For example, https://mycloud.example.com/install/
      with Options +Indexes in your ownCloud .htaccess file.

Install the Client Updater Server

  1. Download client-updater-server-0.4.tar.xz from https://customer.owncloud.com/

  2. Extract client-updater-server-0.4.tar.xz to your Web server. The index.php must be accessible at https://mycloud.example.com/updates/index.php.

  3. Copy your ownCloud config/ownCloud.yml file, and name it according your Application short name as configured in ownBrander.

    Example: config/mycloud.yml

Configure the Client Updater Server

All configuration is done in your config/mycloud.yml:

throttle: 1 # 100% of the requests get served with the new version

platforms:
  win32msi:
    currentVersion: 2.5.0.10598
    currentVersionString: ownCloud Client 2.5.0 (build 10598)
    updateUrl: https://owncloud.com/desktop-app
    downloadUrl: http://download.owncloud.com/desktop/stable/ownCloud-2.5.0.10598.msi

  win32:
    currentVersion: 2.4.3.10188
    currentVersionString: ownCloud Client 2.4.3 (build 10188)
    updateUrl: https://owncloud.com/desktop-app
    downloadUrl: http://download.owncloud.com/desktop/stable/ownCloud-2.4.3.10188-setup.exe

  linux:
    currentVersion: 1.8.0
    currentVersionString: ownCloud Client 1.7.1
    updateUrl: https://owncloud.com/desktop-app

  macos:
    currentVersion: 1.8.0.2139
    currentVersionString: ownCloud Client 1.8.0 (build 2139)
    downloadUrl: https://download.owncloud.com/desktop/stable/ownCloud-1.8.0.2139.pkg.tbz
    pubDate: 2015-03-26
    signature: MCwCFFedScUKeRXYMS6vKVLw821B+/+lAhRbiCxHNzVVZFNXHSvB9GNHOuI5cw==
    minimumSystemVersion: 10.7.0

In earlier versions this configuration was written in PHP, which is still supported but no longer the default. The structure slightly changed and would look like this analoguely to the yml config config/mycloud.php:

<?php

$updateInfo = [
    'throttle' => 0.7, // 70% of the requests get served with the new version
    'platforms' => [
        'win32msi' => [
            'currentVersion' => '2.5.0.10598',
            'currentVersionString' => 'ownCloud Client 2.5.0 (build 10598)',
            'updateUrl' => 'https://owncloud.com/desktop-app',
            'downloadUrl' => 'http://download.owncloud.com/desktop/stable/ownCloud-2.5.0.10598.msi',
        ],
        'win32' => [
            'currentVersion' => '2.4.3.10188',
            'currentVersionString' => 'ownCloud Client 2.4.3 (build 10188)',
            'updateUrl' => 'https://owncloud.com/desktop-app',
            'downloadUrl' => 'http://download.owncloud.com/desktop/stable/ownCloud-2.4.3.10188-setup.exe',
        ],
        'linux' => array(
            'currentVersion' => '1.8.0',
            'currentVersionString' => 'ownCloud Client 1.7.1',
            'updateUrl' => 'https://owncloud.com/desktop-app',
        ),
        'macos' => array(
            'currentVersion' => '1.8.0.2139',
            'currentVersionString' => 'ownCloud Client 1.8.0 (build 2139)',
            'downloadUrl' => 'https://download.owncloud.com/desktop/stable/ownCloud-1.8.0.2139.pkg.tbz',
            'pubDate' => '2015-03-26',
            'signature' => 'MCwCFFedScUKeRXYMS6vKVLw821B+/+lAhRbiCxHNzVVZFNXHSvB9GNHOuI5cw==',
            'minimumSystemVersion' => '10.7.0',
        ),
    ]
];

(The former top-level config options were moved under a platforms key.)

Disabling Notifications

There may be times when you wish to disable update notifications. To do this, make the 'currentVersion' and 'currentVersionString' older than the currently installed version. To re-enable notifications, change these to release versions that are newer than the currently installed clients.

Windows

  • 'currentVersion'
    Exact version of the new client, including the build number

  • 'currentVersionString'
    Name of the new client, same as "Application name" configured in ownBrander.

  • 'updateUrl'
    Human-readable Web site with links to your new client files.

  • 'downloadUrl'
    Full URL to download the *.exe file. https needed.

macOS

  • currentVersion'
    Exact version of the new client, including the build number.

  • 'currentVersionString'
    Name of the new client, same as Application name configured in ownBrander.

  • 'downloadUrl'
    Full URL to download the *.pkg.tbz file. https needed.

  • 'pubDate'
    Currently not used.

  • 'signature'
    Content of mycloud-2.1.1.787.pkg.tbz.sig, adds some extra security to the macOS updater.

  • 'minimumSystemVersion'
    Minimum required macOS version according to https://owncloud.com/desktop-app/

Linux

  • 'currentVersion'
    Exact version of the new client, including the build number

  • 'currentVersionString'
    Name of the new client, same as Application name configured in ownBrander.

  • 'updateUrl'
    Human-readable Web site with links to your new client files to manually install new client versions.

Debugging the Client Updater Server

Windows

This a example URL of a 2.5.0 client for Microsoft Windows:
https://mycloud.example.com/updates/?version=2.5.0.10598&platform=win32&msi=true&oem=mycloud

You should see something like the following in your Web server logs:

[19/Feb/2016:14:33:35 +0100] "GET
/updates/?version=2.5.0.10598&platform=win32&msi=true&oem=mycloud HTTP/1.1" 200 185 "-"
"Mozilla/5.0 (Windows) mirall/2.5.0 (mycloud)" microsecs:530450

The output should look like this if you call the URL manually:

<?xml version="1.0"?>
   <owncloudclient>
      <version>2.5.0.10598</version>
       <versionstring>MyCloud Client 2.5.0 (build 10598)</versionstring>
       <web>https://mycloud.example.com/install/</web>
       <downloadurl>https://mycloud.example.com/install/
        mycloud-2.5.0.10598.msi</downloadurl>
   </owncloudclient>

macOS

This a example URL of a 2.1.1 client for macOS:

https://mycloud.example.com/updates/?version=2.1.1.687&platform=macos&oem=mycloud&sparkle=true

You should see something like the following in your Web server logs:

[19/Feb/2016:14:00:17 +0100] "GET
/updates/?version=2.1.1.687&platform=macos&oem=mycloud&sparkle=
true HTTP/1.1" 200 185 "-" "Mozilla/5.0 (Macintosh) mirall/2.1.1 (mycloud)"
microsecs:1071 response_size:2070 bytes_received:306 bytes_sent:2402

The output should look like this if you call the URL manually:

<?xml version="1.0" encoding="utf-8"?>
  <rss version="2.0"
  xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
     <title>Download Channel</title>
     <description>Most recent changes with links to updates.</description>
     <language>en</language><item>
     <title>MyCloud Client 2.1.1 (build 787)</title>
     <pubDate>Mon, 23 Feb 16 00:00:00 -0500</pubDate>
     <enclosure url="https://mycloud.example.com/install/
       mycloud-2.1.1.787.pkg.tbz" sparkle:version="2.1.1.787"
       type="application/octet-stream"
       sparkle:dsaSignature="MCwCFFedScUKeRXYMS6vKVLw821B+/+
         lAhRbiCxHNzVVZFNXHSvB9GNHOuI5cw=="/>
      <sparkle:minimumSystemVersion>10.7.0</sparkle:minimumSystemVersion>
   </item>
   </channel>
  </rss>