VirtualBox

Changeset 1495 in vbox


Ignore:
Timestamp:
Mar 15, 2007 1:19:30 AM (18 years ago)
Author:
vboxsync
Message:

Set VBOX_XPCOM_HOME like the default glue code in Main/glue. No reason why all the other apps should work fine but not the Qt GUI.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/COMDefs.cpp

    r1473 r1495  
    6565#undef ASSERT
    6666#include <VBox/com/assert.h>
     67#include <iprt/env.h>
     68#include <iprt/path.h>
     69#include <iprt/param.h>
     70#include <iprt/err.h>
    6771
    6872nsIComponentManager *COMBase::gComponentManager = nsnull;
     
    137141        LogFlowFuncLeave();
    138142        return S_OK;
     143    }
     144
     145    /*
     146     * Set VBOX_XPCOM_HOME if not present like we do in the common glue code.
     147     * (XPCOMGlueStartup will query this.)
     148     */
     149    if (!RTEnvExist ("VBOX_XPCOM_HOME"))
     150    {
     151        /* get the executable path */
     152        char szPathProgram [RTPATH_MAX];
     153        int rcVBox = RTPathProgram (szPathProgram, sizeof (szPathProgram));
     154        if (RT_SUCCESS (rcVBox))
     155            RTEnvSet ("VBOX_XPCOM_HOME", szPathProgram);
    139156    }
    140157
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r1435 r1495  
    112112}
    113113
    114 #ifdef __DARWIN__
    115 #include <iprt/path.h>
    116 #include <iprt/process.h>
    117 #include <iprt/env.h>
    118 
    119 /**
    120  * App bundle tweaks.
    121  */
    122 static void DarwinInit (void)
    123 {
    124     /* This probably belongs else where. */
    125     static struct
    126     {
    127         char var[sizeof ("VBOX_XPCOM_HOME=") - 1];
    128         char path[RTPATH_MAX];
    129     } s;
    130 
    131     strcpy (s.var, "VBOX_XPCOM_HOME=");
    132     int rc = RTPathProgram (&s.path[0], sizeof (s.path));
    133     if (RT_FAILURE (rc))
    134     {
    135         RTPrintf ("RTPathProgram failed!\n");
    136         exit (1);
    137     }
    138 
    139     if (!RTEnvGet ("VBOX_XPCOM_HOME"))
    140         RTEnvPut (s.var);
    141 
    142     /** @todo automatically start VBoxSVC. */
    143 }
    144 
    145 #endif
    146 
    147 
    148114int main( int argc, char ** argv )
    149115{
     
    162128    sigaction (SIGBUS, &sa, NULL);
    163129    sigaction (SIGUSR1, &sa, NULL);
    164 #endif
    165 
    166 #ifdef __DARWIN__
    167     DarwinInit();
    168130#endif
    169131
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette