Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weaseldeployer x64 #1006

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions RimeWithWeasel/WeaselUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ const char* weasel_shared_data_dir() {
GetModuleFileNameA(NULL, path, _countof(path));
std::string str_path(path);
size_t k = str_path.find_last_of("/\\");
#ifdef _WIN64
strcpy_s(path + k - 3 , _countof(path) - (k + 3), "data");
#else
strcpy_s(path + k + 1, _countof(path) - (k + 1), "data");
#endif
strcpy_s(path + k + 1, _countof(path) - (k + 1), "data");
return path;
}

Expand Down
7 changes: 6 additions & 1 deletion WeaselDeployer/Configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <rime_levers_api.h>
#pragma warning(default: 4005)
#include <fstream>
#include <regex>
#include "WeaselDeployer.h"

static void CreateFileIfNotExist(std::string filename)
Expand All @@ -35,7 +36,11 @@ Configurator::Configurator()
void Configurator::Initialize()
{
RIME_STRUCT(RimeTraits, weasel_traits);
weasel_traits.shared_data_dir = weasel_shared_data_dir();
std::string shared_data_dir = weasel_shared_data_dir();
#ifdef _WIN64
shared_data_dir = std::regex_replace(shared_data_dir, std::regex("\\\\x64"), "");
fxliang marked this conversation as resolved.
Show resolved Hide resolved
#endif
weasel_traits.shared_data_dir = shared_data_dir.c_str();
weasel_traits.user_data_dir = weasel_user_data_dir();
weasel_traits.prebuilt_data_dir = weasel_traits.shared_data_dir;
const int len = 20;
Expand Down