MsiEnumRelatedProducts 参数无效 [英] MsiEnumRelatedProducts Invalid Parameter
问题描述
尝试使用具有各种输入的 MsiEnumRelatedProducts 对我来说总是只返回 ERROR_INVALID_PARAMETERS.该文档没有详细说明无效参数的来源可能是什么,但我尝试了许多不同的选项.目前我在下面有这个代码来演示这个问题.将 替换为有效的升级指南.
Attempting to use MsiEnumRelatedProducts with various input is constantly returning only ERROR_INVALID_PARAMETERS for me. The documentation doesn't give any details on what the source of the invalid parameter could be but I've tried many different options. Currently I have this code below to demonstrate the problem. Replace the with a valid upgrade guid.
int _tmain(int argc, _TCHAR* argv[]){const wchar_t* upgrade = L"812D9038-YOUR-GUID-B2EB-64F4E0B3FB3D";wchar_t 产品[39];DWORD 索引 = 0;
int _tmain(int argc, _TCHAR* argv[]) { const wchar_t* upgrade = L"812D9038-YOUR-GUID-B2EB-64F4E0B3FB3D"; wchar_t product[39]; DWORD index = 0;
switch (MsiEnumRelatedProducts(upgrade, 0, index++, product)) {
case ERROR_SUCCESS:
wcout << L"ERROR_SUCCESS" << endl;
break;
case ERROR_NO_MORE_ITEMS:
wcout << L"ERROR_NO_MORE_ITEMS" << endl;
break;
case ERROR_BAD_CONFIGURATION:
wcout << L"ERROR_BAD_CONFIGURATION" << endl;
break;
case ERROR_INVALID_PARAMETER:
wcout << L"ERROR_INVALID_PARAMETER" << endl;
break;
case ERROR_NOT_ENOUGH_MEMORY:
wcout << L"ERROR_NOT_ENOUGH_MEMORY" << endl;
break;
default:
wcout << L"DEFAULT" << endl;
break;
}
}
推荐答案
尝试将升级代码括在大括号中,使其看起来像 {GUID}.
Try enclosing your upgrade code in curly brackets so it looks like {GUID}.
这篇关于MsiEnumRelatedProducts 参数无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!