View | Details | Raw Unified | Return to issue 119950
Collapse All | Expand All

(-)desktop/inc/app.hxx (+1 lines)
Lines 74-79 Link Here
74
            BE_LANGUAGE_MISSING,
74
            BE_LANGUAGE_MISSING,
75
            BE_USERINSTALL_NOTENOUGHDISKSPACE,
75
            BE_USERINSTALL_NOTENOUGHDISKSPACE,
76
            BE_USERINSTALL_NOWRITEACCESS,
76
            BE_USERINSTALL_NOWRITEACCESS,
77
            BE_MUTLISESSION_NOT_SUPPROTED,
77
            BE_OFFICECONFIG_BROKEN
78
            BE_OFFICECONFIG_BROKEN
78
		};
79
		};
79
        enum BootstrapStatus
80
        enum BootstrapStatus
(-)desktop/source/app/app.cxx (-4 / +18 lines)
Lines 243-248 Link Here
243
static const ::rtl::OUString CFG_PACKAGE_COMMON_HELP   ( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Help"));
243
static const ::rtl::OUString CFG_PACKAGE_COMMON_HELP   ( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Help"));
244
244
245
static ::rtl::OUString getBrandSharePreregBundledPathURL();
245
static ::rtl::OUString getBrandSharePreregBundledPathURL();
246
// #i119950# Add a option that not to display the "Fatal Error" on dialog title
247
void FatalError(const ::rtl::OUString& sMessage, const sal_Bool isDisplayErrorString = sal_True);
246
// ----------------------------------------------------------------------------
248
// ----------------------------------------------------------------------------
247
249
248
ResMgr* Desktop::GetDesktopResManager()
250
ResMgr* Desktop::GetDesktopResManager()
Lines 354-360 Link Here
354
//
356
//
355
// Thats why we have to use a special native message box here which does not use yield :-)
357
// Thats why we have to use a special native message box here which does not use yield :-)
356
//=============================================================================
358
//=============================================================================
357
void FatalError(const ::rtl::OUString& sMessage)
359
void FatalError(const ::rtl::OUString& sMessage, const sal_Bool isDisplayErrorString)
358
{
360
{
359
    ::rtl::OUString sProductKey = ::utl::Bootstrap::getProductKey();
361
    ::rtl::OUString sProductKey = ::utl::Bootstrap::getProductKey();
360
    if ( ! sProductKey.getLength())
362
    if ( ! sProductKey.getLength())
Lines 369-376 Link Here
369
371
370
    ::rtl::OUStringBuffer sTitle (128);
372
    ::rtl::OUStringBuffer sTitle (128);
371
    sTitle.append      (sProductKey     );
373
    sTitle.append      (sProductKey     );
372
    sTitle.appendAscii (" - Fatal Error");
374
	if (isDisplayErrorString) {
373
375
		sTitle.appendAscii (" - Fatal Error");
376
	}
374
    Application::ShowNativeErrorBox (sTitle.makeStringAndClear (), sMessage);
377
    Application::ShowNativeErrorBox (sTitle.makeStringAndClear (), sMessage);
375
    _exit(ExitHelper::E_FATAL_ERROR);
378
    _exit(ExitHelper::E_FATAL_ERROR);
376
}
379
}
Lines 995-1001 Link Here
995
        if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR )
998
        if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR )
996
        {
999
        {
997
            SetBootstrapError( BE_PATHINFO_MISSING );
1000
            SetBootstrapError( BE_PATHINFO_MISSING );
1001
			
998
        }
1002
        }
1003
        else if ( aStatus == OfficeIPCThread::IPC_STATUS_MULTI_TS_ERROR )
1004
        {
1005
            SetBootstrapError( BE_MUTLISESSION_NOT_SUPPROTED );
1006
        }
999
        else if ( aStatus == OfficeIPCThread::IPC_STATUS_2ND_OFFICE )
1007
        else if ( aStatus == OfficeIPCThread::IPC_STATUS_2ND_OFFICE )
