QAR-1018 Lightweight Windows Setup App (windows-setup-3). svn merge -r102882:102883 svn+ssh://svn.lindenlab.com/svn/linden/branches/windows-setup/windows-setup-3-merge

master
James Cook 2008-11-19 23:26:29 +00:00
parent 2d2d427158
commit 2a44e81675
27 changed files with 199 additions and 116 deletions

View File

@ -73,7 +73,9 @@ if (VIEWER)
add_dependencies(viewer mac-updater mac-crash-logger)
elseif (WINDOWS)
add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
add_subdirectory(${VIEWER_PREFIX}win_setup)
add_subdirectory(${VIEWER_PREFIX}win_updater)
# add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
add_dependencies(viewer windows-updater windows-crash-logger)
elseif (SOLARIS)
add_subdirectory(solaris_crash_logger)

View File

@ -28,6 +28,7 @@ set(cmake_SOURCE_FILES
FindELFIO.cmake
FindGooglePerfTools.cmake
FindMono.cmake
FindMT.cmake
FindMySQL.cmake
FindOpenJPEG.cmake
FindXmlRpcEpi.cmake

15
indra/cmake/FindMT.cmake Normal file
View File

@ -0,0 +1,15 @@
#Find the windows manifest tool.
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
PATHS
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
IF(HAVE_MANIFEST_TOOL)
MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
ELSE(HAVE_MANIFEST_TOOL)
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
ENDIF(HAVE_MANIFEST_TOOL)
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})

View File

