From 2a44e81675d22aa5ed0844d5a4ac18bb9bd49f64 Mon Sep 17 00:00:00 2001 From: James Cook <james@lindenlab.com> Date: Wed, 19 Nov 2008 23:26:29 +0000 Subject: [PATCH] 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 --- indra/CMakeLists.txt | 2 + indra/cmake/CMakeLists.txt | 1 + indra/cmake/FindMT.cmake | 15 ++++++ indra/develop.py | 20 +++++--- indra/llui/llbutton.cpp | 1 + indra/llui/llui.cpp | 36 +++++++++++--- indra/llui/llui.h | 19 ++++---- indra/llui/lluictrlfactory.cpp | 10 +--- indra/newview/app_settings/settings.xml | 17 +++++-- .../installers/windows/installer_template.nsi | 37 +++++++++----- indra/newview/installers/windows/lang_es.nsi | Bin 7612 -> 7846 bytes indra/newview/installers/windows/lang_fr.nsi | Bin 7858 -> 8118 bytes indra/newview/installers/windows/lang_it.nsi | Bin 7196 -> 7438 bytes indra/newview/installers/windows/lang_nl.nsi | Bin 7160 -> 7388 bytes .../newview/installers/windows/lang_pt-br.nsi | Bin 7590 -> 7832 bytes indra/newview/installers/windows/lang_zh.nsi | Bin 5354 -> 5552 bytes indra/newview/llagentlanguage.cpp | 9 ++-- indra/newview/llagentlanguage.h | 2 +- indra/newview/llappviewer.cpp | 6 ++- indra/newview/llfloaterhud.cpp | 7 +-- indra/newview/llpanellogin.cpp | 6 +-- indra/newview/llviewerstats.cpp | 3 +- indra/newview/viewer_manifest.py | 4 +- install.xml | 4 +- scripts/install.py | 46 ++++++++++++------ scripts/template_verifier.py | 37 +++++++------- scripts/update_version_files.py | 37 +++++++------- 27 files changed, 201 insertions(+), 118 deletions(-) create mode 100644 indra/cmake/FindMT.cmake diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index c473b94ff72..0755f810bd1 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -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) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index a2658d3f3aa..46b9b52f3f9 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -28,6 +28,7 @@ set(cmake_SOURCE_FILES FindELFIO.cmake FindGooglePerfTools.cmake FindMono.cmake + FindMT.cmake FindMySQL.cmake FindOpenJPEG.cmake FindXmlRpcEpi.cmake diff --git a/indra/cmake/FindMT.cmake b/indra/cmake/FindMT.cmake new file mode 100644 index 00000000000..5239a4c2f5a --- /dev/null +++ b/indra/cmake/FindMT.cmake @@ -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}) diff --git a/indra/develop.py b/indra/develop.py index a987bb3da63..3692fac2b30 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -613,7 +613,7 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple): 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 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple): -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 ''' diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3f6338006f3..47b7067f630 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -38,6 +38,7 @@ #include "llstring.h" // Project includes +#include "llhtmlhelp.h" #include "llkeyboard.h" #include "llui.h" #include "lluiconstants.h" diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 472f8606b16..f1e7b98a609 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -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); } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index d434dbd6d15..aa3cff433ef 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -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 @@ class LLUI 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); diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index eaaa9990a0b..da718c8a334 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -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()) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b01fbbec4f5..62bc827bb1a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -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> diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 01bd98f87c9..495012aac2b 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -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"' '' diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 3340a1230fa76a70f4f82b07e5bc5fd40b7ae347..c6a7f38f3fd38731d5c3aceb5fb084bf95fb9869 100644 GIT binary patch delta 140 zcmdmEz07vQ8cA(uh75*OhGd3p20tKO!cfkT&rk&9IRoiDAOy*kFl2&wlPB`4suEPi x;KC3v`5}|)<N{7P*<`ROsSFiB6Fvh?Q(#B|ny3J@A(bIz@_8xI&1)nDSO8I^A&39~ delta 16 YcmZ2xyT^LN8p+9bICwTMl44;206x?PN&o-= diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index 5c17ad077f6e9a8a8e5968671e5f8126ab344221..d23615de9182508fc0e36a4fd90a7245a67d5a5c 100644 GIT binary patch delta 168 zcmdmFyUl*X3@K%2h75*OhGd3p20tKO!cfkT&rk&9IRoiDAOy-y-piysnU9-G5vK~E zzD$t%$q&WV9T7S!AfgNk42cY-K(dJ8B||aLL<lbxXu1N>=6s-B5l~!#Aq6O>z)&`M QB9}O`9)sTIb}4NZ00OQhb^rhX delta 12 TcmdmHzsYvP45`g?q@`E@B_0IN diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index 9f18013691c41e1dbf1f883dcf47d5014b475584..1208ec4eb8a441342702254461fcfc04dfd4d099 100644 GIT binary patch delta 189 zcmbPZ(Py<mKtkJ@A%h{6A(<hY!4F86FqAXoGZX=N&Oka32tjfs44EL_<c<8wssvRr zxG)4v{>Z2r90t@|1k{-Z#K{ba3<^LJW@a%%F~m%u8U=<FAX@>b7Gyt&p9!=VqPhsE VE}uaU43!wTCNJa=UMwTQ0sw-SCuINt delta 15 WcmeCPnq#p+Kw|O=4xYt)k}Lo#sRWV$ diff --git a/indra/newview/installers/windows/lang_nl.nsi b/indra/newview/installers/windows/lang_nl.nsi index 42453baa2859d7acd9104d55b8fc089ffd760411..c8ffa8bfcd733b6fe4d588bb3213148e2e2b7215 100644 GIT binary patch delta 132 zcmexie#dgdJ8@NKh75*OhGd3p20tKO!cfkT&rk&9IRoiDAOy*kOm^f@ocw{COB$aV oZ%%DRn0zYOj546^B8DV}OrSX_U^0F3L{3R&JqEqacg3Yy0Ik;_y8r+H delta 16 Ycmca(`NMp}JMqa<96X!vN&I6507RPyWdHyG diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi index 6524cc7c0102fac8ee0efb787a2d5403b4a53910..da56a3c3369e8607fb44716ecba1969eaec70750 100644 GIT binary patch delta 128 zcmZ2xJ;QdxGReui*tn$q7*ZKZ7|I#)8HyOP8JvN19uTH7Br}vucH~r?EWpmCh(`@W vCP>HRkNp0!$zZ*y3>6HIfh+}v6rd>zKvPpetjQlaMJG#f@@(ED`Gpw(4V@ql delta 16 YcmbPXyUcpSGRetOoIIPCNPS@j061I*Pyhe` diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi index e644e6389b8fac7c3f06b66c7e89edda50da3c03..f4b7b5d143c9bada9b541ccefdf978c5bd9997f3 100644 GIT binary patch delta 106 zcmaE*xj}n_kkI5PRxW8jhE#?UhH{2{h9ZV+24^6h2ZX5%$qXfvKeB7%l{e%t7fa68 e2tSbVG(E8XPTjr!rOA2>AUKI#YO|cs872VJdL4QI delta 16 Ycmdm>{YrC#kkDj4cAm{ogw8Ml05u~8?f?J) diff --git a/indra/newview/llagentlanguage.cpp b/indra/newview/llagentlanguage.cpp index 7401f95f29a..e34e8d19690 100644 --- a/indra/newview/llagentlanguage.cpp +++ b/indra/newview/llagentlanguage.cpp @@ -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; } - diff --git a/indra/newview/llagentlanguage.h b/indra/newview/llagentlanguage.h index 8d708b27fc3..aba23e28cfc 100644 --- a/indra/newview/llagentlanguage.h +++ b/indra/newview/llagentlanguage.h @@ -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 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f47f9b1f43d..0ee3b148d05 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -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); diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index 82b3097ee2c..848068ee9d7 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -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 + "/"; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 13f3d125edb..816a8b5765e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -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? diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 72d63085036..7d0d16a1000 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -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) / diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index db46dac1c6f..ef13f9151b8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -190,8 +190,8 @@ def construct(self): 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=""): diff --git a/install.xml b/install.xml index 6419951e3d4..1c8e3aab9e1 100644 --- a/install.xml +++ b/install.xml @@ -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> diff --git a/scripts/install.py b/scripts/install.py index 59c441748ef..67b1c8f409d 100755 --- a/scripts/install.py +++ b/scripts/install.py @@ -33,6 +33,36 @@ $/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 platform import pprint import shutil -import sys import tarfile import tempfile import urllib2 @@ -48,17 +77,6 @@ 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 @@ def parse_args(): 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( diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index 581f1168ff2..8f822daf6a8 100755 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -47,23 +47,26 @@ # * 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) - -# 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) +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) + +add_indra_lib_path() import optparse import os diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py index 87a3b6f3895..90819415217 100755 --- a/scripts/update_version_files.py +++ b/scripts/update_version_files.py @@ -13,23 +13,26 @@ # * 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) - -# 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) +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) + +add_indra_lib_path() import getopt, os, re, commands from indra.util import llversion -- GitLab