Your feature and condition both have level 1 which won't work  - the
condition causes nothing to change.
The default value of INSTALLLEVEL is 1. This means any feature set to level 1
will be installed. To prevent installation, the feature level must be higher.
Keep the feature level as 1.
Set the condition level to something larger, say 10, and set the condition to
be 
not ISSQLSERVERSERVICEINSTALLED 

e.g.
<Condition Level='10'>not ISSQLSERVERSERVICEINSTALLED</Condition>

When sql is not found, the property will be blank and the condition will
evaluate to true, setting the feature's level to 10 which prevents
installation.
When sql *is* found, the property will be set to the registry value, the
condition will not be true and the feature's level will stay at 1 which will
allow installation.

-----Original Message-----
From: Martin Johnson [mailto:mjohn...@mpjconsultancy.com] 
Sent: 18 January 2013 12:06
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Installing files for MS SQL folder only if
SQLispresent

Thanks for that, it now writes to the correct place if SQL is installed.  
It now seems that the condition is not being applied correctly if SQL is not
installed and it is installing in c:\ISSQLSERVERSERVICEINSTALLED

<Feature Id="SSISMSSQL" Title="SSIS Components" Display='expand' Level='1' 
ConfigurableDirectory='ISSQLSERVERSERVICEINSTALLED'>
<ComponentRef Id='SSISComponents' />
<Condition Level='1'>ISSQLSERVERSERVICEINSTALLED</Condition>
</Feature>


Apologies for the numpty questions, but this is the first time I've had to
make my install very clever.

Martin

----------------------------------------

Subject: RE: [WiX-users] Installing files for MS SQL folder only if SQL
ispresent

Use ISSQLSERVERSERVICEINSTALLED as the directory ID rather than the name. 
Set
the Name as the default directory name
It's the same way as you'd use INSTALLDIR (if you're familiar with the
convention) but setting the value from a registry search instead of on the
command line.
If it doesn't work, check the registry value contains a full path. If it
doesn't, try adding directory entries surrounding the
ISSQLSERVERSERVICEINSTALLED element to provide the reset of the path.

-----Original Message-----
From: Martin Johnson [mailto:mjohn...@mpjconsultancy.com]
Subject: [WiX-users] Installing files for MS SQL folder only if SQL ispresent

I am attempting to set a property to a registry entry, I have looked at the
install log and it is set.

I am then attempting to write files to a subfolder of that property, what I
actually achieve is to write it to a subfolder of a folder name
ISSQLSERVERSERVICEINSTALLED, i.e. the property id rather than its value.

I am only expecting this to be done if the registry entry exists i.e. SQL is
installed, it is writing the files whether or not SQL is installed.

Hopefully the following snippets give enough information, any hints tips or
suggestions welcomed.

<Property Id="ISSQLSERVERSERVICEINSTALLED"> <RegistrySearch
Id="SQLInstalledInstances" Root="HKLM" 
Key="SOFTWARE\Microsoft\Microsoft SQL Server\100" Name="VerSpecificRootDir" 

Type="raw" />
</Property>

<Directory Id="MSSQL_SSIS" Name="ISSQLSERVERSERVICEINSTALLED">
<Directory Id="DTS" Name="DTS">
<Directory Id="PIPELINECOMPONENTS" Name="PipelineComponents"> <Component
Id="SSISComponents" 
Guid="ef1c1033-f78a-4505-a042-d10cd8395053">
<File Id="ID1" Name="1.dll" DiskId="1" KeyPath="yes" 
Source="..\..\API\DotNet\Assemblies\v3.5\1.dll" /> <File Id="ID2"
Name="2.dll" DiskId="1" KeyPath="no" 
Source="..\..\API\DotNet\Assemblies\v3.5\2.dll" /> </Component> </Directory>
</Directory> </Directory>

<Feature Id="SSISMSSQL" Title="SSIS Components" Display='expand' 
Level='1' ConfigurableDirectory='MSSQL_SSIS'>
<ComponentRef Id='SSISComponents' />
<Condition Level='1'>ISSQLSERVERSERVICEINSTALLED</Condition>
</Feature>

Thanks
Martin

-----------------------------------------------------------------------------
-
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more.
Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
SDL PLC confidential, all rights reserved.
If you are not the intended recipient of this mail SDL requests and requires 
that you delete it without acting upon or copying any of its contents, and we 
further request that you advise us.
SDL PLC is a public limited company registered in England and Wales.  
Registered number: 02675207.
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, 
UK.


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to