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
- :
- Did you try
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
‎Mar 28, 2008
10:29 AM
Can the Condition Property for a Component check and see if the registry present
I have an MSI Installscriprt project that contains a component that I only want installed if an entry in the Registry is not present. I would like to know if and how I can use the Condition Property for that Component to check and see if the registry entry is present, and only install if registry can't be found.
(30) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
03:14 AM
I found a possible explanation for the feature condition problem in the Knowledge Base:
If conditions are placed on features during a custom install, only those feature with conditions that evaluate to True are selected to be installed. However, during a complete install, all features are installed regardless of conditions. A complete install installs all of the features because the AddLocal event that is triggered and set to ALL off of the Next button for the SetupType dialog. The AddLocal property overrides the feature conditions, and all features are installed.
Knowledge base article nr Q106043
If conditions are placed on features during a custom install, only those feature with conditions that evaluate to True are selected to be installed. However, during a complete install, all features are installed regardless of conditions. A complete install installs all of the features because the AddLocal event that is triggered and set to ALL off of the Next button for the SetupType dialog. The AddLocal property overrides the feature conditions, and all features are installed.
Knowledge base article nr Q106043
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
03:58 AM
Are these feature conditions or component conditions? Based on the behavior described by Dean H, it sounds like they are component conditions.
At any rate, it is true that the system search is working properly, so the only remaining situation is that you're either using a feature condition and not a component condition and thus the situation is different or something else is going wrong.
Based on the log, if the component condition is:
NOTEPAD
the component should install.
If the condition is:
Not NOTEPAD
the component should not install.
At any rate, it is true that the system search is working properly, so the only remaining situation is that you're either using a feature condition and not a component condition and thus the situation is different or something else is going wrong.
Based on the log, if the component condition is:
NOTEPAD
the component should install.
If the condition is:
Not NOTEPAD
the component should not install.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
05:32 AM
Dean H wrote:
Well, upon further testing, it looks like if I use the condition Not NOTEPAD, my component NEVER installs (w/ and w/o notepad present in Windows Folder) and if I use the condition NOTEPAD (w/ and w/o notepad present in Windows Folder), my component ALWAYS installs.
Did you do a file search on the entire disk? If so it will always find a notepad and then the behaviour you described is correct.
There is also a notepad in the system32 directory as well, so it means that you're system search always finds something, then the condition Not NOTEPAD will never install teh component and the condition NOTEPAD will always install you component.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
08:09 AM
I did my search based on Notepad being in the WindowsFolder, and yes it is a Component condition not a Feature condition. I want to install the component only if Notepad is found in the Windows directory, so if that is the case, exactly what condition do I need to enter?
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
08:30 AM
The condition you should have is described above.
Based on the log uploaded, the file NOTEPAD was located in C:\Windows (which is expected). Have you tried the other situation?
Based on the log uploaded, the file NOTEPAD was located in C:\Windows (which is expected). Have you tried the other situation?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
08:51 AM
I tried the condition "NOTEPAD"="C:\Windows", but the component never installs, both with and w/o Notepad being present in the Windows directory. I will now try the condition "NOTEPAD"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
02:58 PM
Well I wasting even more time and still I am unable to get this component to install with a condition. Switched from looking for a file to looking for a path. If I enter just the Property (file path exists) I created as the condition, the Component always installs (w/ and w/o file or folder specified present) and if I use the operator Not with the Property, then the componentnecer installs. If I look in the Msi log, the property always has a value of 1, both w/ and w/o the property being present on the computer. Does anyone from Macrovison have any idea why this just does NOT work? Is this supported in an InstallScript MSI Project? I'm running out of time and I need to get this to work for our release.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
03:21 PM
Simply removing the property and letting your scripts create it (make sure uppercase only!).
Then you can set the condition
INSTALLPROPERTY
or
INSTALLPROPERTY = "TRUE"
Then you can set the condition
INSTALLPROPERTY
or
INSTALLPROPERTY = "TRUE"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2008
04:08 PM
Well, I created a simple test MSI Install Projest and tested installing a component based on a condition that looks if an exe is present on the computer, and it works so the question is why is does not work in my current project?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2008
08:46 AM
I was finally able to get this to work by generating a new GUID for the component. After I gave the component a new GUID, the component intalled successfully based on the condition. Not exactly sure why this fixed the problem.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)