This pull request aims to improve the way we retrieve the appData path on Windows. Currently, we are using std::filesystem::temp_directory_path() and getting its parent twice. However, this method is not reliable as it uses the TEMP environment variable, which can be modified by the user. In such cases, getting the parent twice will not lead us to the correct path.
Solution
To address this issue, we will now use the Windows API method GetKnownFolder. This method is more reliable as it directly retrieves the appData path.
Additional Changes
Unit tests for CommonUtility::getAppSupportpath() to ensure it works as expected.
A quick fix for the isVersionLower function, which was not working as expected. (And its unit test).
Description
This pull request aims to improve the way we retrieve the appData path on Windows. Currently, we are using std::filesystem::temp_directory_path() and getting its parent twice. However, this method is not reliable as it uses the TEMP environment variable, which can be modified by the user. In such cases, getting the parent twice will not lead us to the correct path.
Solution
To address this issue, we will now use the Windows API method GetKnownFolder. This method is more reliable as it directly retrieves the appData path.
Additional Changes
Checklist: