How to make a CA a condition of installing or not a component ?
Hi everybody !
I'm new in packaging, so I have a basic question :
How can I condition the installation of a component using CAs ?
I read that CAs used conditions of an install action (for example $ComponentName = 3 could be a condition of a CA) but can't be conditions for an install action (?)
I would like, for example, search for a file installed on the computer, and if I find it, I would like to install a specific component. (or uninstall something, etc...)
Can I do that with CAs ? Or using another methods ?
Thank you !
EDIT : I think it could be done setting the state INSTALLSTATE_LOCAL/_ABSENT/.... of the component/feature I want... no ?
I'm new in packaging, so I have a basic question :
How can I condition the installation of a component using CAs ?
I read that CAs used conditions of an install action (for example $ComponentName = 3 could be a condition of a CA) but can't be conditions for an install action (?)
I would like, for example, search for a file installed on the computer, and if I find it, I would like to install a specific component. (or uninstall something, etc...)
Can I do that with CAs ? Or using another methods ?
Thank you !
EDIT : I think it could be done setting the state INSTALLSTATE_LOCAL/_ABSENT/.... of the component/feature I want... no ?
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
TomB
19 years ago
Babric,
You should try to use an AppSearch. This will look for the file on the PC and set the location to a property.
Then in the CA you can just put the property name as the condition. Since the Conditions will use a boolean evaluation, if the Property is present then the CA install condition is TRUE, else it will be FALSE.
Here is a good link for a good example:
Search for IE Installed
You should try to use an AppSearch. This will look for the file on the PC and set the location to a property.
Then in the CA you can just put the property name as the condition. Since the Conditions will use a boolean evaluation, if the Property is present then the CA install condition is TRUE, else it will be FALSE.
Here is a good link for a good example:
Search for IE Installed
Posted by:
babric
19 years ago
Thanks for your link, I read it, but I knew how to do that.
I your example, an error popup is shown, but I don't want to STOP the install, but I want the result of the AppSearch to be a condition of installing or not some components.
Using IE5 example, I wouldn't show an error popup (stopping the installation) but I would enable the installation of IE5 included in my package.
If IE5 is already installed on the target, I would disable its installation.
(I hope this is not explained in your link, because I don't speak and read english very well)
I your example, an error popup is shown, but I don't want to STOP the install, but I want the result of the AppSearch to be a condition of installing or not some components.
Using IE5 example, I wouldn't show an error popup (stopping the installation) but I would enable the installation of IE5 included in my package.
If IE5 is already installed on the target, I would disable its installation.
(I hope this is not explained in your link, because I don't speak and read english very well)
Posted by:
TomB
19 years ago
The IE sample is just an example, you can use that process up to the Custom Action. You do not need CA 19 do display an error message, you can just insert your Custom Action at this point or if you do not need a cutom action skip it.
When adding a condition to the Custom Action in the Sequence table or on a component, instead of using the Condition:
Not IE55FOUND And Not Installed
You would use:
IE55FOUND
This would make the Custom Action or Component require that the property, in this case the IE55FOUND, contain something.
Hope that helps.
When adding a condition to the Custom Action in the Sequence table or on a component, instead of using the Condition:
Not IE55FOUND And Not Installed
You would use:
IE55FOUND
This would make the Custom Action or Component require that the property, in this case the IE55FOUND, contain something.
Hope that helps.
Posted by:
babric
19 years ago
you can just insert your Custom Action at this point
What I would like to know is how to build THIS Custom Action :-)
I need a CA which allow or not the installation of a component of my package, without stopping the installation process.
I know what can I use as condition to launch this CA, but What I want to know is the CA that I could use to allow (or not) the installation of my component.
For example, if the user has the file BLABLA.txt on his computer, I install BLIBLI.txt. If not, I install BLUBLU.txt ...
hope I explained it clearly :-)
Posted by:
TomB
19 years ago
Babric,
You do not need a custom action. If you look in the Component Table of an MSI there is a Condition Column. In that column is where you would put the PROPERTY.
For example:
Use the Article above and create an AppSerch for your BLABLA.txt file. Asgin it to a Property such as FILEFOUND.
Do not create any Custom Action.
Then add 2 Components to your MSI.
Component1
Add the file BLIBLI.txt, and in the Condition Column of the Component table put "FILEFOUND".
Component2
Add the file BLUBLU.txt and in the Condition Column of the Component table put "NOT FILEFOUND".
This way if the file is found BLIBLI.txt will be installed, and if not BLUBLU.txt will be installed. This is the same method we use if we need to install a file only on Win2k or Winxp.
You do not need a custom action. If you look in the Component Table of an MSI there is a Condition Column. In that column is where you would put the PROPERTY.
For example:
Use the Article above and create an AppSerch for your BLABLA.txt file. Asgin it to a Property such as FILEFOUND.
Do not create any Custom Action.
Then add 2 Components to your MSI.
Component1
Add the file BLIBLI.txt, and in the Condition Column of the Component table put "FILEFOUND".
Component2
Add the file BLUBLU.txt and in the Condition Column of the Component table put "NOT FILEFOUND".
This way if the file is found BLIBLI.txt will be installed, and if not BLUBLU.txt will be installed. This is the same method we use if we need to install a file only on Win2k or Winxp.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.