1

I have a custom action which must be executed if the spesial feature's action state is "install". Now I am using next condition:

(&ca_feature=3 AND NOT &ca_feature=2) OR (!ca_feature=3 AND PATCH) .

I want to execute it also in Modify Mode. When the feature is already installed and user do not want to delete it. I thaught to append OR (REINSTALL><ca_feature OR REINSTALL=ALL) to my condition string. but it seems not working.. I can't get how the MSI is working in some situations, that is my problem. but i also can't find the answer in the internet. Please,tell me what i'am doing/understanding wrong?thanx in advance

Be.St.
  • 4,101
  • 3
  • 25
  • 35
Nerielle
  • 984
  • 1
  • 11
  • 29

1 Answers1

2

The condition looks correctly. The last part with REINSTALL would be true if your feature is to be reinstalled.

Although you can try to use !ca_feature=3 instead of REINSTALL><ca_feature: that would run the CA when the feature is installed.


I think your condition could look this way:

(&ca_feature=3) OR (!ca_feature=3 AND NOT (REMOVE><ca_feature OR REMOVE=ALL))

It would run the CA when this feature is scheduled for install, or if it's installed and is not scheduled for remove.

This part AND NOT &ca_feature=2 in the first parenthesis is redundant because &ca_feature cannot be equal to 2 if it's already equals 3.


Use MSI verbose logging to better understand what's going on. Run your installation this way:

msiexec /i package.msi /l*vx log.txt

When a feature state changes or a property is modified, you'll see a message in the log. Then you'll be able to compare the actual values with your expectations. Use other operation switches instead of /i to run it in modify or remove mode.

Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
  • thank you,Alexey.I'll try your condition later when i'll enable the change_mode in my installer.I just wonder: if feature state is Installed,and i don't change it's state in change_mode (if i just add a new one feature) what will be equal to the REINSTALL property.I guess that it will be like REINSTALL="NEWONEFEATURE".If so it is really better to use !FEATURE=3 as you said.Thanks a lot, I understand now :) And hello from Moscow ) – Nerielle Aug 03 '11 at 11:33