Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php	(revision 723)
@@ -12,4 +12,5 @@
 		$this->strings['make_config'] = __('Delete source wp-config.php.', 'xpressme');
 		$this->strings['delete_failed'] = __('Could not delete files.', 'xpressme');
+		$this->strings['package_wrong'] = __('The structure of the package is wrong. ', 'xpressme');
 	}
 
@@ -40,11 +41,19 @@
 		if ( is_wp_error($working_dir) )
 			return $working_dir;
-		$subdirs = $wp_filesystem->dirlist($working_dir,false);
-		foreach($subdirs as $subdir){
-			$subdir_name = $subdir['name'];
+		$kit_dir = $working_dir .'/xpressme_integration_kit/';
+		if (!file_exists($kit_dir)){	// search sub dir.
+			$kit_dir = '';
+			$subdirs = $wp_filesystem->dirlist($working_dir,false);
+			foreach($subdirs as $subdir){
+				if (file_exists($working_dir .'/' .$subdir['name'] .'/xpressme_integration_kit/')){
+					$kit_dir = $working_dir .'/' .$subdir['name'] .'/xpressme_integration_kit/';
+					continue;
+				}
+			}
+			if (empty($kit_dir)){
+				$wp_filesystem->delete($working_dir, true);
+				return new WP_Error('package_wrong', $this->strings['package_wrong']);
+			}
 		}
-		
-		$kit_dir = $working_dir .'/' .$subdir_name .'/xpressme_integration_kit/';
-		
 		// Copy update-core.php from the new version into place.
 		$update_xpress_file = 'wp-content/plugins/xpressme/include/update_xpress.php';
@@ -59,3 +68,3 @@
 	}
 }
-
+?>
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 723)
@@ -8,6 +8,6 @@
 "Project-Id-Version: XPressME Plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-04-23 10:02+0900\n"
-"PO-Revision-Date: 2011-04-23 10:06+0900\n"
+"POT-Creation-Date: 2011-04-29 14:11+0900\n"
+"PO-Revision-Date: 2011-04-29 14:12+0900\n"
 "Last-Translator: toemon <info@toemon.com>\n"
 "Language-Team: toemon <info@toemon.com>\n"
@@ -553,4 +553,8 @@
 msgstr "ファイルが消去できませんでした。"
 
+#: include/class-xpress-upgrader.php:14
+msgid "The structure of the package is wrong. "
+msgstr "パッケージの構成が異なっています。"
+
 #: include/custom_functions.php:113
 #, php-format
@@ -839,17 +843,18 @@
 msgstr "モジュールの更新へ"
 
-#: include/xpress_upgrade.php:205
-msgid "You do not have sufficient permissions to update XPressME Integration Kit for this site."
-msgstr "あなたには、 XPressME Integration Kit の更新権限がありません。"
-
-#: include/xpress_upgrade.php:371
+#: include/xpress_upgrade.php:369
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
 msgstr "XPressME Integration Kit Version %1$s が利用可能です ! <a href=\"%2$s\">アップデートしてください</a>。"
 
-#: include/xpress_upgrade.php:373
+#: include/xpress_upgrade.php:371
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
 msgstr "XPressME Integration Kit Version %1$s が利用可能です ! サイト管理者に連絡してください。"
+
+#~ msgid ""
+#~ "You do not have sufficient permissions to update XPressME Integration Kit "
+#~ "for this site."
+#~ msgstr "あなたには、 XPressME Integration Kit の更新権限がありません。"
 
 #~ msgid ""
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_EUC.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_EUC.po	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_EUC.po	(revision 723)
@@ -9,5 +9,5 @@
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2011-04-22 23:10+0900\n"
-"PO-Revision-Date: 2011-04-23 10:09+0900\n"
+"PO-Revision-Date: 2011-04-29 14:15+0900\n"
 "Last-Translator: toemon <info@toemon.com>\n"
 "Language-Team: toemon <info@toemon.com>\n"
@@ -553,4 +553,8 @@
 msgstr "¥Õ¥¡¥¤¥ë¤¬¾Ãµî¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£"
 
+#: include/class-xpress-upgrader.php:14
+msgid "The structure of the package is wrong. "
+msgstr "¥Ñ¥Ã¥±¡¼¥¸¤Î¹½À®¤¬°Û¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£"
+
 #: include/custom_functions.php:113
 #, php-format
@@ -839,17 +843,18 @@
 msgstr "¥â¥¸¥å¡¼¥ë¤Î¹¹¿·¤Ø"
 
-#: include/xpress_upgrade.php:205
-msgid "You do not have sufficient permissions to update XPressME Integration Kit for this site."
-msgstr "¤¢¤Ê¤¿¤Ë¤Ï¡¢ XPressME Integration Kit ¤Î¹¹¿·¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£"
-
-#: include/xpress_upgrade.php:371
+#: include/xpress_upgrade.php:369
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
 msgstr "XPressME Integration Kit Version %1$s ¤¬ÍøÍÑ²ÄÇ½¤Ç¤¹ ! <a href=\"%2$s\">¥¢¥Ã¥×¥Ç¡¼¥È¤·¤Æ¤¯¤À¤µ¤¤</a>¡£"
 
-#: include/xpress_upgrade.php:373
+#: include/xpress_upgrade.php:371
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
 msgstr "XPressME Integration Kit Version %1$s ¤¬ÍøÍÑ²ÄÇ½¤Ç¤¹ ! ¥µ¥¤¥È´ÉÍý¼Ô¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£"
