cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Dean_H
Level 7

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.
Labels (1)
0 Kudos
(30) Replies
ICE999
Level 5

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
0 Kudos
Not applicable

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.
0 Kudos
ICE999
Level 5

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.
0 Kudos
Dean_H
Level 7

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?
0 Kudos
Not applicable

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?
0 Kudos
Dean_H
Level 7

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"
0 Kudos
Dean_H
Level 7

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.
0 Kudos
Cromagnon35
Level 4

Simply removing the property and letting your scripts create it (make sure uppercase only!).

Then you can set the condition

INSTALLPROPERTY

or

INSTALLPROPERTY = "TRUE"
0 Kudos
Dean_H
Level 7

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?
0 Kudos
Dean_H
Level 7

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.
0 Kudos