diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php
index 235df51..fa833de 100644
--- a/wp-admin/includes/class-wp-upgrader.php
+++ b/wp-admin/includes/class-wp-upgrader.php
@@ -1044,9 +1044,10 @@ class Plugin_Upgrader extends WP_Upgrader {
 	 * @global WP_Filesystem_Base $wp_filesystem Subclass
 	 *
 	 * @param string $source The path to the downloaded package source.
+	 * @param string $environment The environment in which the check is running (default, in-plugin-installer, etc).
 	 * @return string|WP_Error The source as passed, or a {@see WP_Error} object if no plugins were found.
 	 */
-	public function check_package($source) {
+	public function check_package($source, $environment = 'default') {
 		global $wp_filesystem;
 
 		if ( is_wp_error($source) )
@@ -1056,6 +1057,15 @@ class Plugin_Upgrader extends WP_Upgrader {
 		if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
 			return $source;
 
+		if ( 'default' == $environment ) {
+			// Check if we've got a theme here
+			$theme_check = Theme_Upgrader::check_package( $source, 'in-theme-installer' );
+
+			if ( ! is_a( $theme_check, 'WP_Error' ) ) {
+				return new WP_Error( 'incompatible_archive_plugin_is_theme', $this->strings['incompatible_archive'], __( 'It looks like you\'re wanting to install a theme. Visit the theme installer to do this.' ) );
+			}
+		}
+
 		// Check the folder contains at least 1 valid plugin.
 		$plugins_found = false;
 		$files = glob( $working_directory . '*.php' );
@@ -1578,9 +1588,10 @@ class Theme_Upgrader extends WP_Upgrader {
 	 * @global WP_Filesystem_Base $wp_filesystem Subclass
 	 *
 	 * @param string $source The full path to the package source.
+	 * @param string $environment The environment in which the check is running (default, in-theme-installer, etc).
 	 * @return string|WP_Error The source or a WP_Error.
 	 */
-	public function check_package( $source ) {
+	public function check_package( $source, $environment = 'default' ) {
 		global $wp_filesystem;
 
 		if ( is_wp_error($source) )
@@ -1591,6 +1602,15 @@ class Theme_Upgrader extends WP_Upgrader {
 		if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
 			return $source;
 
+		if ( 'default' == $environment ) {
+			// Check if we've got a plugin here
+			$plugin_check = Plugin_Upgrader::check_package( $source, 'in-theme-installer' );
+
+			if ( ! is_a( $plugin_check, 'WP_Error' ) ) {
+				return new WP_Error( 'incompatible_archive_theme_is_plugin', $this->strings['incompatible_archive'], __( 'It looks like you\'re wanting to install a plugin. Visit the plugin installer to do this.' ) );
+			}
+		}
+
 		// A proper archive should have a style.css file in the single subdirectory
 		if ( ! file_exists( $working_directory . 'style.css' ) )
 			return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>style.css</code> stylesheet.' ) );
