From 3f2d1da933857a4b6804d4488d051a164d0892d4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Feb 2016 16:36:46 +0100 Subject: [PATCH 1/4] Added: Scripts launched after patch --HG-- branch : develop --- code/ryzom/client/macosx/upgd_nl.sh | 38 +++++++++++++++++++++++++++++ code/ryzom/client/unix/upgd_nl.sh | 15 ++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 code/ryzom/client/macosx/upgd_nl.sh create mode 100644 code/ryzom/client/unix/upgd_nl.sh diff --git a/code/ryzom/client/macosx/upgd_nl.sh b/code/ryzom/client/macosx/upgd_nl.sh new file mode 100644 index 000000000..046034027 --- /dev/null +++ b/code/ryzom/client/macosx/upgd_nl.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +if [ -z "$ROOTPATH" ] +then + echo "upgd_nl.sh can only be launched from updt_nl.sh" + exit 1 +fi + +# determine directory where all files reside +CONTENTSPATH=$(dirname $ROOTPATH) +MACOSPATH=$(dirname $RYZOM_CLIENT) +SIGNPATH=$CONTENTSPATH/_CodeSignature + +# all files of original Bundle are in the same directory +# we have to copy them to the right location + +# client_default.cfg and ryzom.icns are already in the right location + +# PkgInfo usually doesn't change so don't copy it + +# Info.plist contains updated version +cp -p $ROOTPATH/Info.plist $CONTENTSPATH + +cp -p $ROOTPATH/CodeResources $SIGNPATH + +# executable flag for all executables +chmod +x $ROOTPATH/Ryzom +chmod +x $ROOTPATH/CrashReport +chmod +x $ROOTPATH/RyzomClientPatcher +chmod +x $ROOTPATH/RyzomConfiguration + +# copy all binaries in MacOS directory +cp -p $ROOTPATH/Ryzom $MACOSPATH +cp -p $ROOTPATH/CrashReport $MACOSPATH +cp -p $ROOTPATH/RyzomClientPatcher $MACOSPATH +cp -p $ROOTPATH/RyzomConfiguration $MACOSPATH + +exit 0 diff --git a/code/ryzom/client/unix/upgd_nl.sh b/code/ryzom/client/unix/upgd_nl.sh new file mode 100644 index 000000000..a1af6867e --- /dev/null +++ b/code/ryzom/client/unix/upgd_nl.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ -z "$ROOTPATH" ] +then + echo "upgd_nl.sh can only be launched from updt_nl.sh" + exit 1 +fi + +# executable flag for all executables +chmod +x $ROOTPATH/ryzom_client +chmod +x $ROOTPATH/crash_report +chmod +x $ROOTPATH/ryzom_client_patcher +chmod +x $ROOTPATH/ryzom_configuration + +exit 0 From eac2cec7839712dc0cb5f5b67c09f0c49cea02fe Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Feb 2016 16:38:12 +0100 Subject: [PATCH 2/4] Fixed: Wrong check for OS X --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 8208d6e28..bd806e8bf 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -171,7 +171,7 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st ForceRemovePatchCategories.push_back("main_exedll_linux32"); ForceRemovePatchCategories.push_back("main_exedll_linux64"); ForceRemovePatchCategories.push_back("main_exedll_osx"); -#elif defined(NL_OS_APPLE) +#elif defined(NL_OS_MAC) ForceRemovePatchCategories.push_back("main_exedll_win32"); ForceRemovePatchCategories.push_back("main_exedll_win64"); ForceRemovePatchCategories.push_back("main_exedll_linux32"); From 3ddefec294eec1d9df4893d2b18929df0f37df1c Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Feb 2016 16:41:53 +0100 Subject: [PATCH 3/4] Changed: Delete updt_nl.bat/sh only when patch enabled and after determining ClientRootPath --HG-- branch : develop --- code/ryzom/client/src/client.cpp | 18 ------------------ code/ryzom/client/src/login_patch.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 63392dd15..e4a77b3c6 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -275,20 +275,6 @@ int main(int argc, char **argv) pump (); - // Delete the .bat file because it s not useful anymore - if (NLMISC::CFile::fileExists("updt_nl.bat")) - NLMISC::CFile::deleteFile("updt_nl.bat"); - if (NLMISC::CFile::fileExists("bug_report.exe")) - NLMISC::CFile::deleteFile("bug_report.exe"); - if (NLMISC::CFile::fileExists("bug_report_r.exe")) - NLMISC::CFile::deleteFile("bug_report_r.exe"); - if (NLMISC::CFile::fileExists("bug_report_rd.exe")) - NLMISC::CFile::deleteFile("bug_report_rd.exe"); - if (NLMISC::CFile::fileExists("bug_report_df.exe")) - NLMISC::CFile::deleteFile("bug_report_df.exe"); - if (NLMISC::CFile::fileExists("bug_report_d.exe")) - NLMISC::CFile::deleteFile("bug_report_d.exe"); - // Delete all the .ttf file in the /data directory { vector files; @@ -303,10 +289,6 @@ int main(int argc, char **argv) #else // TODO for Linux : splashscreen - - // Delete the .sh file because it s not useful anymore - if (NLMISC::CFile::fileExists("updt_nl.sh")) - NLMISC::CFile::deleteFile("updt_nl.sh"); #endif // initialize patch manager and set the ryzom full path, before it's used diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index bd806e8bf..20bfcbed0 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -195,6 +195,12 @@ void CPatchManager::setClientRootPath(const std::string& clientRootPath) ClientRootPath = CPath::standardizePath(clientRootPath); ClientPatchPath = CPath::standardizePath(ClientRootPath + "unpack"); + // Delete the .sh file because it's not useful anymore + std::string fullUpdateBatchFilename = ClientRootPath + UpdateBatchFilename; + + if (NLMISC::CFile::fileExists(fullUpdateBatchFilename)) + NLMISC::CFile::deleteFile(fullUpdateBatchFilename); + WritableClientDataPath = CPath::standardizePath(ClientRootPath + "data"); #ifdef NL_OS_MAC From d39911345eaaef579840538616c68f78af90a8ed Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Feb 2016 16:44:08 +0100 Subject: [PATCH 4/4] Fixed: Only use "open" if extension is app --HG-- branch : develop --- code/nel/src/misc/common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index d902cf47b..5954ac9c9 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -806,7 +806,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments, #ifdef NL_OS_MAC // special OS X case with bundles - if (toLower(programName).find(".app") != std::string::npos) + if (toLower(CFile::getExtension(programName)) == ".app") { // we need to open bundles with "open" command std::string command = NLMISC::toString("open \"%s\"", programName.c_str()); @@ -914,7 +914,7 @@ bool launchProgramArray (const std::string &programName, const std::vector