I have a SQL script scheduled to run at install and during maintenance.
In addition, the script has a condition of &MyFeatureName = 3 ("MyFeatureName" is replaced with the appropriate name). This is used because the script is related to a specific feature.
On repair mode if a component key file is missing, then the related component will be reinstalled. Also, a feature will be reinstalled during repair only if at least one of its components will be reinstalled.
Please keep in mind that (&MyFeatureName = 3)
condition is true only if the related feature will be installed locally. So, on repair mode if the corresponding feature will not be reinstalled the related condition will be false.
If you want to test if the related feature is already installed on the machine, then you should use the following condition:(!MyFeatureName = 3)
If you want your SQL script to run only if a specific feature (i.e. MyFeatureName) will be installed or is already installed, then you should use the following condition: ((&MyFeatureName = 3) OR (!MyFeatureName = 3))
Also, if you want your SQL script to run only on repair, and only if a specific feature (i.e. MyFeatureName) will be installed or is already installed, then you should use the following condition:(((&MyFeatureName = 3) OR (!MyFeatureName = 3)) AND REINSTALL )
Please take a look on our "Edit Condition"
When using a predefined connection, do I need to store all the relevant values in the registry (and use a search during install, uninstall and repair) to keep all the relevant values that are used in the predefined connection or does the predefined connection takes care of this for me?
If you want the properties to keep their values during maintenance or uninstall, then you should write the properties values into the registries and then read the properties values from registries. Please take a look on our "Make the properties keep their values during Maintenance"
All the best,