Issue 11219 - Command line parameter -userid does not work.
Summary: Command line parameter -userid does not work.
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 644
Hardware: All SunOS
: P3 Trivial (vote)
Target Milestone: OOo 1.1 Beta
Assignee: thorsten.martens
QA Contact: issues@framework
URL: http://www.openoffice.org/files/docum...
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-05 17:05 UTC by joerg.barfurth
Modified: 2003-03-13 11:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description joerg.barfurth 2003-02-05 17:05:52 UTC
The command line parameter -userid=.. does not work as advertised in the
document at <URL (see above)>. There are two ways to fix this: One is to correct
that document, the other is to reactivate the functionality. I propose to do
that latter and actually can propose how a simple fix should look like.

From a glance at the code: This parameter is still parsed, but it is then passed
to code that does not use it, except in some webtop-specific code that is not
even built.

Instead the info where the user-installation is, is taken from the bootstrap
parameter 'UserInstallation' which is read from $SYSBINDIR/bootstraprc (or
bootstrap.ini on non-unx systems) in the normal case.

There already is a way to override this on the command line by specifying
-env:UserInstallation=<file-url>. But this method is tedious, because the user
needs to specify a correct file URL (as required by osl). Thus it makes sense to
revive the -userid= parameter, if it can be made to accept ordinary
system-specific pathes.

This can be done as follows:

  if (GetCommandLineArgs()->getUserDir(aUserDir))
  {
    OUString aUserDirURL;
    if (osl::File::getFileUrlFromSystemPath(aUserDir,aUserDirURL) != 0)
         /* Handle the error */;

    // now must be a valid file URL. For best results make absolute using
    //
osl::File::getAbsoluteFileURL(getProcessWorkingDirectory(),aUserDirURL,aUserDirURL)
    
    // now override the bootstrap setting:
    rtl::Bootstrap::set( OUString("UserInstallation"), aUserDirURL)
  }

This change of bootstrap parameters should of course be done before trying to
use the setting. This means the change should at least be done before
initializing UNO.
Comment 1 lo 2003-02-06 14:46:49 UTC
taking over..
Comment 2 carsten.driesner 2003-02-12 14:25:51 UTC
I will take over again.
Comment 3 Joost Andrae 2003-02-17 11:43:45 UTC
JA: re-prioritized according to new priority guide lines
Comment 4 carsten.driesner 2003-02-17 14:15:17 UTC
CD: I think this could be a valueable fix for some people so I going 
to work on it.
Comment 5 carsten.driesner 2003-02-17 17:25:55 UTC
CD: Fixed for next beta build.
Comment 6 carsten.driesner 2003-02-19 15:04:50 UTC
CD->TM: Please check this bugfix.

Information:
You can now provide the user installation base directory to the 
Office. The command line parameter is called "-userid". 
Important: You have to provide the base directory as a system path, 
that means the folder which contains "user"! If you provide a wrong 
path the Office fallback to the standard user installation.

Usage:
soffice -userid=<Path to base of user installation>

Example:
soffice "-userid=d:\StarOffice 6.1"
Comment 7 carsten.driesner 2003-02-19 15:05:30 UTC
.
Comment 8 thorsten.martens 2003-02-20 10:39:07 UTC
Checked and verified in "cws basetech" (internal 644 build) -> OK
Comment 9 thorsten.martens 2003-02-20 10:39:24 UTC
.
Comment 10 michael.bemmer 2003-03-13 11:09:43 UTC
As mentioned on the qa dev list on March 5th I will close all resolved
<wontfix/duplicate/worksforme/invalid> issues. Please see this posting for details.