-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fixes Issue #242 - CPID Stuck on INVESTOR Due to invalid BOINC Data Path Detection #275
Fixes Issue #242 - CPID Stuck on INVESTOR Due to invalid BOINC Data Path Detection #275
Conversation
Why create a full class with constructor and multiple methods when a simple function would be sufficient? |
@tonemackay Yes, this can be condensed down to just a function. A couple of notes:
|
My reasoning was so that the call to the registry etc only happens once and therefore multiple calls to The Maybe you are right and it's overkill especially if the function is only called once and should just go into main? |
@tonemackay Keep the code in boinc.cpp. I want to move as much of the Gridcoin code out of main.cpp to organize things. I'' try to do an additional test this evening. |
…tBoinDataDir function from boinc.cpp
src/boinc.cpp
Outdated
&dwSize) == ERROR_SUCCESS){ | ||
RegCloseKey(hKey); | ||
std::wstring wsPath = szPath; | ||
std::string path(wsPath.begin(),wsPath.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail on unicode systems but we probably want to use wstring for all file paths, so leave it for now.
src/main.cpp
Outdated
@@ -242,7 +243,7 @@ std::string msMasterMessagePublicKey = "044b2938fbc38071f24bede21e838a0758a52a0 | |||
|
|||
std::string BackupGridcoinWallet(); | |||
extern double GetPoSKernelPS2(); | |||
extern std::string GetBoincDataDir2(); | |||
extern std::string GetBoincDataDir(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can be removed.
Does anyone (@tomasbrod?) have an easy solution for the wstring->string issue? Otherwise we will merge this now and make all the file operations unicode later. |
I dont @denravonska |
for the record on github, i suggested in IRC to maybe make the whole thing UTF-8 as described in a stackoverflow thread. apparently you should only use wstring if you have a specific need for it. |
@Peppernrino thanks for the link you posted in IRC. The issue I'm having is the function call to the Windows registry returns wstring and converting it to a normal string is a bitch. @denravonska I've tried using |
Maybe note and disregard that users can install to different drives and paths. A Win scenario is primary drive C is low on spare capacity so users path to a second drive (mapped or direct). They can create their own installation folder then install to that. They can do this for BOINC and Gridcoin for both data and applications. Considering the frequency of this scenario is low, go round it maybe but note it and caveat for it (about Gridcoin>'this is test software' or Gridcoin EULA (End User License Agreement) https://www.eff.org/wp/dangerous-terms-users-guide-eulas. |
This still needs testing and may need some extra work to get it up to standards but it's the start of a fix for the BOINC data path issue.