Skip to content

Commit aad9c4e

Browse files
authored
Workaround for windows service execution (#537)
IB-7759 Signed-off-by: Raul Metsma <[email protected]>
1 parent 0c0537d commit aad9c4e

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/util/File.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ string File::digidocppPath()
321321
{
322322
#ifdef _WIN32
323323
PWSTR knownFolder {};
324-
if(SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, nullptr, &knownFolder) != S_OK)
324+
if(SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_DONT_VERIFY, nullptr, &knownFolder) != S_OK)
325325
THROW("Failed to get home directory");
326326
string appData = (fs::path(knownFolder) / "digidocpp").u8string();
327327
CoTaskMemFree(knownFolder);
@@ -338,26 +338,6 @@ string File::digidocppPath()
338338
#endif
339339
}
340340

341-
/**
342-
* Returns true if the path is relative
343-
*
344-
* @return returns true if the path is relative
345-
*/
346-
bool File::isRelative(const string &path)
347-
{
348-
f_string _path = encodeName(path);
349-
if(_path.empty()) return true;
350-
if(_path[0] == '/') return false;
351-
#ifdef _WIN32
352-
// drive, e.g. "a:", or UNC root, e.q. "//"
353-
if( _path.length() >= 2 &&
354-
((iswalpha(_path[0]) && _path[1] == ':') ||
355-
(_path[0] == '/' && _path[1] == '/')) )
356-
return false;
357-
#endif
358-
return true;
359-
}
360-
361341
/**
362342
* Constructs the full file path in the format "file:///fullpath" in URI encoding.
363343
*

0 commit comments

Comments
 (0)