From 1f14c9a1f1dd29dbef6a96e051cd992a7aa593fc Mon Sep 17 00:00:00 2001 From: "Koushik K. Dutta" Date: Thu, 11 Feb 2010 23:08:23 -0800 Subject: [PATCH] Need to call register_package_root prior to installing the package. The subsequent unregistering made me think that it was being registered at some point, but it was removed in the transition to eclair. The unregistration was dead code. It is being used now though. --- install.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/install.c b/install.c index 5a829d1..3a37b4a 100644 --- a/install.c +++ b/install.c @@ -243,12 +243,16 @@ handle_update_package(const char *path, ZipArchive *zip) ui_print("Installing update...\n"); int result = try_update_binary(path, zip); - if (result == INSTALL_UPDATE_BINARY_MISSING) - { - const ZipEntry *script_entry; - script_entry = find_update_script(zip); - result = handle_update_script(zip, script_entry); - } + if (result == INSTALL_UPDATE_BINARY_MISSING) + { + if (register_package_root(zip, path) < 0) { + LOGE("Can't register package root\n"); + return INSTALL_ERROR; + } + const ZipEntry *script_entry; + script_entry = find_update_script(zip); + result = handle_update_script(zip, script_entry); + } register_package_root(NULL, NULL); // Unregister package root return result; }