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

You would probably want to perform a system search for the registry key for which you're searching and then use a condition on your component appropriately for the property set by the system search.
0 Kudos
Dean_H
Level 7

I created the search and decided to search for File Path and exe and I gave it the name IS_TAIE_INSTALLED. For the condition builder, if I enter the IS_TAIE_INSDTALLED>0, the component should not get installed-right?
0 Kudos
ICE999
Level 5

Check this thread out, i want to do the same as you, but it's a real struggle and doesn't seem to work.

Link
0 Kudos
RobertDickau
Flexera Alumni

You should be able to use just the property name IS_SOMETHING_INSTALLED as the component condition; no need to compare it to zero or anything. Creating an MSI log file will tell you what the value is, which in turn tells you if the system search succeeded.
0 Kudos
Dean_H
Level 7

But what if I only want the component installed if the file I'm looking for is not found. Would I then need to have some type of argument and if so, what would you suggest using?
0 Kudos
Dean_H
Level 7

Now that I have created this property to check for the exe, it always detects the file as being present even when it is not, thenwhen it posts a dialog box indicating the exe is installed, when I click the OK button, the installation aborts. Why is the file always detected as being present when it isn't, can the dialog box with the file being present be supressed and why does the installation abort when you click ok to the dialog box?
0 Kudos
Dean_H
Level 7

I have found our what was causing the System Search\Condition to abort my installation. Apparently the System Search property I created ended up as a Launch Condition so I deleted it from the Direct Editor, however now if I enter the Property Name into the Condition for my Component, the component always installs
0 Kudos
Not applicable

My personal suggestion is to take a look at a log file and see what's actually being set by the MSI engine.

For more information on conditional statements, see this MSDN article:
http://msdn2.microsoft.com/en-us/library/aa368012(VS.85).aspx

Overall, you're going down the right track, but I think you're making some assumptions that are overcomplicating the issue. Simply, if the entry you choose stores its value in the property MYTESTPROPERTY then the condition is MYTESTPROPERTY if you want to conditionalize on its existence. For the case of non-existence, you would enter Not MYTESTPROPERTY.

Additionally, you may want to take another look at what you're searching. As indicated by the dialogs, do not include the registry root e.g. HKEY_LOCAL_MACHINE in the path you are searching for. So if you want to find HKEY_LOCAL_MACHINE\SOFTWARE\InstallShield\14.0\Professional, your entry should simply be SOFTWARE\InstallShield\14.0\Professional. There is a combo box to select the registry root.
0 Kudos
Cromagnon35
Level 4

Dean H wrote:
I have found our what was causing the System Search\Condition to abort my installation. Apparently the System Search property I created ended up as a Launch Condition so I deleted it from the Direct Editor, however now if I enter the Property Name into the Condition for my Component, the component always installs


You might want to check the properties list to see if IS created the value there. If your condition goes like "IS_SOMETHING_INSTALLED" then if it's in the property table at all, it can allow this to get evaluated as true. If present - delete it.
0 Kudos
ICE999
Level 5

I tried to do the same thing and it just doesn't work. Instead i tried to build a condition on my components and that worked fine.
So instead of building a condition on my features, i'm using conditions on my components.

I used a system search that searched for the registry value 'test' with '1' as value data. The result was stored in the property INSTALLTEST.
In my component condition, i could use INSTALLTEST = '1' (value data had to be '1' ) or INSTALLTEST (registry value had to be found) to install that component.

This worked great but i wonder why it won't work on a feature.
0 Kudos
Cromagnon35
Level 4

I'm not sure either, I'm running into a very similar problem with making FLEXnet Connect Agent install controllable via Property condition on a feature. No dice there either.

I'm starting to miss WISE...
0 Kudos
Not applicable

Feature conditions work substantially different than Component Conditions. This thread was specific to Component conditions.

You might want to check the properties list to see if IS created the value there. If your condition goes like "IS_SOMETHING_INSTALLED" then if it's in the property table at all, it can allow this to get evaluated as true. If present - delete it.


The system search should really take care of that possibility, but if it does not then removing the property as suggested would be a good idea.

I'm not too sure if it does or does not honestly.
0 Kudos
Dean_H
Level 7

I just can't get this to work for my component. I tried to "dumb" it down to see if it would work for a simple test as looking for notepad.exe. I created a System Search based on Notepad being present so my property is NOTEPAD. I enter this into the component condition with Not NOTEPAD, so it should only install if Notepad is not present. Well, now it never installs the component? Why? I also can't get logging to work so I have been unable to determine what value the Property NOTEPAD has? I'm not sure what I'm doing wrong, n but this is extremely frustarting for what appears to be a simple task! Can anyone please shed some light on this for me
0 Kudos
Not applicable

What about logging isn't working for you?

[edit]

Just for clarification, you can create a log file by following the below directions:
http://support.installshield.com/kb/view.asp?articleid=Q104807

I would create one and then post it up real quick 🙂
[/edit]
0 Kudos
Dean_H
Level 7

I thought if you enable logging from the Product Properties, and since I'm installing on a Vista machine, that it would automatically create the log file after installation? Is this not true?
0 Kudos
Not applicable

It should yes, but if you've having issues it might be more speedy to just manually generate the log file anyway.
0 Kudos
Dean_H
Level 7

Attached is my log
0 Kudos
ICE999
Level 5

I got a suggestion on this forum to use the commandline, which i do now and it generates the log decently:

setup.exe /V"/L*v C:\everything.log"

Pay attention to the ", i got that wrong when i tried the first time. Now i use it in a .bat file witth the path to my setup.exe.
0 Kudos
Dean_H
Level 7

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. I can't believe this is so hard that I'm wasting all these hours just trying to perform this simple operation. I hope someone can shed some light on this for me. I have attached my log w/ the condition NOTEPAD
0 Kudos
ICE999
Level 5

This line shows that it has found the notepad.exe file:
[16:42:56:596]: PROPERTY CHANGE: Adding NOTEPAD property. Its value is 'C:\Windows\'
Which means that you can use in the component condition if you want to install the component if notepad is present:
"NOTEPAD" or "NOTEPAD = "c:\windows\"" (don't use the outer " if you copy/paste this)
0 Kudos