There seems to be no error in this function. But when installing with the "Install & for all users" checkbox, the folder is created in CSIDL_PROGRAMS instead of CSIDL_COMMON_PROGRAMS.
void GetProgramPath (HWND hwndDlg, wchar_t *path)
{
ITEMIDLIST *i;
HRESULT res;
if (bForAllUsers)
res = SHGetSpecialFolderLocation (hwndDlg, CSIDL_COMMON_PROGRAMS, &i);
else
res = SHGetSpecialFolderLocation (hwndDlg, CSIDL_PROGRAMS, &i);
SHGetPathFromIDList (i, path);
}
Windows 10
I work as a regular user. "Run as administrator" is a separate account.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There seems to be no error in this function. But when installing with the "Install & for all users" checkbox, the folder is created in CSIDL_PROGRAMS instead of CSIDL_COMMON_PROGRAMS.
Windows 10
I work as a regular user. "Run as administrator" is a separate account.