Tools/Patcher
* Client patcher no longer has to be ran from administrator level command line to successfully create bnet module * Set patched bnet module as readonly to prevent wow from deleting it
This commit is contained in:
1 parent
d1017e1c62
commit
40c865612a
1 file changed
+8
-4
@@ -43,6 +43,8 @@ namespace Connection_Patcher
|
|||||||
template<typename PATCH, typename PATTERN>
|
template<typename PATCH, typename PATTERN>
|
||||||
void PatchModule(boost::filesystem::path file, boost::filesystem::path path)
|
void PatchModule(boost::filesystem::path file, boost::filesystem::path path)
|
||||||
{
|
{
|
||||||
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
std::cout << "Patching module...\n";
|
std::cout << "Patching module...\n";
|
||||||
|
|
||||||
Patcher patcher(file);
|
Patcher patcher(file);
|
||||||
@@ -50,13 +52,15 @@ namespace Connection_Patcher
|
|||||||
patcher.Patch(PATCH::Password(), PATTERN::Password());
|
patcher.Patch(PATCH::Password(), PATTERN::Password());
|
||||||
|
|
||||||
std::string const moduleName(Helper::GetFileChecksum(patcher.binary) + ".auth");
|
std::string const moduleName(Helper::GetFileChecksum(patcher.binary) + ".auth");
|
||||||
boost::filesystem::path const modulePath
|
fs::path const modulePath
|
||||||
(path / std::string(&moduleName[0], 2) / std::string(&moduleName[2], 2));
|
(path / std::string(&moduleName[0], 2) / std::string(&moduleName[2], 2));
|
||||||
|
|
||||||
if (!boost::filesystem::exists(modulePath))
|
if (!fs::exists(modulePath))
|
||||||
boost::filesystem::create_directories(modulePath);
|
fs::create_directories(modulePath);
|
||||||
|
|
||||||
|
fs::permissions(modulePath / moduleName, fs::add_perms | fs::others_write | fs::group_write | fs::owner_write);
|
||||||
patcher.Finish(modulePath / moduleName);
|
patcher.Finish(modulePath / moduleName);
|
||||||
|
fs::permissions(modulePath / moduleName, fs::remove_perms | fs::others_write | fs::group_write | fs::owner_write);
|
||||||
|
|
||||||
std::cout << "Patching module finished.\n";
|
std::cout << "Patching module finished.\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user