Unable to install feature using a condition to check registry value match - Advanced Installer Community
anitapusch
Posts: 1
Joined: Wed Mar 23, 2022 8:16 am

Unable to install feature using a condition to check registry value match

Hi,

I am using 11.3 aip.

I have an installer where a feature ( to install a prerequisite ) must be enabled only when a registry value is set for a specific customer.

e.g. IF HKLM/Software/ProductName key has "Customer" = "abcd"
then call the prereq installer.

I have a prerequisite defined and feature is checked for that registry value content. somehow it doesn't work and it gets installed for all customers!

Why is the condition not getting evaluated before calling the prereq?
Can this be done differently?

<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="myfeature" ComponentId="{BE4194EC-8C72-48B5-96E0-A9FD4C06AC4A}" Directory_="APPDIR" Attributes="4" Condition="RESULT_CUSTOMER_REGKEY ~&gt;&lt; &quot;ABCD&quot;" KeyPath="myfeature" Options="2"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="myfeature" Title="my feature title" Description="My new feature" Display="7" Level="0" Attributes="0" Components="myfeature"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="5" Level="1" Directory_="APPDIR" Attributes="0"
Components="Proj.exe"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.MsiConditionComponent">
<ROW Feature_="myfeature" Level="1" Condition="RESULT_CUSTOMER_REGKEY ~&gt;&lt; &quot;ABCD&quot;"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.MsiRegsComponent">
<ROW Registry="myfeature" Root="-1" Key="Software\Caphyon\Advanced Installer\Prereqs\[ProductCode]\[ProductVersion]" Name="myfeature" Value="1" Component_="myfeature"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.PreReqComponent">
<ROW PrereqKey="myfeature" DisplayName="My Feature" VersionMin="2.0.0" VersionMax="3.0.0" SetupFileUrl="MyInstall.exe" Location="0" ExactSize="0" Operator="1" Options="xi" TargetName="MyInstall.exe" Type="1" Feature="myfeature"/>
<ATTRIBUTE name="PrereqsOrder" value="myfeature"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.PreReqSearchComponent">
<ROW SearchKey="ValueName" Prereq="myfeature" SearchType="9" SearchString="HKLM\SOFTWARE\Product XYZ\ProjectMini\Customer" RefContent="MABCD" Order="1" Property="PreReqSearch"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.MsiAppSearchComponent">
<ROW Property="RESULT_PRODUCT_REGKEY" Signature_="AppSearchSign"/>
<ROW Property="RESULT_CUSTOMER_REGKEY" Signature_="AppSearchSign_1"/>
</COMPONENT>

<COMPONENT cid="caphyon.advinst.msicomp.MsiRegLocatorComponent">
<ROW Signature_="AppSearchSign" Root="2" Key="SOFTWARE\Product XYZ\ProjectMini" Name="Product" Type="18"/>
<ROW Signature_="AppSearchSign_1" Root="2" Key="SOFTWARE\Product XYZ\ProjectMini" Name="Customer" Type="2"/>
</COMPONENT>
Liviu
Posts: 1420
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Unable to install feature using a condition to check registry value match

Hello,

Unfortunately, I can't say for sure why this is happening.

Can you please send us the .AIP (setup project) file and an installation log by email to support at advancedinstaller dot com so we can further test and investigate this?

You can create an installation log by launching your setup package with a command line like this:

Code: Select all

msiexec /i setup.msi /L*V installLog.txt
when using an MSI package type, or a command like this

Code: Select all

setup.exe /L*V installLog.txt
when using an EXE package type.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”