+
+#~ msgid ""
+#~ "You do not have sufficient permissions to update XPressME Integration Kit "
+#~ "for this site."
+#~ msgstr "¤¢¤Ê¤¿¤Ë¤Ï¡¢ XPressME Integration Kit ¤Î¹¹¿·¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£"
 
 #~ msgid ""
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_UTF.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_UTF.po	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja_UTF.po	(revision 723)
@@ -9,5 +9,5 @@
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-08-23 09:55+0900\n"
-"PO-Revision-Date: 2011-04-23 10:09+0900\n"
+"PO-Revision-Date: 2011-04-29 14:15+0900\n"
 "Last-Translator: toemon <info@toemon.com>\n"
 "Language-Team: toemon <info@toemon.com>\n"
@@ -553,4 +553,8 @@
 msgstr "ファイルが消去できませんでした。"
 
+#: include/class-xpress-upgrader.php:14
+msgid "The structure of the package is wrong. "
+msgstr "パッケージの構成が異なっています。"
+
 #: include/custom_functions.php:113
 #, php-format
@@ -839,17 +843,18 @@
 msgstr "モジュールの更新へ"
 
-#: include/xpress_upgrade.php:205
-msgid "You do not have sufficient permissions to update XPressME Integration Kit for this site."
-msgstr "あなたには、 XPressME Integration Kit の更新権限がありません。"
-
-#: include/xpress_upgrade.php:371
+#: include/xpress_upgrade.php:369
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
 msgstr "XPressME Integration Kit Version %1$s が利用可能です ! <a href=\"%2$s\">アップデートしてください</a>。"
 
-#: include/xpress_upgrade.php:373
+#: include/xpress_upgrade.php:371
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
 msgstr "XPressME Integration Kit Version %1$s が利用可能です ! サイト管理者に連絡してください。"
+
+#~ msgid ""
+#~ "You do not have sufficient permissions to update XPressME Integration Kit "
+#~ "for this site."
+#~ msgstr "あなたには、 XPressME Integration Kit の更新権限がありません。"
 
 #~ msgid ""
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-lang.pot
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-lang.pot	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-lang.pot	(revision 723)
@@ -8,5 +8,5 @@
 "Project-Id-Version: XPressME Plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-04-23 10:02+0900\n"
+"POT-Creation-Date: 2011-04-29 14:11+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -547,4 +547,8 @@
 msgstr ""
 
+#: include/class-xpress-upgrader.php:14
+msgid "The structure of the package is wrong. "
+msgstr ""
+
 #: include/custom_functions.php:113
 #, php-format
@@ -833,17 +837,18 @@
 msgstr ""
 
-#: include/xpress_upgrade.php:205
-msgid "You do not have sufficient permissions to update XPressME Integration Kit for this site."
+#: include/xpress_upgrade.php:369
+#, php-format
+msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
 msgstr ""
 
 #: include/xpress_upgrade.php:371
 #, php-format
-msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
-msgstr ""
-
-#: include/xpress_upgrade.php:373
-#, php-format
 msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
 msgstr ""
+
+#~ msgid ""
+#~ "You do not have sufficient permissions to update XPressME Integration Kit "
+#~ "for this site."
+#~ msgstr ""
 
 #~ msgid ""
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-pt_BR.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-pt_BR.po	(revision 722)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-pt_BR.po	(revision 723)
@@ -7,6 +7,6 @@
 "Project-Id-Version: XPressME Plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-04-23 10:02+0900\n"
-"PO-Revision-Date: 2011-04-23 10:14+0900\n"
+"POT-Creation-Date: 2011-04-29 14:11+0900\n"
+"PO-Revision-Date: 2011-04-29 14:15+0900\n"
 "Last-Translator: toemon <info@toemon.com>\n"
 "Language-Team: Marcelo Yuji Himoro <yuji@yuji.ws>\n"
@@ -552,4 +552,8 @@
 msgstr "Não pôde apagar arquivos."
 
+#: include/class-xpress-upgrader.php:14
+msgid "The structure of the package is wrong. "
+msgstr "A estrutura do pacote está errada. "
+
 #: include/custom_functions.php:113
 #, php-format
@@ -838,17 +842,20 @@
 msgstr "Vá para Atualização de Módulo"
 
-#: include/xpress_upgrade.php:205
-msgid "You do not have sufficient permissions to update XPressME Integration Kit for this site."
-msgstr "O senhor não tem permissões suficientes para atualizar XPressME Integration Kit ara este local."
-
-#: include/xpress_upgrade.php:371
+#: include/xpress_upgrade.php:369
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
 msgstr "O XPressME Integration Kit %1$s está disponível! <a href=\"%2$s\">Por favor, atualize agora</a>."
 
-#: include/xpress_upgrade.php:373
+#: include/xpress_upgrade.php:371
 #, php-format
 msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
 msgstr "O XPressME Integration Kit Versão %1$s está disponível! Por favor, avise o administrador do site."
+
+#~ msgid ""
+#~ "You do not have sufficient permissions to update XPressME Integration Kit "
+#~ "for this site."
+#~ msgstr ""
+#~ "O senhor não tem permissões suficientes para atualizar XPressME "
+#~ "Integration Kit ara este local."
 
 #~ msgid ""
