From fdf616c59d87219e2d5ad6e12687cf2793cfba1e Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 9 Nov 2010 11:23:32 -0800 Subject: beginnings of the update installer (with simple install script for darwin). --- indra/viewer_components/updater/CMakeLists.txt | 23 ++++++++---- .../updater/llupdateinstaller.cpp | 38 ++++++++++++++++++++ .../viewer_components/updater/llupdateinstaller.h | 42 ++++++++++++++++++++++ .../updater/scripts/darwin/update_install | 6 ++++ 4 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 indra/viewer_components/updater/llupdateinstaller.cpp create mode 100644 indra/viewer_components/updater/llupdateinstaller.h create mode 100755 indra/viewer_components/updater/scripts/darwin/update_install (limited to 'indra/viewer_components') diff --git a/indra/viewer_components/updater/CMakeLists.txt b/indra/viewer_components/updater/CMakeLists.txt index 563b64655d..c3607dff39 100644 --- a/indra/viewer_components/updater/CMakeLists.txt +++ b/indra/viewer_components/updater/CMakeLists.txt @@ -6,6 +6,7 @@ include(00-Common) if(LL_TESTS) include(LLAddBuildTest) endif(LL_TESTS) +include(CMakeCopyIfDifferent) include(CURL) include(LLCommon) include(LLMessage) @@ -24,12 +25,14 @@ set(updater_service_SOURCE_FILES llupdaterservice.cpp llupdatechecker.cpp llupdatedownloader.cpp + llupdateinstaller.cpp ) set(updater_service_HEADER_FILES llupdaterservice.h llupdatechecker.h llupdatedownloader.h + llupdateinstaller.h ) set_source_files_properties(${updater_service_HEADER_FILES} @@ -56,12 +59,6 @@ if(LL_TESTS) llupdaterservice.cpp ) -# set_source_files_properties( -# llupdaterservice.cpp -# PROPERTIES -# LL_TEST_ADDITIONAL_LIBRARIES "${PTH_LIBRARIES}" -# ) - LL_ADD_PROJECT_UNIT_TESTS(llupdaterservice "${llupdater_service_TEST_SOURCE_FILES}") endif(LL_TESTS) @@ -74,3 +71,17 @@ set(UPDATER_LIBRARIES llupdaterservice CACHE INTERNAL "" ) + +# Copy install script. +if(DARWIN) + copy_if_different( + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/darwin" + "${CMAKE_CURRENT_BINARY_DIR}" + update_installer_targets + "update_install" + ) +endif() +add_custom_target(copy_update_install ALL DEPENDS ${update_installer_targets}) + + + \ No newline at end of file diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp new file mode 100644 index 0000000000..4d7c78d36c --- /dev/null +++ b/indra/viewer_components/updater/llupdateinstaller.cpp @@ -0,0 +1,38 @@ +/** + * @file llupdateinstaller.cpp + * + * $LicenseInfo:firstyear=2010&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 "linden_common.h" +#include "llprocesslauncher.h" +#include "llupdateinstaller.h" + + +void ll_install_update(std::string const & script, std::string const & updatePath) +{ + LLProcessLauncher launcher; + launcher.setExecutable(script); + launcher.addArgument(updatePath); + launcher.launch(); + launcher.orphan(); +} \ No newline at end of file diff --git a/indra/viewer_components/updater/llupdateinstaller.h b/indra/viewer_components/updater/llupdateinstaller.h new file mode 100644 index 0000000000..a6068e9025 --- /dev/null +++ b/indra/viewer_components/updater/llupdateinstaller.h @@ -0,0 +1,42 @@ +/** + * @file llupdateinstaller.h + * + * $LicenseInfo:firstyear=2010&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_UPDATE_INSTALLER_H +#define LL_UPDATE_INSTALLER_H + + +#include + + +// +// Launch the installation script. +// +// The updater will overwrite the current installation, so it is highly recommended +// that the current application terminate once this function is called. +// +void ll_install_update(std::string const & script, std::string const & updatePath); + + +#endif \ No newline at end of file diff --git a/indra/viewer_components/updater/scripts/darwin/update_install b/indra/viewer_components/updater/scripts/darwin/update_install new file mode 100755 index 0000000000..24d344ca52 --- /dev/null +++ b/indra/viewer_components/updater/scripts/darwin/update_install @@ -0,0 +1,6 @@ +#! /bin/bash + +hdiutil attach -nobrowse $1 +cp -R /Volumes/Second\ Life\ Installer/Second\ Life\ Viewer\ 2.app /Applications +hdiutil detach /Volumes/Second\ Life\ Installer +open /Applications/Second\ Life\ Viewer\ 2.app \ No newline at end of file -- cgit v1.2.3