Hello.
I have a msi package which exposes features to users to select them for the installation. In one special case one of the features must not be visible to the user, so, the user is not able to select it for installation.
Is it possible to implement this situation with modifying Display column of Feature table at run time?
I tried to change with custom action which is called before first dialog appears (InstallWelcome). The custom action is implemented in executable .dll file. An insert from CA is as follows:
hDB = MsiGetActiveDatabase(hInstall); MsiDatabaseOpenView(hDB, _T("select * from Feature"), &hView); MsiViewExecute(hView, 0); while ((err = MsiViewFetch(hView, &hRec)) == ERROR_SUCCESS) { MsiRecordGetString(hRec, 1, feature, &fSize); if (strcmp(feature, "special_feature") == 0) { attrs = MsiRecordGetInteger(hRec, 5); MsiRecordSetInteger(hRec, 5, 0); MsiViewModify(hView, MSIMODIFY_UPDATE, hRec); break; } }
However, running such code MsiViewModify always return 1627 - The function failed during execution regardles of type used (instead of MSIMODIFY_UPDATE I also tried MSIMODIFY_REPLACE).
I also tried to implement in a way that I open the query with SQL statement for update (instead of featching records and update them). The same error occured.
What I'm doing wrong? Is there maybe a fact that database is in that time in read-only mode? How can I open it in read-write mode?
Thanks in advance for answer!
Best regards,
Andreo