diff options
author | Andrew A. de Laix <alain@lindenlab.com> | 2010-11-09 11:23:32 -0800 |
---|---|---|
committer | Andrew A. de Laix <alain@lindenlab.com> | 2010-11-09 11:23:32 -0800 |
commit | fdf616c59d87219e2d5ad6e12687cf2793cfba1e (patch) | |
tree | ec55d1532ed59426d2955e1d50bf5a48eab00b63 /indra/viewer_components | |
parent | 1a711b3fd5912776424012fcfcb472baf6c195af (diff) |
beginnings of the update installer (with simple install script for darwin).
Diffstat (limited to 'indra/viewer_components')
4 files changed, 103 insertions, 6 deletions
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 <string> + + +// +// 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 |