Hello and welcome to Advanced Installer forums,
a) check that an earlier version has already been installed;
In order to check if an earlier version was installed, you can use the
Product Version (identify by Product Code) search criteria. For details, please take a look on the
Edit Prerequisite Search Dialog article. Also, you should take a look on the
Product Identification (ProductCode and UpgradeCode) article which may be useful to you.
b) ensure it doesn't try to install if it has already been installed.
You can use the same install condition as above to see if the current version of the add-on is already installed or you can use a
registry key criteria search.
It seems that in your detection criteria, at least the first criteria must be true in order to install the prerequisite (the
Product Version (identify by Product Code) search criteria). However, in the
Install Conditions you can only choose between:
- Install only if at least one condition is false
- Install only if at least one condition is false
It seems that you cannot define the install conditions according to your needs. In this case, you can select the
Always install the prerequisite option and condition its
feature installation. Please note that each prerequisite that is added as a
Feature-Based or
Post-Install prerequisite creates its own
feature in the
Organization page.
First of all, you need to create the search operation in the
Search page. To check if an earlier version was installed you can use the
Product Version (identify by Product Code) search from the
Extended Search Properties.
If a search operation will be successfully (e.g. the related product code is registered on the target machine), the property assigned to the search operation will be set, otherwise the property will be empty.
You can use the same install condition as above to see if the current version of the add-on is already installed or you can use a
registry key criteria search.
After creating the two search operation, you can go in the
Organization page and click on the
Add Install-time Conditions option from the
Installation behaviour section of the
feature properties.
Select the
Not Installed behavior and add in the
Installed if field your properties depending the criteria you have used. e.g. if you will use the ProductCode as criteria search, you should have something like that:
Code: Select all
PRODUCTCODE_OLD_VERSION AND (NOT PRODUCTCODE_NEW_VERSION)
where
- PRODUCTCODE_OLD_VERSION is the property assigned to the search operation to check if an earlier version is installed;
- PRODUCTCODE_NEW_VERSION is the property assigned to the search operation to check if the current version of the add-on is already installed;
So, it should look something like this:

- FeatureInstallationBehaviour.png (8.13 KiB) Viewed 3726 times
As you can see, the feature will be installed only if the earlier version will be found and if the current version of the add-on is not already installed, according to your scenario.
Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging