I think what you need to add is "-var var.SourceFiles"; from the help file:

-var <VariableName>
Substitute File/@Source="SourceDir" with a preprocessor or a wix variable (e.g. 
-var var.MySource will become File/@Source="$(var.MySource)\myfile.txt" and 
-var wix.MySource will become File/@Source="!(wix.MySource)\myfile.txt".

This will result in the File elements having the source folder set to a 
pre-processor variable, e.g.:
    <File Id="fil8E5129A8454C2AA40A71DF50F7CD8484" KeyPath="yes" 
Source="$(var.SourceFiles)\File1.exe" />

You can then set this a compile time.

Neil

-----Original Message-----
From: Andrew Maxwell [mailto:andrew.maxw...@papercut.com] 
Sent: 18 May 2012 06:01
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] building an msi in the same dir as source files?

Hi again all,

My last post was a bit of a brain-dump, so I can boil my question down to a few 
points here: :)

- using heat, is there a way to harvest a directory and suppress directory 
id/name insertion in the resulting .wxs? (when automating heat output , this is 
an annoyance) eg . heat.exe dir MyDirectory -gg -cg MyComponents -o output.wxs 
would generate something like:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
    <Fragment>
        <DirectoryRef Id="TARGETDIR">
            *<Directory Id="dir682EE88536E915B58CEC9559EC161A89"
Name="MyDirectory">*
                <Component Id="cmp789AABFBE814C745D68B0EC1FE51DF26"
                 ..... etc

- I'm trying to build an installer where the .msi *sits in the same directory 
as the uncompressed source files*.  However, if my dir structure looks like:
<Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" >
                <Directory Id="APPLICATIONROOTDIRECTORY"
Name="MyApplication"/>
            </Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
   ...components...
</DirectoryRef>

This will happily install MyAppliation to Program Files/MyApplication however 
will require my msi to reside one level down, and expect the source files to be 
in a dir called MyApplication.

Can anyone set me in the right direction?
My process is something like this atm:


heat dir <AppSource>  -gg -sfrag -sreg -svb6 -scom -cg MainAppComps -o 
installer.wxs [modify heat .wxs] candle -out installer.wxsobj installer.wxs 
light  -b <AppSource> -sl -spdb <AppSource>/installer.wxsobj -out 
<AppSource>/installer.msi

Will create a .msi in the AppSource directory (good!), but when installed 
expects the files to reside in AppSource/MyApplication/  !

Sorry again for the double post.  Any thoughts anyone?

ps. if anyone's interested the reason for this seemingly bizarre project layout 
is the .msi exists purely to simplify deployment via a group policy.

cheers,
Andrew
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to