Hi Wei,

Wei Min Teo wrote:
> I used the sample code from this url 
> :http://wiki.services.openoffice.org/wiki/UNO_registery_and_Bootstrapping 
> under "The new ::cppu::bootstrap() function".

Thank you for the information. Now I understand.
What I have just learned from that are

It seems that ::cppu::bootstrap()
(a) will not give an option "-nofirststartwizard" to soffice.exe
    Therefore, you, in behalf of the user account, will need to accept the 
license agreement first.

(b) is intended to be used by a program from which soffice.bin will be remotely 
controlled.
    bootstrap() will create a random pipe name, which cannot be guessed by 
other program.


So, what shall we do?
I am not sure. Here is just one idea.

(1) Start soffice.exe as normal user account with the following command line 
options.
soffice.exe -nofirststartwizard -nologo -nodefault -norestore -nocrashreport 
-nolockcheck "-accept=pipe,name=MY_FAVORITE_NAME;urp;"

(2) And then use a conventional way to establish a connection to the process of 
soffice.bin which is listening to the named pipe MY_FAVORITE_NAME.


========================================================================
http://svn.services.openoffice.org/ooo/trunk/cppuhelper/source/bootstrap.cxx
namespace cppu
{

Reference< XComponentContext > SAL_CALL bootstrap()
{

        // create a random pipe name
        ...
        OUString sPipeName( buf.makeStringAndClear() );

        // accept string
        OSL_ASSERT( buf.getLength() == 0 );
        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "-accept=pipe,name=" ) );
        buf.append( sPipeName );
        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ";urp;" ) );

        // arguments
        OUString args [] = {
            OUSTR( "-nologo" ),
            OUSTR( "-nodefault" ),
            OUSTR( "-norestore" ),
            OUSTR( "-nocrashreport" ),
            OUSTR( "-nolockcheck" ),

========================================================================
http://svn.services.openoffice.org/ooo/trunk/desktop/source/app/app.cxx
        // First Start Wizard allowed ?
        if ( ! pCmdLineArgs->IsNoFirstStartWizard())

========================================================================
http://svn.services.openoffice.org/ooo/trunk/desktop/source/app/cmdlineargs.cxx
sal_Bool CommandLineArgs::IsNoFirstStartWizard() const
{
    osl::MutexGuard  aMutexGuard( m_aMutex );
    return m_aBoolParams[ CMD_BOOLPARAM_NOFIRSTSTARTWIZARD ];
}

    else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"-nofirststartwizard" )) == sal_True )
    {
        SetBoolParam_Impl( CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, sal_True );
        return sal_True;
    }

========================================================================

Tora


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to