diff --git a/.gitignore b/.gitignore index 7c302ed85..f180405b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/installed.xml -/indra/llcommon/llversionviewer.h /indra/build-* /indra/tools/vstool/obj/ *.aps @@ -26,12 +24,5 @@ qtcreator-build/ /.pc /build-* /viewer-* -/indra/newview/res/viewerRes.rc -/indra/newview/res/viewerRes_bc.rc -/indra/newview/English.lproj/InfoPlist.strings -/indra/newview/linux_tools/handle_secondlifeprotocol.sh -/indra/newview/linux_tools/install.sh -/indra/newview/linux_tools/refresh_desktop_app_entry.sh -/indra/newview/linux_tools/wrapper.sh diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 457a1bb16..81a228706 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -1,81 +1,54 @@ # -*- cmake -*- +# Construct the viewer version number based on the indra/VIEWER_VERSION file -# Read version components from the header file. -file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversionviewer.h.in lines - REGEX " LL_VERSION_") -foreach(line ${lines}) - string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}") - string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}") - set(v${comp} "${value}") -endforeach(line) +if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/newview/ + set(VIEWER_VERSION_BASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/newview/VIEWER_VERSION.txt") -execute_process( - COMMAND git rev-list HEAD - OUTPUT_VARIABLE GIT_REV_LIST_STR - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_STRIP_TRAILING_WHITESPACE -) + if ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+") + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION}) -if(GIT_REV_LIST_STR) - string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR}) -else() - string(REPLACE "\n" ";" GIT_REV_LIST "") -endif() + if (DEFINED ENV{revision}) + set(VIEWER_VERSION_REVISION $ENV{revision}) + message("Revision (from environment): ${VIEWER_VERSION_REVISION}") -if(GIT_REV_LIST) - list(LENGTH GIT_REV_LIST vBUILD) -else() - set(vBUILD 99) -endif() + else (DEFINED ENV{revision}) + execute_process( + COMMAND git rev-list HEAD + OUTPUT_VARIABLE GIT_REV_LIST_STR + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE + ) -configure_file( - ${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h.in - ${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h -) + if(GIT_REV_LIST_STR) + string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR}) + else() + string(REPLACE "\n" ";" GIT_REV_LIST "") + endif() -if (WINDOWS) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in - ${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc - ) -endif (WINDOWS) + if(GIT_REV_LIST) + list(LENGTH GIT_REV_LIST VIEWER_VERSION_REVISION) + else(GIT_REV_LIST) + set(VIEWER_VERSION_REVISION 99) + endif(GIT_REV_LIST) + endif (DEFINED ENV{revision}) + message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'") + endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) -if (DARWIN) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in - ${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings - ) -endif (DARWIN) - -if (LINUX) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in - ${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh - @ONLY - ) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in - ${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh - @ONLY - ) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in - ${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh - @ONLY - ) - configure_file( - ${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in - ${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh - @ONLY - ) -endif (LINUX) - - -# Compose the version. -set(${ROOT_PROJECT_NAME}_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}") -if (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$") - message(STATUS "Version is ${${ROOT_PROJECT_NAME}_VERSION}") -else (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$") - message(FATAL_ERROR "Could not determine version (${${ROOT_PROJECT_NAME}_VERSION})") -endif (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$") + if ("${VIEWER_VERSION_REVISION}" STREQUAL "") + message("Ultimate fallback, revision was blank or not set: will use 0") + set(VIEWER_VERSION_REVISION 0) + endif ("${VIEWER_VERSION_REVISION}" STREQUAL "") + set(VIEWER_CHANNEL_VERSION_DEFINES + "LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\"" + "LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}" + "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}" + "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}" + "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" + ) +endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 2d581ff59..93b98e6f6 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -178,8 +178,11 @@ string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}") set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}") set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}") +set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside") set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.") +set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.") + source_group("CMake Rules" FILES CMakeLists.txt) endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ac506f07b..c6a187840 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -233,7 +233,6 @@ set(llcommon_HEADER_FILES lltypeinfolookup.h lluri.h lluuid.h - llversionviewer.h.in llworkerthread.h metaclass.h metaclasst.h diff --git a/indra/llcommon/llversionviewer.h.in b/indra/llcommon/llversionviewer.h.in deleted file mode 100644 index 76d53b926..000000000 --- a/indra/llcommon/llversionviewer.h.in +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file llversionviewer.h - * @brief - * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLVERSIONVIEWER_H -#define LL_LLVERSIONVIEWER_H - -const S32 LL_VERSION_MAJOR = 1; -const S32 LL_VERSION_MINOR = 8; -const S32 LL_VERSION_PATCH = 6; -const S32 LL_VERSION_BUILD = ${vBUILD}; - -const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; - -#if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "org.singularityviewer.singularity"; -#endif - -#endif - diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c72b705a7..5c7d51d68 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -5,6 +5,7 @@ project(viewer) include(00-Common) include(Boost) include(BuildPackagesInfo) +include(BuildVersion) include(CMakeCopyIfDifferent) include(DBusGlib) include(ELFIO) @@ -36,7 +37,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -#include(LScript) include(Linking) include(NDOF) include(NVAPI) @@ -76,6 +76,7 @@ include_directories( ${LLWINDOW_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS} ${LLAPPEARANCE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} ) set(viewer_SOURCE_FILES @@ -492,6 +493,7 @@ set(viewer_SOURCE_FILES llurlwhitelist.cpp lluserauth.cpp llvectorperfoptions.cpp + llversioninfo.cpp llvelocitybar.cpp llviewchildren.cpp llviewerassetstats.cpp @@ -596,7 +598,6 @@ set(viewer_SOURCE_FILES rlvui.cpp scriptcounter.cpp sgmemstat.cpp - sgversion.cpp shcommandhandler.cpp shfloatermediaticker.cpp wlfPanel_AdvSettings.cpp @@ -1030,6 +1031,7 @@ set(viewer_HEADER_FILES lluserauth.h llvectorperfoptions.h llvelocitybar.h + llversioninfo.h llviewchildren.h llviewerassetstats.h llviewerassetstorage.h @@ -1137,7 +1139,6 @@ set(viewer_HEADER_FILES roles_constants.h scriptcounter.h sgmemstat.h - sgversion.h shcommandhandler.h shfloatermediaticker.h wlfPanel_AdvSettings.h @@ -1145,6 +1146,22 @@ set(viewer_HEADER_FILES source_group("CMake Rules" FILES ViewerInstall.cmake) +# the viewer_version.txt file created here is for passing to viewer_manifest and autobuild +# the summary.json file is created for the benefit of the TeamCity builds, where +# it is used to provide descriptive information to the build results page +add_custom_target(generate_viewer_version ALL + COMMAND cmake -E echo ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION} > ${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt + COMMAND cmake -E echo {"Type":"viewer","Version":"${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}"} > ${CMAKE_BINARY_DIR}/summary.json + COMMENT "Generating viewer_version.txt for manifest processing" + ) + +set_source_files_properties( + llversioninfo.cpp + PROPERTIES + DEPENDS generate_viewer_version # dummy dependency to force recompile every time + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake + ) + if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) @@ -1208,11 +1225,13 @@ if (WINDOWS) # the .pch file. # All sources added to viewer_SOURCE_FILES # at this point use it. - set_source_files_properties(llviewerprecompiledheaders.cpp - PROPERTIES - COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" - ) - list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) + if(USE_PRECOMPILED_HEADERS) + set_source_files_properties(llviewerprecompiledheaders.cpp + PROPERTIES + COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" + ) + list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) + endif(USE_PRECOMPILED_HEADERS) # Add resource files to the project. # viewerRes.rc is the only buildable file, but @@ -1257,12 +1276,18 @@ if (WINDOWS) set_source_files_properties(${viewer_RESOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/res/viewerRes.rc + ${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc + ) set(viewer_RESOURCE_FILES - res/resource.h - res/viewerRes.rc + ${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc ${viewer_RESOURCE_FILES} ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc + PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/res" + ) + SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES}) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) @@ -1397,6 +1422,8 @@ if (WINDOWS) LINK_FLAGS_RELWITHDEBINFO "${release_flags} ${EXTRA_LINKER_FLAGS_RELEASE}" ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + if(USE_PRECOMPILED_HEADERS) set_target_properties( ${VIEWER_BINARY_NAME} @@ -1545,6 +1572,7 @@ if (WINDOWS) DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + ${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${COPY_INPUT_DEPENDENCIES} ) @@ -1556,7 +1584,7 @@ if (WINDOWS) endif (PACKAGE) endif (WINDOWS) -# *NOTE - this list is very sensitive to ordering, test carefully on all +# *NOTE: - this list is very sensitive to ordering, test carefully on all # platforms if you change the releative order of the entries here. # In particular, cmake 2.6.4 (when buidling with linux/makefile generators) # appears to sometimes de-duplicate redundantly listed dependencies improperly. @@ -1617,6 +1645,8 @@ if (LINUX) DEPENDS ${VIEWER_BINARY_NAME} ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + set(product ${VIEWER_BRANDING_NAME_CAMELCASE}-${ARCH}-${${ROOT_PROJECT_NAME}_VERSION}) add_custom_command( @@ -1678,20 +1708,30 @@ endif (LINUX) if (DARWIN) set(product ${VIEWER_BRANDING_NAME}) + set(MACOSX_BUNDLE_INFO_STRING "A stable third-party Second Life viewer.") + set(MACOSX_BUNDLE_ICON_FILE "${VIEWER_BRANDING_ID}_icon.icns") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "${VIEWER_BRANDING_NAME}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + set(MACOSX_BUNDLE_BUNDLE_NAME "${VIEWER_BRANDING_NAME}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${${ROOT_PROJECT_NAME}_VERSION}") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 Siana Gearz") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_STRING "A stable third-party Second Life viewer." - MACOSX_BUNDLE_ICON_FILE "${VIEWER_BRANDING_ID}_icon.icns" - MACOSX_BUNDLE_GUI_IDENTIFIER "${VIEWER_BRANDING_NAME}" - MACOSX_BUNDLE_LONG_VERSION_STRING "${${ROOT_PROJECT_NAME}_VERSION}" - MACOSX_BUNDLE_BUNDLE_NAME "${VIEWER_BRANDING_NAME}" - MACOSX_BUNDLE_SHORT_VERSION_STRING "${${ROOT_PROJECT_NAME}_VERSION}" - MACOSX_BUNDLE_BUNDLE_VERSION "${${ROOT_PROJECT_NAME}_VERSION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 Siana Gearz" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" + "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" + ) + + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${PYTHON_EXECUTABLE} @@ -1708,14 +1748,15 @@ if (DARWIN) --source=${CMAKE_CURRENT_SOURCE_DIR} --extra_libraries="${MANIFEST_LIBRARIES}" DEPENDS - ${VIEWER_BINARY_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + ${VIEWER_BINARY_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker) if (PACKAGE) add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_dependencies(llpackage generate_viewer_version) add_custom_command( TARGET llpackage POST_BUILD diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt new file mode 100644 index 000000000..f263cd11b --- /dev/null +++ b/indra/newview/VIEWER_VERSION.txt @@ -0,0 +1 @@ +1.8.6 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 07a6a7244..8ceb12c31 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -36,7 +36,7 @@ #include "hippogridmanager.h" #include "hippolimits.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -755,16 +755,9 @@ bool LLAppViewer::init() // Setup notifications after LLUI::initClass() has been called. LLNotifications::instance().createDefaultChannels(); LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; - + writeSystemInfo(); - // Build a string representing the current version number. - gCurrentVersion = llformat("%s %d.%d.%d.%d", - gVersionChannel, - gVersionMajor, - gVersionMinor, - gVersionPatch, - gVersionBuild ); ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -1006,7 +999,8 @@ bool LLAppViewer::init() gDebugInfo["GraphicsCard"] = LLFeatureManager::getInstance()->getGPUString(); // Save the current version to the prefs file - gSavedSettings.setString("LastRunVersion", gCurrentVersion); + gSavedSettings.setString("LastRunVersion", + LLVersionInfo::getChannelAndVersion()); gSimLastTime = gRenderStartTime.getElapsedTimeF32(); gSimFrames = (F32)gFrameCount; @@ -2161,7 +2155,7 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setString("ClientSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); - gSavedSettings.setString("VersionChannelName", gVersionChannel); + gSavedSettings.setString("VersionChannelName", LLVersionInfo::getChannel()); #if 0 //#ifndef LL_RELEASE_FOR_DOWNLOAD // provide developer build only overrides for these control variables that are not @@ -2647,17 +2641,18 @@ void LLAppViewer::removeCacheFiles(const std::string& file_mask) void LLAppViewer::writeSystemInfo() { - + if (! gDebugInfo.has("Dynamic") ) gDebugInfo["Dynamic"] = LLSD::emptyMap(); gDebugInfo["SLLog"] = LLError::logFileName(); - gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; - gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; - gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor; - gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch; - gDebugInfo["ClientInfo"]["BuildVersion"] = gVersionBuild; + gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::getChannel(); + gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor(); + gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor(); + gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch(); + gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::getBuild(); + #if defined(_WIN64) || defined(__x86_64__) gDebugInfo["ClientInfo"]["Architecture"] = "x86_64"; #else @@ -2703,9 +2698,8 @@ void LLAppViewer::writeSystemInfo() } // Dump some debugging info - LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << gVersionMajor << "." << gVersionMinor << "." << gVersionPatch - << LL_ENDL; + LL_INFOS("SystemInfo") << "Application: " << LLTrans::getString("APP_NAME") << LL_ENDL; + LL_INFOS("SystemInfo") << "Version: " << LLVersionInfo::getChannelAndVersion() << LL_ENDL; // Dump the local time and time zone time_t now; @@ -2763,15 +2757,6 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["Dynamic"]["CrashHostUrl"] = crashHostUrl; } - //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version - //to check against no matter what - gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; - - gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; - gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor; - gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch; - gDebugInfo["ClientInfo"]["BuildVersion"] = gVersionBuild; - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) { @@ -4736,12 +4721,12 @@ void LLAppViewer::handleLoginComplete() initMainloopTimeout("Mainloop Init"); // Store some data to DebugInfo in case of a freeze. - gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; + gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::getChannel(); - gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; - gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor; - gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch; - gDebugInfo["ClientInfo"]["BuildVersion"] = gVersionBuild; + gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor(); + gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor(); + gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch(); + gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::getBuild(); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 4f4ac87fc..d5dafa9ca 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -49,7 +49,7 @@ #include "llagent.h" #include "llviewerstats.h" #include "llviewerregion.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "lluictrlfactory.h" #include "lluri.h" #include "llweb.h" @@ -135,9 +135,9 @@ LLFloaterAbout::LLFloaterAbout() + " (64 bit)" #endif + llformat(" %d.%d.%d (%d) %s %s (%s)\n", - gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild, + LLVersionInfo::getMajor(), LLVersionInfo::getMinor(), LLVersionInfo::getPatch(), LLVersionInfo::getBuild(), __DATE__, __TIME__, - gVersionChannel)); + LLVersionInfo::getChannel().c_str())); support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 05ed662bf..9088a7374 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -74,7 +74,7 @@ #include "llfloateravatarpicker.h" #include "lldir.h" #include "llselectmgr.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "lluictrlfactory.h" #include "llviewernetwork.h" @@ -624,10 +624,7 @@ LLSD LLFloaterReporter::gatherReport() std::ostringstream details; - details << "V" << gVersionMajor << "." // client version moved to body of email for abuse reports - << gVersionMinor << "." - << gVersionPatch << "." - << gVersionBuild << std::endl << std::endl; + details << "V" << LLVersionInfo::getVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports std::string object_name = getChild("object_name")->getValue().asString(); if (!object_name.empty() && !mOwnerName.empty()) @@ -644,10 +641,8 @@ LLSD LLFloaterReporter::gatherReport() std::string version_string; version_string = llformat( - "%d.%d.%d %s %s %s %s", - gVersionMajor, - gVersionMinor, - gVersionPatch, + "%s %s %s %s %s", + LLVersionInfo::getShortVersion().c_str(), platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b346aa922..e51341416 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -42,7 +42,6 @@ #include "llfontgl.h" #include "llmd5.h" #include "llsecondlifeurls.h" -#include "sgversion.h" #include "v4color.h" #include "llappviewer.h" @@ -62,6 +61,7 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlhistory.h" // OGPX : regionuri text box has a history of region uris (if FN/LN are loaded at startup) +#include "llversioninfo.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() #include "llviewernetwork.h" @@ -243,13 +243,12 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect) getChild("grids_btn")->setCommitCallback(boost::bind(LLPanelLogin::onClickGrids)); - std::string channel = gVersionChannel; + std::string channel = LLVersionInfo::getChannel(); + + std::string version = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); - std::string version = llformat("%d.%d.%d (%d)", - gVersionMajor, - gVersionMinor, - gVersionPatch, - gVersionBuild ); LLTextBox* channel_text = getChild("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); @@ -722,25 +721,27 @@ void LLPanelLogin::loadLoginPage() sInstance->setSiteIsAlive(false); return; } - + // Use the right delimeter depending on how LLURI parses the URL LLURI login_page = LLURI(login_page_str); LLSD params(login_page.queryMap()); LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL; - // Language + // Language params["lang"] = LLUI::getLanguage(); - - // First Login? - if (gSavedSettings.getBOOL("FirstLoginThisInstall")) + + // First Login? + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { params["firstlogin"] = "TRUE"; // not bool: server expects string TRUE - } - - params["version"]= llformat("%d.%d.%d (%d)", - gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild); - params["channel"] = gVersionChannel; + } + + // Channel and Version + params["version"] = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); + params["channel"] = LLVersionInfo::getChannel(); // Grid diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7be6ffd4f..526f4ee23 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -90,7 +90,7 @@ #include "lltexteditor.h" #include "llurlentry.h" #include "lluserrelations.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "llviewercontrol.h" #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address @@ -693,9 +693,9 @@ bool idle_startup() if(!start_messaging_system( message_template_path, port, - gVersionMajor, - gVersionMinor, - gVersionPatch, + LLVersionInfo::getMajor(), + LLVersionInfo::getMinor(), + LLVersionInfo::getPatch(), FALSE, std::string(), responder, diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 833926afe..b639c7585 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -35,7 +35,7 @@ #include "llbufferstream.h" #include "lltranslate.h" #include "llui.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "llweb.h" // @@ -64,9 +64,12 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std std::string url; getTranslateUrl(url, fromLang, toLang, mesg); -// - std::string user_agent = gCurrentVersion; -// + std::string user_agent = llformat("%s %d.%d.%d (%d)", + LLVersionInfo::getChannel().c_str(), + LLVersionInfo::getMajor(), + LLVersionInfo::getMinor(), + LLVersionInfo::getPatch(), + LLVersionInfo::getBuild()); if (m_Header.empty()) { diff --git a/indra/newview/lluserauth.cpp b/indra/newview/lluserauth.cpp index d67c8d9d7..d7d7b0ce8 100644 --- a/indra/newview/lluserauth.cpp +++ b/indra/newview/lluserauth.cpp @@ -38,7 +38,7 @@ #include #include "lldir.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "llappviewer.h" #include "llviewercontrol.h" #include "llxmlrpcresponder.h" @@ -128,8 +128,8 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); XMLRPC_VectorAppendString(params, "web_login_key", web_login_key.getString().c_str(), 0); XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); - XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name - XMLRPC_VectorAppendString(params, "channel", gVersionChannel, 0); + XMLRPC_VectorAppendString(params, "version", LLVersionInfo::getChannelAndVersion().c_str(), 0); // Includes channel name + XMLRPC_VectorAppendString(params, "channel", LLVersionInfo::getChannel().c_str(), 0); XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); XMLRPC_VectorAppendString(params, "platform_version", LLAppViewer::instance()->getOSInfo().getOSVersionString().c_str(), 0); @@ -215,13 +215,13 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); - XMLRPC_VectorAppendString(params, "version", llformat("%d.%d.%d.%d", gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild).c_str(), 0); + XMLRPC_VectorAppendString(params, "version", LLVersionInfo::getVersion().c_str(), 0); // Singu Note: At the request of Linden Lab we change channel sent to the login server in the following way: // * If channel is "Singularity" we change it to "Singularity Release", due to their statistics system // not being able to distinguish just the release version // * We append "64" to channel name on 64-bit for systems for the LL stats system to be able to produce independent // crash statistics depending on the architecture - std::string chan(gVersionChannel); + std::string chan(LLVersionInfo::getChannel()); if (chan == "Singularity") { chan += " Release"; diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp new file mode 100644 index 000000000..e53de8be3 --- /dev/null +++ b/indra/newview/llversioninfo.cpp @@ -0,0 +1,174 @@ +/** + * @file llversioninfo.cpp + * @brief Routines to access the viewer version and build information + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include +#include +#include "llversioninfo.h" +#include + +#if ! defined(LL_VIEWER_CHANNEL) \ + || ! defined(LL_VIEWER_VERSION_MAJOR) \ + || ! defined(LL_VIEWER_VERSION_MINOR) \ + || ! defined(LL_VIEWER_VERSION_PATCH) \ + || ! defined(LL_VIEWER_VERSION_BUILD) + #error "Channel or Version information is undefined" +#endif + +// +// Set the version numbers in indra/VIEWER_VERSION +// + +//static +S32 LLVersionInfo::getMajor() +{ + return LL_VIEWER_VERSION_MAJOR; +} + +//static +S32 LLVersionInfo::getMinor() +{ + return LL_VIEWER_VERSION_MINOR; +} + +//static +S32 LLVersionInfo::getPatch() +{ + return LL_VIEWER_VERSION_PATCH; +} + +//static +S32 LLVersionInfo::getBuild() +{ + return LL_VIEWER_VERSION_BUILD; +} + +//static +const std::string &LLVersionInfo::getVersion() +{ + static std::string version(""); + if (version.empty()) + { + std::ostringstream stream; + stream << LLVersionInfo::getShortVersion() << "." << LLVersionInfo::getBuild(); + // cache the version string + version = stream.str(); + } + return version; +} + +//static +const std::string &LLVersionInfo::getShortVersion() +{ + static std::string short_version(""); + if(short_version.empty()) + { + // cache the version string + std::ostringstream stream; + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH; + short_version = stream.str(); + } + return short_version; +} + +namespace +{ + /// Storage of the channel name the viewer is using. + // The channel name is set by hardcoded constant, + // or by calling LLVersionInfo::resetChannel() + std::string sWorkingChannelName(LL_VIEWER_CHANNEL); + + // Storage for the "version and channel" string. + // This will get reset too. + std::string sVersionChannel(""); +} + +//static +const std::string &LLVersionInfo::getChannelAndVersion() +{ + if (sVersionChannel.empty()) + { + // cache the version string + sVersionChannel = LLVersionInfo::getChannel() + " " + LLVersionInfo::getVersion(); + } + + return sVersionChannel; +} + +//static +const std::string &LLVersionInfo::getChannel() +{ + return sWorkingChannelName; +} + +void LLVersionInfo::resetChannel(const std::string& channel) +{ + sWorkingChannelName = channel; + sVersionChannel.clear(); // Reset version and channel string til next use. +} + +//static +LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity() +{ + ViewerMaturity maturity; + + std::string channel = getChannel(); + + static const boost::regex is_test_channel("\\bTest\\b"); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_release_channel("\\bRelease\\b"); + + if (boost::regex_search(channel, is_release_channel)) + { + maturity = RELEASE_VIEWER; + } + else if (boost::regex_search(channel, is_beta_channel)) + { + maturity = BETA_VIEWER; + } + else if (boost::regex_search(channel, is_project_channel)) + { + maturity = PROJECT_VIEWER; + } + else if (boost::regex_search(channel, is_test_channel)) + { + maturity = TEST_VIEWER; + } + else + { + LL_WARNS() << "Channel '" << channel + << "' does not follow naming convention, assuming Test" + << LL_ENDL; + maturity = TEST_VIEWER; + } + return maturity; +} + + diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h new file mode 100644 index 000000000..4e75535ec --- /dev/null +++ b/indra/newview/llversioninfo.h @@ -0,0 +1,82 @@ +/** + * @file llversioninfo.h + * @brief Routines to access the viewer version and build information + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLVERSIONINFO_H +#define LL_LLVERSIONINFO_H + +#include +#include "stdtypes.h" + +/// +/// This API provides version information for the viewer. This +/// includes access to the major, minor, patch, and build integer +/// values, as well as human-readable string representations. All +/// viewer code that wants to query the current version should +/// use this API. +/// +class LLVersionInfo +{ +public: + /// return the major verion number as an integer + static S32 getMajor(); + + /// return the minor verion number as an integer + static S32 getMinor(); + + /// return the patch verion number as an integer + static S32 getPatch(); + + /// return the build number as an integer + static S32 getBuild(); + + /// return the full viewer version as a string like "2.0.0.200030" + static const std::string &getVersion(); + + /// return the viewer version as a string like "2.0.0" + static const std::string &getShortVersion(); + + /// return the viewer version and channel as a string + /// like "Second Life Release 2.0.0.200030" + static const std::string &getChannelAndVersion(); + + /// return the channel name, e.g. "Second Life" + static const std::string &getChannel(); + + /// reset the channel name used by the viewer. + static void resetChannel(const std::string& channel); + + typedef enum + { + TEST_VIEWER, + PROJECT_VIEWER, + BETA_VIEWER, + RELEASE_VIEWER + } ViewerMaturity; + static ViewerMaturity getViewerMaturity(); +}; + +#endif diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index abcac1719..4ac560651 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -70,7 +70,6 @@ #include "llnotify.h" #include "llkeyboard.h" #include "llerrorcontrol.h" -#include "sgversion.h" #include "llappviewer.h" #include "llvosurfacepatch.h" #include "llvowlsky.h" @@ -98,7 +97,6 @@ LLControlGroup gColors("Colors"); // saved at end of session LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session std::string gLastRunVersion; -std::string gCurrentVersion; extern BOOL gResizeScreenTexture; extern BOOL gDebugGL; diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index d8bdf3670..0fd6b9cd4 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -67,8 +67,6 @@ extern LLControlGroup gCrashSettings; // Set after settings loaded extern std::string gLastRunVersion; -extern std::string gCurrentVersion; - bool handleCloudSettingsChanged(const LLSD& newvalue); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d2fdcb6fa..1a97a3463 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -126,7 +126,7 @@ #include "hippogridmanager.h" #include "hippolimits.h" #include "hippofloaterxml.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "m7wlinterface.h" #include "llgiveinventory.h" @@ -3845,7 +3845,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // hello from object if (from_id.isNull()) return; char buf[200]; - snprintf(buf, 200, "%s v%d.%d.%d", gVersionChannel, gVersionMajor, gVersionMinor, gVersionPatch); + snprintf(buf, 200, "%s v%d.%d.%d", LLVersionInfo::getChannel().c_str(), LLVersionInfo::getMajor(), LLVersionInfo::getMinor(), LLVersionInfo::getPatch()); send_chat_from_viewer(buf, CHAT_TYPE_WHISPER, 427169570); sChatObjectAuth[from_id] = 1; return; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 3ff7a33e0..41cf0f276 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -51,6 +51,7 @@ #include "llagentcamera.h" #include "llviewercontrol.h" #include "llfloaterdirectory.h" +#include "llversioninfo.h" #include "llfloatertools.h" #include "lldebugview.h" #include "llfasttimerview.h" @@ -780,7 +781,7 @@ void send_stats() // send fps only for time app spends in foreground agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32(); - agent["version"] = gCurrentVersion; + agent["version"] = LLVersionInfo::getChannelAndVersion(); std::string language = LLUI::getLanguage(); agent["language"] = language; diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index aed18769e..3e459a040 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -47,7 +47,7 @@ #include "llalertdialog.h" #include "llui.h" #include "lluri.h" -#include "sgversion.h" +#include "llversioninfo.h" #include "llviewercontrol.h" #include "llviewernetwork.h" #include "llviewerparcelmgr.h" @@ -214,12 +214,12 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, const LLSD &default_subs) { LLSD substitution = default_subs; - substitution["VERSION"] = gCurrentVersion; - substitution["VERSION_MAJOR"] = gVersionMajor; - substitution["VERSION_MINOR"] = gVersionMinor; - substitution["VERSION_PATCH"] = gVersionPatch; - substitution["VERSION_BUILD"] = gVersionBuild; - substitution["CHANNEL"] = gVersionChannel; + substitution["VERSION"] = LLVersionInfo::getVersion(); + substitution["VERSION_MAJOR"] = LLVersionInfo::getMajor(); + substitution["VERSION_MINOR"] = LLVersionInfo::getMinor(); + substitution["VERSION_PATCH"] = LLVersionInfo::getPatch(); + substitution["VERSION_BUILD"] = LLVersionInfo::getBuild(); + substitution["CHANNEL"] = LLVersionInfo::getChannel(); const HippoGridInfo* grid(gHippoGridManager->getCurrentGrid()); std::string gridId(grid->isSecondLife() ? getLoginUriDomain() : grid->getGridName()); if (grid->isSecondLife()) diff --git a/indra/newview/res/viewerRes.rc.in b/indra/newview/res/viewerRes.rc similarity index 86% rename from indra/newview/res/viewerRes.rc.in rename to indra/newview/res/viewerRes.rc index 0119f9fd9..4f02238a9 100644 --- a/indra/newview/res/viewerRes.rc.in +++ b/indra/newview/res/viewerRes.rc @@ -13,8 +13,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -// Commented out because it only compiles if you have MFC installed. -//#include "winres.h" +#include "windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -41,7 +40,7 @@ END 2 TEXTINCLUDE BEGIN - "#include ""winres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END @@ -61,8 +60,8 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_LL_ICON ICON "${VIEWER_BRANDING_ID}_icon.ico" -IDI_LCD_LL_ICON ICON "${VIEWER_BRANDING_ID}_icon.ico" +IDI_LL_ICON ICON "singularity_icon.ico" +IDI_LCD_LL_ICON ICON "singularity_icon.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -74,7 +73,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE FONT 8, "MS Sans Serif" BEGIN ICON IDI_LL_ICON,IDC_STATIC,7,7,20,20 - LTEXT "Loading ${VIEWER_CHANNEL}...",666,36,13,91,8 + LTEXT "Loading Singularity Viewer...",666,36,13,91,8 END @@ -123,14 +122,14 @@ TOOLPICKOBJECT3 CURSOR "toolpickobject3.cur" ARROWCOPY CURSOR "arrowcop.cur" ARROWDRAGMULTI CURSOR "llarrowdragmulti.cur" ARROWCOPYMULTI CURSOR "arrowcopmulti.cur" -TOOLSIT CURSOR "toolsit.cur" -TOOLBUY CURSOR "toolbuy.cur" -TOOLPAY CURSOR "toolpay.cur" -TOOLOPEN CURSOR "toolopen.cur" TOOLPIPETTE CURSOR "toolpipette.cur" TOOLPLAY CURSOR "toolplay.cur" TOOLPAUSE CURSOR "toolpause.cur" TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" +TOOLBUY CURSOR "toolbuy.cur" +TOOLPAY CURSOR "toolpay.cur" +TOOLOPEN CURSOR "toolopen.cur" +TOOLSIT CURSOR "toolsit.cur" ///////////////////////////////////////////////////////////////////////////// // @@ -138,8 +137,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} - PRODUCTVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} + FILEVERSION ${VIEWER_VERSION_MAJOR},${VIEWER_VERSION_MINOR},${VIEWER_VERSION_PATCH},${VIEWER_VERSION_REVISION} + PRODUCTVERSION ${VIEWER_VERSION_MAJOR},${VIEWER_VERSION_MINOR},${VIEWER_VERSION_PATCH},${VIEWER_VERSION_REVISION} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -156,12 +155,12 @@ BEGIN BEGIN VALUE "CompanyName", "Siana Gearz" VALUE "FileDescription", "Singularity Viewer" - VALUE "FileVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" + VALUE "FileVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright © 2001-2010, Linden Research, Inc., Copyright 2010 Siana Gearz" VALUE "OriginalFilename", "SingularityViewer.exe" VALUE "ProductName", "Singularity Viewer" - VALUE "ProductVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" + VALUE "ProductVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}" END END BLOCK "VarFileInfo" @@ -170,12 +169,6 @@ BEGIN END END - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/sgversion.cpp b/indra/newview/sgversion.cpp deleted file mode 100644 index 615064f27..000000000 --- a/indra/newview/sgversion.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2012 Siana Gearz - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA */ - -#include "llviewerprecompiledheaders.h" - -#include "llversionviewer.h" - -#include "sgversion.h" - -const S32 gVersionMajor = LL_VERSION_MAJOR; -const S32 gVersionMinor = LL_VERSION_MINOR; -const S32 gVersionPatch = LL_VERSION_PATCH; -const S32 gVersionBuild = LL_VERSION_BUILD; - -const char* gVersionChannel = LL_CHANNEL; - -#if LL_DARWIN -const char* gVersionBundleID = LL_VERSION_BUNDLE_ID; -#endif \ No newline at end of file diff --git a/indra/newview/sgversion.h b/indra/newview/sgversion.h deleted file mode 100644 index afdc8b51a..000000000 --- a/indra/newview/sgversion.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2012 Siana Gearz - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA */ - -#ifndef SGVERSION_H -#define SGVERSION_H - -extern const S32 gVersionMajor; -extern const S32 gVersionMinor; -extern const S32 gVersionPatch; -extern const S32 gVersionBuild; - -extern const char* gVersionChannel; - -#if LL_DARWIN -extern const char* gVersionBundleID; -#endif - -#endif