This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Feature Help
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 25, 2009
09:57 AM
Disable feature install based on another feature (no UI Dialogs)
I have a basic MSI that is fully automated where there are no user dialogs presented. The MSI must decide on features to install based on current registry values.
I have about 15 features in which all are disabled by default (install level 0) with the exception of one feature (lets call it Feature_X) which is set to install level 1. There is one feature (lets call it Feature_Y), that if enabled, Feature_X cannot be installed.
I am using condition statements on al features, except Feature_X to set the install level to 1 if the registry condition is met. However, if Feature_Y condition is met, I need to have Feature_X disabled.
Sound confusing? You bet.
So the bototm line is, how can I dsiable one feature if another one is selected? I have tried using the &Feature_Y<>-1 approach in Feature_X condition, but it does not seem to work.
I have about 15 features in which all are disabled by default (install level 0) with the exception of one feature (lets call it Feature_X) which is set to install level 1. There is one feature (lets call it Feature_Y), that if enabled, Feature_X cannot be installed.
I am using condition statements on al features, except Feature_X to set the install level to 1 if the registry condition is met. However, if Feature_Y condition is met, I need to have Feature_X disabled.
Sound confusing? You bet.
So the bototm line is, how can I dsiable one feature if another one is selected? I have tried using the &Feature_Y<>-1 approach in Feature_X condition, but it does not seem to work.
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 25, 2009
02:20 PM
Why not add a conditional statement to Feature_X and set the install level to 0 if the registry value exists (the value for Feature_Y)?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 25, 2009
02:26 PM
After I posted, I thought of that very same thing.
I guess it would still be nice to have some way of doing it off of another feature install level as well.
In my case it worked out ok to use the same condition from Feature_Y to set Feature_X to 0.
I guess it could get out of control if several feature conditioons needed to be met in order for another feature install level to be set to 0.
I guess it would still be nice to have some way of doing it off of another feature install level as well.
In my case it worked out ok to use the same condition from Feature_Y to set Feature_X to 0.
I guess it could get out of control if several feature conditioons needed to be met in order for another feature install level to be set to 0.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
01:05 PM
Hi,
I am trying to modify a web.config for to change a connection string for a database, but that file will only exist if they choose a certain.
So far I've realized that I have to have custom code to modify the config since it's an attribute that I'm changing and not an element (which I could do easily through the XML settings interface). So I created a script to do so.
Now I can only modify that file if it exists, and it will only exist if they have chosen that feature. So I created a custom action for that script, and I need to know how to set the condition properly so it will only run After the files have installed and if that feature has been chosen.:confused:
Thanks!
Chris
I am trying to modify a web.config for to change a connection string for a database, but that file will only exist if they choose a certain.
So far I've realized that I have to have custom code to modify the config since it's an attribute that I'm changing and not an element (which I could do easily through the XML settings interface). So I created a script to do so.
Now I can only modify that file if it exists, and it will only exist if they have chosen that feature. So I created a custom action for that script, and I need to know how to set the condition properly so it will only run After the files have installed and if that feature has been chosen.:confused:
Thanks!
Chris
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
02:00 PM
I think this is a bit off topic from the original post.
Not sure if this is what you are looking for, but in your custom action vb script you can check to see if the feature is enabled. If it is enabled, then you can run your Web.Config XML modify code.
Option Explicit On
Const msiInstallStateUnknown = -1
Function CheckInstallCondition()
Dim ret
Dim view
Dim record
Dim name
Dim state
view = Session.Database.OpenView("SELECT Feature FROM Feature")
view.Execute()
record = view.Fetch
If not record Is Nothing Then
name = "Name of your feature goes here"
state = Session.FeatureRequestState(name)
If state <> msiInstallStateUnknown Then
rem Feature is Enabled. Run web.config modify code here.
End If
CheckInstallCondition = ret
End Function
Not sure if this is what you are looking for, but in your custom action vb script you can check to see if the feature is enabled. If it is enabled, then you can run your Web.Config XML modify code.
Option Explicit On
Const msiInstallStateUnknown = -1
Function CheckInstallCondition()
Dim ret
Dim view
Dim record
Dim name
Dim state
view = Session.Database.OpenView("SELECT Feature FROM Feature")
view.Execute()
record = view.Fetch
If not record Is Nothing Then
name = "Name of your feature goes here"
state = Session.FeatureRequestState(name)
If state <> msiInstallStateUnknown Then
rem Feature is Enabled. Run web.config modify code here.
End If
CheckInstallCondition = ret
End Function
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
02:44 PM
You could use the Install Exec Sequence to control when the custom action executes. Then, the custom action could check for the existence of the file before running the script.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
03:47 PM
I'm sorry, you are correct about it being off topic, but it came close so I added my question here.:)
Your response helps immensely. The only other thing I need is how to check what the value of the database properties of the installer are from vbscript (i.e. IS_SQLSERVER_SERVER)
Thanks again for your help!
Your response helps immensely. The only other thing I need is how to check what the value of the database properties of the installer are from vbscript (i.e. IS_SQLSERVER_SERVER)
Thanks again for your help!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 17, 2009
08:32 AM
I figured it out. Thanks again for the help.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)