I think you can have something like this:
<Property Id="PdfFolderExists">
<DirectorySearch Id="PdfFolder" Path="[whatever path]" />
</Property>
Then, in your <Component /> you would have a:
<Condition Level="0">PdfFolderExists</Condition>
So it doesn't install if the folder was found.
On 1/11/07, Colin Burn <[EMAIL PROTECTED]> wrote:
Conditional installation of a shortcut based on a folders existence
Hi all,
I'm tying to create an installer that copies some files from the
installation media (if they exist) to a location on the target machine. I'm
then trying to add a start menu entry that points to this location so far I
have this fragment that does most of the work…
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
<Fragment Id='PdfFragment'>
<CustomAction Id='SetPdfFolder' Property='SourcePdfDir' Value='
[SourceDir]pdf\'/>
<DirectoryRef Id='PdfFolder'>
<Component Id='PdfComponent' Guid='
1DC5A176-1062-4b7d-A2B3-DCD15EE050A9'>
<CopyFile Id='PdfFiles' DestinationDirectory='PdfFolder'
SourceProperty='SourcePdfDir' SourceName='*.pdf'/>
<Shortcut Id="StartMenuPdfFolder" Directory="ProgramMenuDir" Name=
"PDF" LongName="Training Material" WorkingDirectory='PdfFolder'/>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
The custom action is executed from the InstallExecuteSequence.
This all works fine when the pdf folder exists on the install CD but when
it doesn't I still get the start menu shortcut but it doesn't point to
anything. So I think that I need to make the component conditional. Which I
think means that I need to write another custom action that detects is a
folder exists on the CD and sets a property, but I don't know how to do
this. Can somebody help me?
Cheers
Colin
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users