diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 24b5712ebd30..de9d97db2b48 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -853,7 +853,7 @@ void ExtensionManager::enableExtension( /** */ -long ExtensionManager::checkPrerequisitesAndEnable( +sal_Int32 ExtensionManager::checkPrerequisitesAndEnable( Reference const & extension, Reference const & xAbortChannel, Reference const & xCmdEnv) @@ -1174,7 +1174,7 @@ sal_Bool ExtensionManager::synchronize( } catch (...) { uno::Any exc = ::cppu::getCaughtException(); throw deploy::DeploymentException( - OUSTR("Extension Manager: exception during enableExtension"), + OUSTR("Extension Manager: exception in synchronize"), static_cast(this), exc); } } diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 54624514adce..64cada7da3ac 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -129,7 +129,7 @@ public: css::uno::RuntimeException); - virtual long SAL_CALL checkPrerequisitesAndEnable( + virtual sal_Int32 SAL_CALL checkPrerequisitesAndEnable( css::uno::Reference const & extension, css::uno::Reference const & xAbortChannel, css::uno::Reference const & xCmdEnv ) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 409cf2674184..44bc4d469f2f 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -183,7 +183,8 @@ void PackageManagerImpl::initActivationLayer( OSL_ASSERT( m_activePackages.getLength() > 0 ); m_activePackages_expanded = expandUnoRcUrl( m_activePackages ); m_registrationData_expanded = expandUnoRcUrl(m_registrationData); - create_folder( 0, m_activePackages_expanded, xCmdEnv, true); + if (!m_readOnly) + create_folder( 0, m_activePackages_expanded, xCmdEnv, true); OUString dbName; if (m_context.equals(OUSTR("user"))) @@ -1341,9 +1342,14 @@ bool PackageManagerImpl::synchronizeAddedExtensions( { bool bModified = false; ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); - + //check if the folder exist at all. The shared extension folder + //may not exist for a normal user. + if (!create_ucb_content( + NULL, m_activePackages_expanded, Reference(), false)) + return bModified; ::ucbhelper::Content tempFolder( m_activePackages_expanded, xCmdEnv ); + Reference xResultSet( tempFolder.createCursor( Sequence( &StrTitle::get(), 1 ), diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 1f4a62e696d7..14b4f2374c5b 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -425,14 +425,24 @@ Reference BackendDb::writeKeyElement( const Reference doc = getDocument(); const Reference root = doc->getFirstChild(); -#if OSL_DEBUG_LEVEL > 0 - //There must not be yet an entry with the same url + //Check if there are an entry with the same url. This can be the case if the + //the status of an XPackage is ambiguous. In this case a call to activateExtension + //(dp_extensionmanager.cxx), will register the package again. See also + //Package::processPackage_impl in dp_backend.cxx. + //A package can become + //invalid after its successful registration, for example if a second extension with + //the same service is installed. const OUString sExpression( sPrefix + OUSTR(":") + sElementName + OUSTR("[@url = \"") + url + OUSTR("\"]")); - const Reference _extensionNode = + const Reference existingNode = getXPathAPI()->selectSingleNode(root, sExpression); - OSL_ASSERT(! _extensionNode.is()); -#endif + if (existingNode.is()) + { + OSL_ASSERT(0); + //replace the existing entry. + removeEntry(url); + } + const Reference keyElement( doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sElementName)); diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index c72a97d88891..968ee7297b0f 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -254,9 +254,8 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( OSL_ASSERT(0); //This won't have affect on Windows - if (osl::File::E_None != osl::File::setAttributes( - dp_misc::expandUnoRcUrl(m_url), attributes)) - OSL_ENSURE(0, "Extension Manager: Could not set executable file attribute."); + osl::File::setAttributes( + dp_misc::expandUnoRcUrl(m_url), attributes); } getMyBackend()->addDataToDb(getURL()); } diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 621b8b0bac7c..a9a0c8271373 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -108,6 +108,8 @@ const char s_usingText [] = " deployment context;\n" " run only when no concurrent Office\n" " process(es) are running!\n" +" --bundled expert feature: operate on bundled extensions. Only\n" +" works with list, validate, reinstall;\n" " --deployment-context expert feature: explicit deployment context\n" " \n" "\n"