1000
        {
1008
        {
1001
            // 2nd office startup should terminate after sending cmdlineargs through pipe
1009
            // 2nd office startup should terminate after sending cmdlineargs through pipe
Lines 1241-1247 Link Here
1241
1249
1242
void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
1250
void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
1243
{
1251
{
1244
    if ( aBootstrapError == BE_PATHINFO_MISSING )
1252
	if ( aBootstrapError == BE_MUTLISESSION_NOT_SUPPROTED ) {
1253
		OUString        aMessage;
1254
		aMessage = GetMsgString( STR_BOOTSTRAP_ERR_MULTISESSION,
1255
                        OUString( RTL_CONSTASCII_USTRINGPARAM( "You have another instance running in a different terminal session. Close that instance and then try again." )) );
1256
        FatalError(aMessage,sal_False);
1257
1258
	} else if ( aBootstrapError == BE_PATHINFO_MISSING )
1245
    {
1259
    {
1246
        OUString                    aErrorMsg;
1260
        OUString                    aErrorMsg;
1247
        OUString                    aBuffer;
1261
        OUString                    aBuffer;
(-)desktop/source/app/desktop.hrc (+1 lines)
Lines 67-72 Link Here
67
#define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE	(RID_DESKTOP_STRING_START+121)
67
#define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE	(RID_DESKTOP_STRING_START+121)
68
#define STR_BOOTSTRAP_ERR_CFG_DATAACCESS	(RID_DESKTOP_STRING_START+122)
68
#define STR_BOOTSTRAP_ERR_CFG_DATAACCESS	(RID_DESKTOP_STRING_START+122)
69
#define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE (RID_DESKTOP_STRING_START+123)
69
#define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE (RID_DESKTOP_STRING_START+123)
70
#define STR_BOOTSTRAP_ERR_MULTISESSION       (RID_DESKTOP_STRING_START+124)
70
71
71
#define STR_ASK_START_SETUP_MANUALLY		(RID_DESKTOP_STRING_START+152)
72
#define STR_ASK_START_SETUP_MANUALLY		(RID_DESKTOP_STRING_START+152)
72
73
(-)desktop/source/app/desktop.src (+5 lines)
Lines 94-99 Link Here
94
	Text [ en-US ] = "The configuration service is not available.";
94
	Text [ en-US ] = "The configuration service is not available.";
95
};
95
};
96
96
97
String STR_BOOTSTRAP_ERR_MULTISESSION
98
{
99
	Text [ en-US ] = "You have another instance running in a different terminal session. Close that instance and then try again.";
100
};
101
97
String STR_ASK_START_SETUP_MANUALLY
102
String STR_ASK_START_SETUP_MANUALLY
98
{
103
{
99
	Text [ en-US ] = "Start the setup application to repair the installation from the CD or the folder containing the installation packages.";
104
	Text [ en-US ] = "Start the setup application to repair the installation from the CD or the folder containing the installation packages.";
(-)desktop/source/app/officeipcthread.cxx (-7 / +20 lines)
Lines 496-512 Link Here
496
	do
496
	do
497
	{
497
	{
498
		OSecurity &rSecurity = Security::get();
498
		OSecurity &rSecurity = Security::get();
499
		// Try to create pipe
499
		// #119950# Try to connect pipe first. If connected, means another instance already launched.
500
		if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Create, rSecurity ))
500
		if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Open, rSecurity )) 
501
		{
501
		{
502
			// #119950# Test if launched in a new terminal session for same user. On Windows platform, normally a user is resticted
503
			// to have only one terminal session. But if mutiple terminal session for one user is allowed, crash will happen if launched
504
			// OpenOffice from more than one terminal session. So need to detect and prevent this happen.
505
506
			// Will try to create a same name pipe. If creation is successfully, means current instance is launched in a new session.
507
			vos::OPipe	maSessionPipe;
508
			if ( maSessionPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Create, rSecurity )) {
509
				// Can create a pipe with same name. This can only happen in multiple terminal session environment on Windows platform.
510
				// Will display a warning dialog and exit.
511
				return IPC_STATUS_MULTI_TS_ERROR;
512
			} else {
513
				// Pipe connected to first office
514
				nPipeMode = PIPEMODE_CONNECTED;
515
			}
516
517
		}
518
		else if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Create, rSecurity )) // Connection not successfull, now we try to create
519
		{
502
			// Pipe created
520
			// Pipe created
503
			nPipeMode = PIPEMODE_CREATED;
521
			nPipeMode = PIPEMODE_CREATED;
504
		}
522
		}
505
		else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Open, rSecurity )) // Creation not successfull, now we try to connect
506
		{
507
			// Pipe connected to first office
508
			nPipeMode = PIPEMODE_CONNECTED;
509
		}
510
		else
523
		else
511
		{
524
		{
512
			OPipe::TPipeError eReason = pThread->maPipe.getError();
525
			OPipe::TPipeError eReason = pThread->maPipe.getError();
(-)desktop/source/app/officeipcthread.hxx (-1 / +2 lines)
Lines 107-113 Link Here
107
	{
107
	{
108
		IPC_STATUS_OK,
108
		IPC_STATUS_OK,
109
		IPC_STATUS_2ND_OFFICE,
109
		IPC_STATUS_2ND_OFFICE,
110
		IPC_STATUS_BOOTSTRAP_ERROR
110
		IPC_STATUS_BOOTSTRAP_ERROR,
111
		IPC_STATUS_MULTI_TS_ERROR
111
	};
112
	};
112
113
113
	virtual ~OfficeIPCThread();
114
	virtual ~OfficeIPCThread();

Return to issue 119950