Kaydet (Commit) f97c9c25 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

migrateSettingsIfNecessary must be called later after all

...once e.g. UCB is already initialized, as the invoked migration services use it.
üst 02888164
......@@ -36,6 +36,7 @@
#include "userinstall.hxx"
#include "desktopcontext.hxx"
#include "exithelper.hxx"
#include "migration.hxx"
#include <svtools/javacontext.hxx>
#include <com/sun/star/frame/XSessionManagerListener.hpp>
......@@ -1476,23 +1477,21 @@ int Desktop::Main()
SetSplashScreenProgress(10);
UserInstall::UserInstallStatus inst_fin = UserInstall::finalize();
if (inst_fin != UserInstall::Ok && inst_fin != UserInstall::Created)
{
UserInstall::UserInstallError instErr_fin = UserInstall::finalize();
if ( instErr_fin != UserInstall::E_None)
{
OSL_FAIL("userinstall failed");
if ( instErr_fin == UserInstall::E_NoDiskSpace )
HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE );
else if ( instErr_fin == UserInstall::E_NoWriteAccess )
HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
else
HandleBootstrapErrors( BE_USERINSTALL_FAILED );
return EXIT_FAILURE;
}
// refresh path information
utl::Bootstrap::reloadData();
SetSplashScreenProgress(20);
OSL_FAIL("userinstall failed");
if ( inst_fin == UserInstall::E_NoDiskSpace )
HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE );
else if ( inst_fin == UserInstall::E_NoWriteAccess )
HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
else
HandleBootstrapErrors( BE_USERINSTALL_FAILED );
return EXIT_FAILURE;
}
// refresh path information
utl::Bootstrap::reloadData();
SetSplashScreenProgress(20);
Reference< XMultiServiceFactory > xSMgr =
::comphelper::getProcessServiceFactory();
......@@ -1623,6 +1622,11 @@ int Desktop::Main()
// check whether the shutdown is caused by restart
pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
if (inst_fin == UserInstall::Created)
{
Migration::migrateSettingsIfNecessary();
}
#endif
// keep a language options instance...
......
......@@ -28,7 +28,6 @@
#include "sal/config.h"
#include "migration.hxx"
#include "userinstall.hxx"
#include "langselect.hxx"
......@@ -68,7 +67,7 @@ using namespace com::sun::star::util;
namespace desktop {
static UserInstall::UserInstallError create_user_install(OUString&);
static UserInstall::UserInstallStatus create_user_install(OUString&);
static bool is_user_install()
{
......@@ -95,7 +94,7 @@ namespace desktop {
return false;
}
UserInstall::UserInstallError UserInstall::finalize()
UserInstall::UserInstallStatus UserInstall::finalize()
{
OUString aUserInstallPath;
utl::Bootstrap::PathStatus aLocateResult =
......@@ -114,7 +113,7 @@ namespace desktop {
// path exists, check if an installation lives there
if ( is_user_install() )
{
return E_None;
return Ok;
}
// Note: fall-thru intended.
}
......@@ -185,7 +184,7 @@ namespace desktop {
return err;
}
static UserInstall::UserInstallError create_user_install(OUString& aUserPath)
static UserInstall::UserInstallStatus create_user_install(OUString& aUserPath)
{
OUString aBasePath;
if (utl::Bootstrap::locateBaseInstallation(aBasePath) != utl::Bootstrap::PATH_EXISTS)
......@@ -216,8 +215,6 @@ namespace desktop {
else
return UserInstall::E_Creation;
}
Migration::migrateSettingsIfNecessary();
#endif
boost::shared_ptr< comphelper::ConfigurationChanges > batch(
......@@ -225,7 +222,7 @@ namespace desktop {
officecfg::Setup::Office::ooSetupInstCompleted::set(true, batch);
batch->commit();
return UserInstall::E_None;
return UserInstall::Created;
}
}
......
......@@ -36,8 +36,9 @@ namespace desktop
class UserInstall
{
public:
enum UserInstallError {
E_None, // no error
enum UserInstallStatus {
Ok, // no error, existing user installation found
Created, // no error, new user installation created
E_Creation, // error while creating user install
E_InvalidBaseinstall, // corrupt base installation
E_SetupFailed, // external setup did not run correctly
......@@ -48,7 +49,7 @@ public:
E_Unknown // unknown error
};
static UserInstallError finalize();
static UserInstallStatus finalize();
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment