Use $installedVersion instead of $currentVersion

Master version of https://github.com/owncloud/core/pull/7610

@karlitschek @ser72 @MTRichards