From c07f8395455ebf321566bd3f99a21caa65732aad 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 --- 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 f0794ee67277cbad3490a8da57dd6314603219bf 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 --- 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 14d90e4292ed46bd1898402293fa2321e4d105e3 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 --- 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 589e3202661b7a5aa8f91311ff965b937d0691f5 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 --- 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