Unfortunately these files are not generated by my department but by our Service 
department. The PDF files may change throughout the lifetime of the product. 
This "feature" was given to our Service department in another product (before 
my time, I have to say), and its how they have requested it work in the new 
product.
 
I've been resisting for about 3 months, saying that if they give us the files 
then we will install them, but apparently that cant work with their process.
 
Sucks to be me :)

________________________________

From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Thu 1/11/2007 5:09 PM
To: Colin Burn; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] Conditional installation of a shortcut based on 
afolders existance



Random note:  using "SourceDir" during runtime is very, very tricky.  There are 
many cases where the Property does not get set or by using it you can force the 
Windows Installer to prompt the user to put the original media back in the CD 
(or wherever they installed it from).  For example, what happens when you try 
to repair your product or upgrade it?

 

Why don't you create a Component(s) to install the PDF file(s) that your 
copying from source?

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Colin Burn
Sent: Thursday, January 11, 2007 6:45 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Conditional installation of a shortcut based on a folders 
existance

 

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

Reply via email to