diff options
Diffstat (limited to 'desktop/source/deployment')
7 files changed, 18 insertions, 12 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index 29ded177175a..7795e3093cc3 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -1124,7 +1124,7 @@ void ExtensionCmdQueue::acceptLicense( const uno::Reference< deployment::XPackag void ExtensionCmdQueue::syncRepositories( const uno::Reference< uno::XComponentContext > &xContext ) { - dp_misc::syncRepositories( new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) ); + dp_misc::syncRepositories( false, new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) ); } void ExtensionCmdQueue::stop() diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h index 29fd14007d71..06e67aa1cde8 100644 --- a/desktop/source/deployment/inc/dp_misc.h +++ b/desktop/source/deployment/inc/dp_misc.h @@ -154,8 +154,10 @@ void TRACE(::rtl::OUString const & sText); recently added or removed. */ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC -void syncRepositories(::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv); +void syncRepositories( + bool force, + ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv); } diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 68403f1af6cb..b3c21b4db52e 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1205,9 +1205,10 @@ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > > } } -//only to be called from unopkg!!! +// Only to be called from unopkg or soffice bootstrap (with force=true in the +// latter case): void ExtensionManager::reinstallDeployedExtensions( - OUString const & repository, + sal_Bool force, OUString const & repository, Reference<task::XAbortChannel> const & xAbortChannel, Reference<ucb::XCommandEnvironment> const & xCmdEnv ) throw (deploy::DeploymentException, @@ -1220,10 +1221,11 @@ void ExtensionManager::reinstallDeployedExtensions( xPackageManager = getPackageManager(repository); ::osl::MutexGuard guard(getMutex()); - xPackageManager->reinstallDeployedPackages(xAbortChannel, xCmdEnv); + xPackageManager->reinstallDeployedPackages( + force, xAbortChannel, xCmdEnv); //We must sync here, otherwise we will get exceptions when extensions //are removed. - dp_misc::syncRepositories(xCmdEnv); + dp_misc::syncRepositories(force, xCmdEnv); const uno::Sequence< Reference<deploy::XPackage> > extensions( xPackageManager->getDeployedPackages(xAbortChannel, xCmdEnv)); diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 22e2d41c20b9..ec1edbc7081c 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -182,7 +182,7 @@ public: css::uno::RuntimeException); virtual void SAL_CALL reinstallDeployedExtensions( - ::rtl::OUString const & repository, + sal_Bool force, ::rtl::OUString const & repository, css::uno::Reference< css::task::XAbortChannel> const & xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment> const & xCmdEnv ) throw ( diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 8a08320cd6ea..8e3d109f08c4 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1164,14 +1164,14 @@ PackageManagerImpl::getDeployedPackages( //ToDo: the function must not call registerPackage, do this in //XExtensionManager.reinstallDeployedExtensions void PackageManagerImpl::reinstallDeployedPackages( - Reference<task::XAbortChannel> const & /*xAbortChannel*/, + sal_Bool force, Reference<task::XAbortChannel> const & /*xAbortChannel*/, Reference<XCommandEnvironment> const & xCmdEnv_ ) throw (deployment::DeploymentException, CommandFailedException, CommandAbortedException, lang::IllegalArgumentException, RuntimeException) { check(); - if (office_is_running()) + if (!force && office_is_running()) throw RuntimeException( OUSTR("You must close any running Office process before " "reinstalling packages!"), static_cast<OWeakObject *>(this) ); diff --git a/desktop/source/deployment/manager/dp_manager.h b/desktop/source/deployment/manager/dp_manager.h index 3b335d7e2362..3c7f8d9f7f82 100644 --- a/desktop/source/deployment/manager/dp_manager.h +++ b/desktop/source/deployment/manager/dp_manager.h @@ -236,6 +236,7 @@ public: css::uno::RuntimeException); virtual void SAL_CALL reinstallDeployedPackages( + sal_Bool force, css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel, css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv ) throw (css::deployment::DeploymentException, diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index b225db620b5c..9ed579fbb97c 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -591,7 +591,7 @@ void TRACE(::rtl::OString const & sText) } void syncRepositories( - Reference<ucb::XCommandEnvironment> const & xCmdEnv) + bool force, Reference<ucb::XCommandEnvironment> const & xCmdEnv) { OUString sDisable; ::rtl::Bootstrap::get( OUSTR( "DISABLE_EXTENSION_SYNCHRONIZATION" ), sDisable, OUString() ); @@ -602,7 +602,8 @@ void syncRepositories( //synchronize shared before bundled otherewise there are //more revoke and registration calls. sal_Bool bModified = false; - if (needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("shared"))) + if (force + || needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("shared"))) || needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("bundled")))) { xExtensionManager = |