Where is qlmlicense.xml?
I have an activated license on a machine, but no idea where qlmlicense.xml is located. It is NOT in the documents folder and a drive search does not find it. Where is qlmlicense.xml?
Thanks,
-Erik
-
Official comment
Hi Erik
There's no qlmLicense.xml for Windows C++ apps. The qlmLicense.xml is just used for mobile / cross platform apps.
For C++ windows apps, the license is stored typically in the registry although it can also be stored on the file system.
For more information about where keys are stored, check this article.
John
Comment actions -
Okay, I have this but it always fails the Validate with "Data at the root level is invalid. Line 1, position 1." (XXXXXX is the guid), it IS reading the registry entry properly :
HKEY hKey; if( ::RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{XXXXXXX}\\Elevation", 0, KEY_READ, &hKey) != ERROR_SUCCESS ) { return NULL; } WCHAR wszData[4096]; DWORD dwType = REG_SZ; DWORD cbData = sizeof(wszData); ::RegGetValueW(hKey, L"", NULL, RRF_RT_REG_SZ, &dwType, (PVOID)wszData, &cbData); ::RegCloseKey(hKey); CComBSTR bstrError; if (productProperties->ValidateSignature(wszData, _bstr_t(rsaPublicKey), &bstrError) == VARIANT_FALSE) { return NULL; } else { productProperties->Deserialize(wszData); IQlmProductPropertyPtr pp = productProperties->GetProperty(_bstr_t("engineering"), _bstr_t("module_eng")); OutputDebugString((LPCWSTR) (pp->PropValue.pbstrVal)); }
-
BTW, The original you sent me had this at the top:
// store the license file - you may want to customize the destination folder TCHAR docsFolder[MAX_PATH]; SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, 0, docsFolder); CString licenseFile = docsFolder + CString("\\") + productPropertiesFileName; std::ifstream inFile (licenseFile); //open the input file std::stringstream strStream; strStream << inFile.rdbuf();//read the file string str = strStream.str();//str holds the content of the file
-
Ok.
As per the sample that I sent you, the LicenseValidator class will call WriteProductProperties if the license validation succeeds. Note that you can call WriteProductProperties any time you want. The code I provided you is just an example.
If you look at the WriteProductProperties function in the LicenseValidator class, you will see that this function will create an xml file in the MyDocuments folder. Feel free to change the location of the file as you see fit.
Every time your application starts up, or whenever you want, you can call LicenseValidator::ReadProductProperties to read the license file.
Both ReadProductProperties and WriteProductProperties call ValidateSignature so you do not need to call ValidateSignature directly.
-
I figured it out based on what you said above. Works great now.
BSTR bstrResponse; BSTR bstrProps = theApp.m_lv->license->GetProductProperties(_bstr_t(""), _bstr_t(theApp.m_lv->activationKey), &bstrResponse); theApp.m_lv->productProperties->Deserialize(bstrProps); IQlmProductPropertyPtr pp = theApp.m_lv->productProperties->GetProperty(_bstr_t("category"), _bstr_t("callsign")); if( pp ) StringCchCopyW(wszCallsign, ARRAYSIZE(wszCallsign), (LPCWSTR) (pp->PropValue.pbstrVal)); else { LicensePropertyError: AfxMessageBox(L"Invalid License", MB_OK|MB_ICONEXCLAMATION); FreeLicenseResources (); SetCurrentDirectory(wszSavePath); ExitProcess(0); }
-
Thank you for all your help over the last couple of weeks. Support was great.
I wish there had been some basic documentation so I didn't need the aforementioned support. I may write up a "Getting Started" and send it to you to add to your website. People shouldn't have to jump in with no basic knowledge of how everything works. Development went from about two days to three weeks.
-Erik
Please sign in to leave a comment.
Comments
13 comments