okutil_find_path_from_origin_registry_key

 

Description

Checks registry key for stored origin user path or executible path, for any version of Origin. These paths may not be associated with the currently running origin.

Syntax

BOOL okutil_find_path_from_origin_registry_key( string * pstrPath, LPCTSTR lpszPathKey, LPCSTR lpszAppTitle, LPCSTR lpcszSubVersionName = NULL, LPCSTR lpcszSpecialChar = NULL, LPCSTR lpcszLanguage = NULL )

Parameters

pstrPath
[output] path found
lpszPathKey
[input] either "Path" for User Folder, or "Executable Path" for system folder.
lpszAppTitle
[input] title used in registry ex "Origin 7.5", "Origin 8"
lpcszSubVersionName
[input] Default NULL. Example: "Beta 4" "Academic"
lpcszSpecialChar
[input] Default NULL. Special Character. For Origin 8, only D allowed. Examples for 7.5: "S" for Server, "C" for Client, "A" for Student (Academic). Example for 8.0 or 7.5 "D" for Debug. Can combine "SD"
lpcszLanguage
[input] Default NULL. Language string: "English", Japanese", "German" required for < Origin 8. For Origin 8+ use NULL.

Return

Return TRUE if the path string can be found in registry and path exists on disk.

Examples

EX1

#include <oUtils.h>
void okutil_find_path_from_origin_registry_key_ex1()
{    
    string strPath;
    BOOL bExists = okutil_find_path_from_origin_registry_key(&strPath, "Path", "Origin 7.5", NULL, NULL, "English");
    if(!bExists) // try Server
        bExists = okutil_find_path_from_origin_registry_key(&strPath, "Path", "Origin 7.5", NULL, "S", "English");
    if(!bExists) // try Client
        bExists = okutil_find_path_from_origin_registry_key(&strPath, "Path", "Origin 7.5", NULL, "C", "English");

}

Remark

See Also

header to Include

origin.h

Reference