mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-29 19:17:41 +00:00
Merge pull request #3100 from keymanapp/fix/windows/sentry-db-location
fix(windows): use consistent sentry db location
This commit is contained in:
commit
3fc41c3bac
2 changed files with 15 additions and 9 deletions
|
|
@ -299,7 +299,7 @@ begin
|
|||
end;
|
||||
|
||||
o.HandlerPath := ExtractFilePath(FindSentryDLL) + 'crashpad_handler.exe';
|
||||
o.DatabasePath := TKeymanPaths.ErrorLogPath('sentry-db');
|
||||
o.DatabasePath := TKeymanPaths.ErrorLogPath + 'sentry-db';
|
||||
|
||||
FClient := SentryClientClass.Create(o, ALogger, f);
|
||||
FClient.OnAfterEvent := ClientAfterEvent;
|
||||
|
|
|
|||
|
|
@ -32,15 +32,21 @@ int keyman_sentry_init(bool is_keyman_developer, const char *logger) {
|
|||
// Set the sentry-db-directory to a writeable location
|
||||
|
||||
char szPath[MAX_PATH + 17]; // length(keyman-sentry-db)+1
|
||||
GetTempPathA(MAX_PATH, szPath);
|
||||
char *p = strchr(szPath, 0);
|
||||
if (p > szPath && *(p - 1) != '\\') {
|
||||
*p++ = '\\';
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
strcat_s(szPath, "keyman-sentry-db");
|
||||
sentry_options_set_database_path(options, szPath);
|
||||
LPITEMIDLIST pidl;
|
||||
if (SUCCEEDED(SHGetFolderLocation(0, CSIDL_LOCAL_APPDATA, NULL, 0, &pidl))) {
|
||||
if (SUCCEEDED(SHGetPathFromIDListA(pidl, szPath))) {
|
||||
char *p = strchr(szPath, 0);
|
||||
if (p > szPath && *(p - 1) != '\\') {
|
||||
*p++ = '\\';
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
strcat_s(szPath, "sentry-db");
|
||||
sentry_options_set_database_path(options, szPath);
|
||||
}
|
||||
ILFree(pidl);
|
||||
}
|
||||
|
||||
sentry_options_set_release(options, "release-" KEYMAN_VersionWithTag); // matches git tag
|
||||
sentry_options_set_environment(options, KEYMAN_Environment); // stable, beta, alpha, test, local
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue