0

When we launch an msi, after some screens we will get the feature selection page.

Feature selection page:

enter image description here

We can remove any feature by just changing the feature table, display column value to 0.

But how to alter it at runtime, I mean, based on some property value,which might get altered from a different custom dialog we add or based on a custom action.

I tried by creating a property and adding that property at the display column of feature table as [Property1].

But it is not accepting non-integer values.

Any suggestion, how to implement this please.

I tried this so far.

Created a custom action of vbscript type

UpdateFeatureDisplay "erwinDM",Session.Property("DM_VISIBLE")   
UpdateFeatureDisplay "NoSQLStandalone",Session.Property("NS_VISIBLE")   

Sub UpdateFeatureDisplay(featureName,display)   
    Set viewlist = Database.OpenView("SELECT * FROM `Feature` WHERE `Feature`='"& featureName &"'")
    viewlist.Execute
    Set reclist = viewlist.Fetch
    viewlist.Modify 6 , reclist
    reclist.StringData(5)= CStr(display)
    'reclist.IntegerData(5)= CInt(display)
    viewlist.Modify 7 , reclist 
    viewlist.Close
End Sub

And, kept it to trigger when I click next , before the custom feature selection page.Where I take values from the check boxes.

But I am getting error in the log as below.

MSI (c) (14:B4) [17:50:30:269]: Note: 1: 1720 2: setFeatureDisplay 3: -2147467259 4: Msi API Error 5: Modify,Mode,Record 6: 8 7: 2 
Action ended 17:50:30: setFeatureDisplay. Return value 1.

Instead of keeping it in the Next event of dialog, if I keep it after setupinitilialization of ui sequence, it is not giving the above error.But not reflecting in the feature page also.

If we pass the property value, which are altering using UI, as a command line parameter, then only it is reflecting.I mean, during launch of msi.

  • Installation state of a feature is controlled by Level of feature and INSTALLLEVEL property. – montonero Apr 29 at 13:17
  • Thanks for the reply, but I am asking for display of features at the custom install dialog selection tree, I mean in the UI. – user2331760 Apr 29 at 18:47
0

If you want to remove the feature from a tree at a runtime then you'll need to modify Feature table with an SQL query within a custom action. Something like this (I didn't test the code but it should be pretty close to your needs):

featurename="Your Feature Name"
Set oView = Database.OpenView("SELECT * FROM `Feature` WHERE `Feature`='"&featurename&"'")
oView.Execute

' test on first Feature record
Set oRecord = oView.Fetch

' delete the original
oView.Modify 6, oRecord

' modify and temporarily write back new
oRecord.IntegerData(5) = 0
oView.Modify 7, oRecord

' close up shop
oView.Close
  • I tried this script..But not reflecting..Any suggestions? – user2331760 Apr 30 at 21:20
  • Please be more descriptive. Have you looked the installation logs? How did you created the custom action? – montonero Apr 30 at 23:33
  • Added the details in the question by editing it again, can you please check it once. – user2331760 May 2 at 12:27
  • Do not use UI sequence, use only InstallExecuteSequence. Otherwise you'll get in troubles with silent installation. And why you're using StringData instead of IntegerData? As far as I can see, Display column is integer type. According to the log, something is wrong with this line viewlist.Modify 6 , reclist. Check that reclist is not nothing. – montonero May 3 at 20:47
  • Yeah, I got same error for both StringData and IntegerData.And, I want to execute this custom action only when user clicks on next button after a particular dialog.As I am checking the value of a checkbox on that dialog and only run this action if the checkbox is unchecked.So, I kept in UI sequence. – user2331760 May 6 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.