diff --git a/lib/private/updater.php b/lib/private/updater.php
index 302003e666c67dee62643eb1dfe2e169d30e56b8..4d813ee3d393f841663b35e2b0dc7facaaa03edd 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -12,6 +12,7 @@ use OC\Hooks\BasicEmitter;
 use OC_App;
 use OC_Util;
 use OCP\IConfig;
+use OC\Setup;
 
 /**
  * Class that handles autoupdating of ownCloud
@@ -202,13 +203,12 @@ class Updater extends BasicEmitter {
 			throw new \Exception('Updates between multiple major versions are unsupported.');
 		}
 
-		// Update htaccess files for apache hosts
-		if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
-			try {
-				\OC\Setup::updateHtaccess();
-			} catch (\Exception $e) {
-				throw new \Exception($e->getMessage());
-			}
+		// Update .htaccess files
+		try {
+			Setup::updateHtaccess();
+			Setup::protectDataDirectory();
+		} catch (\Exception $e) {
+			throw new \Exception($e->getMessage());
 		}
 
 		// create empty file in data dir, so we can later find