Groups | Blog | Home
all groups > dotnet setup > may 2006 >

dotnet setup : Paging Phil Wilson -- Launch Condition problem in VS 2005.


Rob R. Ainscough
5/11/2006 11:23:26 PM
Or anyone that might know. Phil, I've read you book, it was very helpful,
however this Search Registery and Condition problem I'm having is about to
make me jump off the edge.

I've created a deployment project and decided I wanted to use the Registry
Search feature setup as follows:

Search Target Machine
Search for my Environment
Property: MYENVMODE
RegKey: SOFTWARE\MyApp
Root: vsdrrHKLM
Value: Version

Launch Conditions
MyCondition
Condition: MYENVMODE >= "3.0.0.0"
Message: "Condition True!"

If I create a registry key: HKEY_LOCAL_MACHINE\SOFTWARE\MyApp
then create a string value Version

If do the following:
set Version = "3.0.0.0", Message displays "Condition True!"
set Version = "2.9.1.1", Message displays "Condition True!"
set Version = "3.1.1.1", Message displays "Condition True!"

If change Condition: MYENVMODE = "3.0.0.0"
set Version = "3.0.0.0", Message displays "Condition True!"
set Version = "2.9.1.1", Message displays "Condition True!"
set Version = "3.1.1.1", Message displays "Condition True!"

If change Condition: MYENVMODE < "3.0.0.0"
set Version = "3.0.0.0", Message displays "Condition True!"
set Version = "2.9.1.1", Message displays "Condition True!"
set Version = "3.1.1.1", Message displays "Condition True!"

If change Condition: MYENVMODE <> "3.0.0.0"
set Version = "3.0.0.0", Message displays "Condition True!"
set Version = "2.9.1.1", Message displays "Condition True!"
set Version = "3.1.1.1", Message displays "Condition True!"

As you can see, it doesn't matter what I do, this always evalutes to true
and triggers the condition. Do conditions just NOT work? I've read several
other people have the exact same problem. Just for reference, when testing,
I right click on the deployment project in VS 2005 and select "Install".

What the heck am I doing wrong? I'm stumped -- been working on this all
day!

Thanks, Rob.




Phil Wilson
5/15/2006 12:35:25 PM
What's the actual format of the data in the registry? Is it really REG_SZ?

If you go to the user interface sequence and put [MYENVMODE] at the start of
the WelcomeText string you'll see the actual value, just as a sanity check.

--
Phil Wilson
[Microsoft MVP-Windows Installer]

[quoted text, click to view]

Rob R. Ainscough
5/17/2006 11:58:55 AM
Hi Phil,

The reg entries are being found (via Search for Registry Entry) and loaded
into the property -- the "Conditions" evaluation on the creation of reg
entries during the install are working correctly (registry editor section).
Just the Launch Actions Condition statements don't appear to be working at
all (Launch Conditions section). Has me baffled.

The Welcome displays a blank space, and yes they are REG_SZ.

Rob.


[quoted text, click to view]

Phil Wilson
5/17/2006 4:30:27 PM
If you're putting the property name in square brackets in the correct case
in the Welcome text and it's blank, that means you're not getting the value
into the property. If I do a registry search for [Property MDACVER RegKey
SOFTWARE\Microsoft\DataAccess Root vsdrrHKLM and Value Version] I definitely
see 2.82.1830.0 in the Welcome screen. Maybe you're not getting the value,
the property value is empty, and that might be making every comparison
evaluate to true.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Rob R. Ainscough
5/18/2006 12:36:11 PM
That is what I would have thought also -- but that wouldn't explain why the
same property reference in a condition statement for creating a registry
entry would work correclty.

Are Launch Conditions evaluated before registry searches ?? This is the
only conclusion I can come to.


[quoted text, click to view]

Phil Wilson
5/20/2006 11:00:58 AM
The registry searches (and the other searches) take place before the launch
conditions. That blank in the Welcome text bothers me - it should show a
value. If you do the install with a log it will show property values too. I
just think it's not being set.

msiexec /i <path to msi> /l*v <path to some text log file>
--
Phil Wilson
[Microsoft MVP-Windows Installer]

[quoted text, click to view]

AddThis Social Bookmark Button