@ -613,7 +613,7 @@ setup_platform = {
usage_msg = '''
Usage: develop.py [options] command [command-options]
Usage: develop.py [options] [command [command-options]]
Options:
-h | --help print this help message
@ -623,21 +623,27 @@ Options:
-t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo")
-N | --no-distcc disable use of distcc
-G | --generator=NAME generator name
Windows: VC71 or VS2003 (default), VC80 (VS2005) or VC90 (VS2008)
Windows: VC71 or VS2003 (default), VC80 (VS2005) or
VC90 (VS2008)
Mac OS X: Xcode (default), Unix Makefiles
Linux: Unix Makefiles (default), KDevelop3
Commands:
build configure and build default target
clean delete all build directories (does not affect sources)
configure configure project by running cmake
build configure and build default target
clean delete all build directories, does not affect sources
configure configure project by running cmake (default command if none given)
If you do not specify a command, the default is "configure".
Command-options for "configure":
We use cmake variables to change the build configuration.
-DSERVER:BOOL=OFF Don't configure simulator/dataserver/etc
-DVIEWER:BOOL=OFF Don't configure the viewer
-DPACKAGE:BOOL=ON Create "package" target to make installers
-DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language
Examples:
Set up a viewer-only project for your system:
develop.py configure -DSERVER:BOOL=OFF
Set up a Visual Studio 2005 project with package target (to build installer):
Set up a Visual Studio 2005 project with "package" target:
develop.py -G vc80 configure -DPACKAGE:BOOL=ON
'''

View File

@ -38,6 +38,7 @@
#include "llstring.h"
// Project includes
#include "llhtmlhelp.h"
#include "llkeyboard.h"
#include "llui.h"
#include "lluiconstants.h"

View File

@ -30,8 +30,6 @@
*/
// Utilities functions the user interface needs
//#include "llviewerprecompiledheaders.h"
#include "linden_common.h"
#include <string>
@ -1647,6 +1645,34 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y)
setCursorPositionScreen(screen_x, screen_y);
}
// On Windows, the user typically sets the language when they install the
// app (by running it with a shortcut that sets InstallLanguage). On Mac,
// or on Windows if the SecondLife.exe executable is run directly, the
// language follows the OS language. In all cases the user can override
// the language manually in preferences. JC
// static
std::string LLUI::getLanguage()
{
std::string language = "en-us";
if (sConfigGroup)
{
language = sConfigGroup->getString("Language");
if (language.empty() || language == "default")
{
language = sConfigGroup->getString("InstallLanguage");
}
if (language.empty() || language == "default")
{
language = sConfigGroup->getString("SystemLanguage");
}
if (language.empty() || language == "default")
{
language = "en-us";
}
}
return language;
}
//static
std::string LLUI::locateSkin(const std::string& filename)
{
@ -1660,11 +1686,7 @@ std::string LLUI::locateSkin(const std::string& filename)
{
if (!gDirUtilp->fileExists(found_file))
{
std::string localization(sConfigGroup->getString("Language"));
if(localization == "default")
{
localization = sConfigGroup->getString("SystemLanguage");
}
std::string localization = getLanguage();
std::string local_skin = "xui" + slash + localization + slash + filename;
found_file = gDirUtilp->findSkinnedFilename(local_skin);
}

View File

@ -38,15 +38,17 @@
#include "llcontrol.h"
#include "llrect.h"
#include "llcoord.h"
#include "llhtmlhelp.h"
#include "llgl.h"
//#include "llhtmlhelp.h"
#include "llgl.h" // *TODO: break this dependency
#include <stack>
#include "llimagegl.h"
//#include "llimagegl.h"
// LLUIFactory
#include "llsd.h"
class LLColor4;
class LLHtmlHelp;
class LLImageGL;
class LLVector3;
class LLVector2;
class LLUUID;
@ -139,13 +141,6 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL
gl_rect_2d_offset_local( rect.mLeft, rect.mTop, rect.mRight, rect.mBottom, pixel_offset, filled );
}
// No longer used
// Initializes translation table
// void init_tr();
// Returns a string from the string table in the correct language
// std::string tr(const std::string& english_chars);
// Used to hide the flashing text cursor when window doesn't have focus.
extern BOOL gShowTextEditCursor;
@ -172,6 +167,10 @@ public:
static void loadIdentity();
static void translate(F32 x, F32 y, F32 z = 0.0f);
// Return the ISO639 language name ("en", "ko", etc.) for the viewer UI.
// http://www.loc.gov/standards/iso639-2/php/code_list.php
static std::string getLanguage();
//helper functions (should probably move free standing rendering helper functions here)
static std::string locateSkin(const std::string& filename);
static void setCursorPositionScreen(S32 x, S32 y);

View File

@ -130,15 +130,7 @@ void LLUICtrlFactory::setupPaths()
for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling())
{
LLUIString path_val_ui(path->getValue());
std::string language = "en-us";
if (LLUI::sConfigGroup)
{
language = LLUI::sConfigGroup->getString("Language");
if(language == "default")
{
language = LLUI::sConfigGroup->getString("SystemLanguage");
}
}
std::string language = LLUI::getLanguage();
path_val_ui.setArg("[LANGUAGE]", language);
if (std::find(sXUIPaths.begin(), sXUIPaths.end(), path_val_ui.getString()) == sXUIPaths.end())

View File

@ -3971,7 +3971,18 @@
<key>Value</key>
<real>0.0</real>
</map>
<key>InventoryAutoOpenDelay</key>
<key>InstallLanguage</key>
<map>
<key>Comment</key>
<string>Language passed from installer (for UI)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>default</string>
</map>
<key>InventoryAutoOpenDelay</key>
<map>
<key>Comment</key>
<string>Seconds before automatically opening inventory when mouse is over inventory button when performing inventory drag and drop</string>
@ -4221,7 +4232,7 @@
<key>Language</key>
<map>
<key>Comment</key>
<string>Language specifier (for XUI)</string>
<string>Language specifier (for UI)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -7670,7 +7681,7 @@
<key>SystemLanguage</key>
<map>
<key>Comment</key>
<string>Language indicated by system settings (for XUI)</string>
<string>Language indicated by system settings (for UI)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@ -31,15 +31,27 @@ RequestExecutionLevel admin ; on Vista we must be admin because we write to Prog
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!include "%%SOURCE%%\installers\windows\lang_de.nsi"
!include "%%SOURCE%%\installers\windows\lang_en-us.nsi"
!include "%%SOURCE%%\installers\windows\lang_ja.nsi"
!include "%%SOURCE%%\installers\windows\lang_ko.nsi"
!include "%%SOURCE%%\installers\windows\lang_pt-br.nsi"
!include "%%SOURCE%%\installers\windows\lang_fr.nsi"
!include "%%SOURCE%%\installers\windows\lang_es.nsi"
!include "%%SOURCE%%\installers\windows\lang_fr.nsi"
!include "%%SOURCE%%\installers\windows\lang_ja.nsi"
!include "%%SOURCE%%\installers\windows\lang_it.nsi"
!include "%%SOURCE%%\installers\windows\lang_ko.nsi"
!include "%%SOURCE%%\installers\windows\lang_nl.nsi"
!include "%%SOURCE%%\installers\windows\lang_pt-br.nsi"
!include "%%SOURCE%%\installers\windows\lang_zh.nsi"
# *TODO: Move these into the language files themselves
LangString LanguageCode ${LANG_GERMAN} "de"
LangString LanguageCode ${LANG_ENGLISH} "en"
LangString LanguageCode ${LANG_SPANISH} "es"
LangString LanguageCode ${LANG_FRENCH} "fr"
LangString LanguageCode ${LANG_JAPANESE} "ja"
LangString LanguageCode ${LANG_ITALIAN} "it"
LangString LanguageCode ${LANG_KOREAN} "ko"
LangString LanguageCode ${LANG_DUTCH} "nl"
LangString LanguageCode ${LANG_PORTUGUESEBR} "pt"
LangString LanguageCode ${LANG_SIMPCHINESE} "zh"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py)
;; For example:
@ -70,7 +82,6 @@ InstallDir "$PROGRAMFILES\${INSTNAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -79,6 +90,7 @@ Var INSTEXE
Var INSTFLAGS
Var INSTSHORTCUT
Var COMMANDLINE ; command line passed to this installer, set in .onInit
Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
;;; Function definitions should go before file includes, because calls to
;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
@ -107,7 +119,7 @@ label_ask_launch:
label_launch:
# Assumes SetOutPath $INSTDIR
Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS'
Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS $SHORTCUT_LANG_PARAM'
label_no_launch:
Pop $R0
FunctionEnd
@ -222,7 +234,7 @@ Function CheckNetworkConnection
; Don't show secondary progress bar, this will be quick.
NSISdl::download_quiet \
/TIMEOUT=${HTTP_TIMEOUT} \
"http://join.secondlife.com/installer-check/?v=${VERSION_LONG}" \
"http://install.secondlife.com/check/?v=${VERSION_LONG}" \
$0
Pop $1 ; Return value, either "success", "cancel" or an error message
; MessageBox MB_OK "Download result: $1"
@ -682,7 +694,6 @@ lbl_end:
Return
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; MAIN SECTION
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -725,13 +736,15 @@ Call RemoveOldReleaseNotes
;; This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
%%INSTALL_FILES%%
# Pass the installer's language to the client to use as a default
StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Shortcuts in start menu
CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
"$INSTDIR\$INSTEXE" "$INSTFLAGS"
"$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM"
WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \
@ -749,8 +762,10 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Other shortcuts
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS"
CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS"
CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \
"$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM"
CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \
"$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM"
CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
'"$INSTDIR\uninst.exe"' ''

