Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Hiding a feature at runtime


2 replies to this topic

haroldxious

haroldxious
  • Full Members
  • 70 posts

Posted 05 June 2007 - 09:26

as i am thinking of a work around to do this, i have seen some post that i can change the value of the MSI DB to hide a feature at runtime.

I have used this. I call a CA in immediate execution to change the value in the feature table..
// Obtain a handle to the active database
hDataBase = MsiGetActiveDatabase(hMSI);
szSQL = "Select `Display` FROM `Feature` WHERE `Feature` = NewFeature1'";
nResult = MsiDatabaseOpenView(hDataBase, szSQL, hView);
nResult = MsiViewExecute(hView, NULL);
nResult = MsiViewFetch(hView, hRec);
nResult = MsiViewModify(hView, MSIMODIFY_DELETE, hRec);
nResult = MsiRecordSetInteger(hRec, 5, 0);
nResult = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);

This works fine...but after i have tested the UI again and again i have comeup to see an error....

after executing the CA then on the selection tree..when i click back error 2711 appears telling that specified feature name not found on the feature table..
i know this is because of the MSIMODIFY_DELETE.

is there any workaround on how error 2711 will not appear?
MSIMODIFY_UPDATE doesnt work for me.




antyagi

antyagi
  • Full Members
  • 121 posts

Posted 05 June 2007 - 10:36

Use Condition on feature to set Level = 0.
  ankur tyagi

haroldxious

haroldxious
  • Full Members
  • 70 posts

Posted 05 June 2007 - 10:42

how to set that condition? what will be the values in the Event, argument and condition column in the dialog behavior?