msi: Add checking to attributes for generate the popup menu in SelectionTree control...
authorIlya Shpigor <shpigor@etersoft.ru>
Sat, 1 Aug 2009 08:46:08 +0000 (12:46 +0400)
committerVitaly Lipatov <lav@etersoft.ru>
Sat, 1 Aug 2009 11:56:21 +0000 (15:56 +0400)
dlls/msi/dialog.c

index 36c58d241c7db498886341ce68912278e127a531..d8c11df0e7dd3a68272a49f5d198e92949e2eaa4 100644 (file)
@@ -1858,7 +1858,7 @@ msi_seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem )
 }
 
 static UINT
-msi_seltree_popup_menu( HWND hwnd, INT x, INT y )
+msi_seltree_popup_menu( HWND hwnd, INT x, INT y, INT Attributes )
 {
     HMENU hMenu;
     INT r;
@@ -1869,8 +1869,10 @@ msi_seltree_popup_menu( HWND hwnd, INT x, INT y )
     /* FIXME: load strings from resources */
     AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_LOCAL, "Install feature locally");
     AppendMenuA( hMenu, MF_GRAYED, 0x1000, "Install entire feature");
-    AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ADVERTISED, "Install on demand");
-    AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ABSENT, "Don't install");
+    if (!(Attributes & msidbFeatureAttributesDisallowAdvertise))
+        AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ADVERTISED, "Install on demand");
+    if (!(Attributes & msidbFeatureAttributesUIDisallowAbsent))
+        AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ABSENT, "Don't install");
     r = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD,
                         x, y, 0, hwnd, NULL );
     DestroyMenu( hMenu );
@@ -1919,7 +1921,7 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem )
     SendMessageW( hwnd, TVM_GETITEMRECT, 0, (LPARAM) &u.rc );
     MapWindowPoints( hwnd, NULL, u.pt, 2 );
 
-    r = msi_seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
+    r = msi_seltree_popup_menu( hwnd, u.rc.left, u.rc.top, feature->Attributes );
 
     switch (r)
     {