View File

@ -31,13 +31,17 @@
#include "llviewerprecompiledheaders.h"
#include "llagentlanguage.h"
// viewer includes
#include "llagent.h"
#include "llviewercontrol.h"
#include "llviewerregion.h"
// library includes
#include "llui.h" // getLanguage()
LLAgentLanguage::LLAgentLanguage()
{
gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&update));
gSavedSettings.getControl("InstallLanguage")->getSignal()->connect(boost::bind(&update));
gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&update));
gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&update));
}
@ -51,9 +55,7 @@ bool LLAgentLanguage::update()
std::string url = gAgent.getRegion()->getCapability("UpdateAgentLanguage");
if (!url.empty())
{
std::string language = gSavedSettings.getString("Language");
if (language == "default")
language = gSavedSettings.getString("SystemLanguage");
std::string language = LLUI::getLanguage();
body["language"] = language;
body["language_is_public"] = gSavedSettings.getBOOL("LanguageIsPublic");
@ -62,4 +64,3 @@ bool LLAgentLanguage::update()
}
return true;
}

View File

@ -32,7 +32,7 @@
#ifndef LL_LLAGENTLANGUAGE_H
#define LL_LLAGENTLANGUAGE_H
#include "llmemory.h"
#include "llmemory.h" // LLSingleton<>
#include "llevent.h"
class LLAgentLanguage: public LLSingleton<LLAgentLanguage>, public LLSimpleListener

View File

@ -296,6 +296,9 @@ const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker");
static BOOL gDoDisconnect = FALSE;
static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup)
const char* const VIEWER_WINDOW_CLASSNAME = "Second Life";
//----------------------------------------------------------------------------
// File scope definitons
const char *VFS_DATA_FILE_BASE = "data.db2.x.";
@ -2082,7 +2085,8 @@ bool LLAppViewer::initWindow()
// always start windowed
BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
gViewerWindow = new LLViewerWindow(gWindowTitle, "Second Life",
gViewerWindow = new LLViewerWindow(gWindowTitle,
VIEWER_WINDOW_CLASSNAME,
gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
FALSE, ignorePixelDepth);

View File

@ -62,12 +62,7 @@ LLFloaterHUD::LLFloaterHUD()
// arrow keys during tutorial).
mWebBrowser->setTakeFocusOnClick(false);
std::string language(gSavedSettings.getString("Language"));
if(language == "default")
{
language = gSavedSettings.getString("SystemLanguage");
}
std::string language = LLUI::getLanguage();
std::string base_url = gSavedSettings.getString("TutorialURL");
std::string url = base_url + language + "/";

View File

@ -925,11 +925,7 @@ void LLPanelLogin::loadLoginPage()
}
// Language
std::string language(gSavedSettings.getString("Language"));
if(language == "default")
{
language = gSavedSettings.getString("SystemLanguage");
}
std::string language = LLUI::getLanguage();
oStr << first_query_delimiter<<"lang=" << language;
// First Login?

View File

@ -680,8 +680,7 @@ void send_stats()
// send fps only for time app spends in foreground
agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32();
agent["version"] = gCurrentVersion;
std::string language(gSavedSettings.getString("Language"));
if(language == "default") language = gSavedSettings.getString("SystemLanguage");
std::string language = LLUI::getLanguage();
agent["language"] = language;
agent["sim_fps"] = ((F32) gFrameCount - gSimFrames) /

View File

@ -190,8 +190,8 @@ class WindowsManifest(ViewerManifest):
self.end_prefix()
# Mozilla appears to force a dependency on these files so we need to ship it (CP)
self.path("msvcr71.dll")
self.path("msvcp71.dll")
self.path("msvcr80.dll")
self.path("msvcp80.dll")
# Mozilla runtime DLLs (CP)
if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):

View File

@ -1036,9 +1036,9 @@ anguage Infrstructure (CLI) international standard</string>
<key>windows</key>
<map>
<key>md5sum</key>
<string>8c1b8881285631eb32ba541e10d07b07</string>
<string>42cb780c595d25881b4967292a4a0f40</string>
<key>url</key>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llmozlib-windows-20080922.tar.bz2</uri>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llmozlib-windows-20080828.tar.bz2</uri>
</map>
</map>
</map>

View File

@ -33,6 +33,36 @@ THE SOFTWARE.
$/LicenseInfo$
"""
import sys
import os.path
# Look for indra/lib/python in all possible parent directories ...
# This is an improvement over the setup-path.py method used previously:
# * the script may blocated anywhere inside the source tree
# * it doesn't depend on the current directory
# * it doesn't depend on another file being present.
def add_indra_lib_path():
root = os.path.realpath(__file__)
# always insert the directory of the script in the search path
dir = os.path.dirname(root)
if dir not in sys.path:
sys.path.insert(0, dir)
# Now go look for indra/lib/python in the parent dies
while root != os.path.sep:
root = os.path.dirname(root)
dir = os.path.join(root, 'indra', 'lib', 'python')
if os.path.isdir(dir):
if dir not in sys.path:
sys.path.insert(0, dir)
return root
else:
print >>sys.stderr, "This script is not inside a valid installation."
sys.exit(1)
base_dir = add_indra_lib_path()
import copy
import md5
import optparse
@ -40,7 +70,6 @@ import os
import platform
import pprint
import shutil
import sys
import tarfile
import tempfile
import urllib2
@ -48,17 +77,6 @@ import urlparse
from sets import Set as set, ImmutableSet as frozenset
# Locate -our- python library relative to our install location.
from os.path import realpath, dirname, join
# Walk back to checkout base directory
base_dir = dirname(dirname(realpath(__file__)))
# Walk in to libraries directory
lib_dir = join(join(join(base_dir, 'indra'), 'lib'), 'python')
if lib_dir not in sys.path:
sys.path.insert(0, lib_dir)
from indra.base import llsd
from indra.util import helpformatter
@ -830,13 +848,13 @@ darwin/universal/gcc/4.0
parser.add_option(
'--install-manifest',
type='string',
default=join(base_dir, 'install.xml'),
default=os.path.join(base_dir, 'install.xml'),
dest='install_filename',
help='The file used to describe what should be installed.')
parser.add_option(
'--installed-manifest',
type='string',
default=join(base_dir, 'installed.xml'),
default=os.path.join(base_dir, 'installed.xml'),
dest='installed_filename',
help='The file used to record what is installed.')
parser.add_option(

View File

@ -47,23 +47,26 @@ import os.path
# * it doesn't depend on the current directory
# * it doesn't depend on another file being present.
root = os.path.abspath(__file__)
# always insert the directory of the script in the search path
dir = os.path.dirname(root)
if dir not in sys.path:
sys.path.insert(0, dir)
def add_indra_lib_path():
root = os.path.realpath(__file__)
# always insert the directory of the script in the search path
dir = os.path.dirname(root)
if dir not in sys.path:
sys.path.insert(0, dir)
# Now go look for indra/lib/python in the parent dies
while root != os.path.sep:
root = os.path.dirname(root)
dir = os.path.join(root, 'indra', 'lib', 'python')
if os.path.isdir(dir):
if dir not in sys.path:
sys.path.insert(0, dir)
break
else:
print >>sys.stderr, "This script is not inside a valid installation."
sys.exit(1)
# Now go look for indra/lib/python in the parent dies
while root != os.path.sep:
root = os.path.dirname(root)
dir = os.path.join(root, 'indra', 'lib', 'python')
if os.path.isdir(dir):
if dir not in sys.path:
sys.path.insert(0, dir)
break
else:
print >>sys.stderr, "This script is not inside a valid installation."
sys.exit(1)
add_indra_lib_path()
import optparse
import os

View File

@ -13,23 +13,26 @@ import os.path
# * it doesn't depend on the current directory
# * it doesn't depend on another file being present.
root = os.path.abspath(__file__)
# always insert the directory of the script in the search path
dir = os.path.dirname(root)
if dir not in sys.path:
sys.path.insert(0, dir)
def add_indra_lib_path():
root = os.path.realpath(__file__)
# always insert the directory of the script in the search path
dir = os.path.dirname(root)
if dir not in sys.path:
sys.path.insert(0, dir)
# Now go look for indra/lib/python in the parent dies
while root != os.path.sep:
root = os.path.dirname(root)
dir = os.path.join(root, 'indra', 'lib', 'python')
if os.path.isdir(dir):
if dir not in sys.path:
sys.path.insert(0, dir)
break
else:
print >>sys.stderr, "This script is not inside a valid installation."
sys.exit(1)
# Now go look for indra/lib/python in the parent dies
while root != os.path.sep:
root = os.path.dirname(root)
dir = os.path.join(root, 'indra', 'lib', 'python')
if os.path.isdir(dir):
if dir not in sys.path:
sys.path.insert(0, dir)
break
else:
print >>sys.stderr, "This script is not inside a valid installation."
sys.exit(1)
add_indra_lib_path()
import getopt, os, re, commands
from indra.util import llversion