1. If you don't specify a KeyPath the first resource in the Component that
can be a KeyPath will be. Since your File is first in the Component it will
be the KeyPath.
2. This is a really expensive way to author your setup since the Windows
Installer has overhead for each Component in the install. However, this is
also the safest way to make your package considering the Component Rules.
3. You definitely do not want to change the GUID of the Component on each
update. The Component GUID only changes when the Component is no longer
100% backwards compatible or has resources added to it. However, when you
change the GUID you must ensure that your new Component has no overlap (i.e.
does not install any of the resources) with other Components. This is the
core of the Component Rules.
_____
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Jamie Cansdale
Sent: Wednesday, May 05, 2004 7:15 AM
To: 'Riko Eksteen'; ***@users.sourceforge.net; 'Anand Murugesan';
wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] Including all files under a directory
I've been working on a command line tool that updates the File, Directory
and Component elements in a WXS file based on the projects in a Visual
Studio solution. At the moment it copies all files with a 'Build Action' of
'Content' and all project outputs for a specified solution configuration.
Each file gets its own File and Component element allowing with any
Directory elements as needed. The Component.Guid, Id and File.Id are based
on a hash of the relative path (I know the Component.Guid should be combined
with something else!). It is very much a work in progress. Let me know
what I'm missing or doing wrong! Here is an example of what it outputs at
the moment.
(Here's a build of NUnitAddIn created using it)
http://weblogs.asp.net/nunitaddin/archive/2004/05/01/124453.aspx
Because it updates the WXS file rather than recreating I can add things like
custom actions. Because the File.Id and ComponentId are a hash of the
project items relative path they will remain consistent between updates. It
is everything under ModuleDir that has been generated.
Should File.KeyPath be set to 'yes'?
Should Component.Id be randomized on each update?
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Module Id="NUnitAddin.sln" Guid="5FA9934D3F3341BBB28C6026583BC45C"
Language="1033" Version="1.0.0.0">
<Package Id="3807327122724060A7423BF1DE5C7FA5" Description="From
solution 'NUnitAddin.sln'" Comments="Auto generated with Sln2Wix"
Manufacturer="Mutant Design" InstallerVersion="200" Compressed="yes" />
<InstallExecuteSequence>
<!-- Feature or component on the local computer or Feature or
component run from the source -->
<Custom Action="Install"
After="InstallFinalize">$C_a14fc90fa19a9a5acdbea8f24e4cb8ef>2</Custom>
<!-- Feature or component is not present. -->
<Custom Action="Uninstall"
Before="MsiUnpublishAssemblies">$C_a14fc90fa19a9a5acdbea8f24e4cb8ef=2</Custo
m>
</InstallExecuteSequence>
<CustomAction Id="Install" FileKey="F_a14fc90fa19a9a5acdbea8f24e4cb8ef"
ExeCommand="/install" Execute="immediate" />
<CustomAction Id="Uninstall"
FileKey="F_a14fc90fa19a9a5acdbea8f24e4cb8ef" ExeCommand="/uninstall"
Execute="immediate" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ModuleDir" Name=".">
<Directory Id="D_605c646ba3f747c9b24bb1a277193aa2" Name="icons"
LongName="icons">
<Component Id="C_61fbcd6caea5c8e88f720a55d9df8e02"
Guid="61fbcd6c-aea5-c8e8-8f72-0a55d9df8e02">
<File Id="F_61fbcd6caea5c8e88f720a55d9df8e02" Name="Debug.ico"
LongName="Debug.ico" src="NUnitAddin\icons\Debug.ico" />
</Component>
<Component Id="C_a8db7eb234f62c179194d360ada47525"
Guid="a8db7eb2-34f6-2c17-9194-d360ada47525">
<File Id="F_a8db7eb234f62c179194d360ada47525" Name="NUnit.ico"
LongName="NUnit.ico" src="NUnitAddin\icons\NUnit.ico" />
</Component>
<Component Id="C_be78b109c9f515e5a360bcd79a4822ea"
Guid="be78b109-c9f5-15e5-a360-bcd79a4822ea">
<File Id="F_be78b109c9f515e5a360bcd79a4822ea" Name="Runtime.ico"
LongName="Runtime.ico" src="NUnitAddin\icons\Runtime.ico" />
</Component>
<Component Id="C_0fa6f464d88f67139a06edd87e5c5c0e"
Guid="0fa6f464-d88f-6713-9a06-edd87e5c5c0e">
<File Id="F_0fa6f464d88f67139a06edd87e5c5c0e"
Name="VISUAL~1.ICO" LongName="VisualStudio.ico"
src="NUnitAddin\icons\VisualStudio.ico" />
</Component>
</Directory>
<Directory Id="D_577b9fd8db914fc3b27da51091ab143b" Name="runtimes"
LongName="runtimes">
<Component Id="C_d02d696b9530b17f7c0fb25fbc756d19"
Guid="d02d696b-9530-b17f-7c0f-b25fbc756d19">
<File Id="F_d02d696b9530b17f7c0fb25fbc756d19"
Name="CDP_AP~1.CON" LongName="CDP_Apartment.config"
src="NUnitAddin\runtimes\CDP_Apartment.config" />
</Component>
<Component Id="C_992d17046bcf574f67a260aba454b637"
Guid="992d1704-6bcf-574f-67a2-60aba454b637">
<File Id="F_992d17046bcf574f67a260aba454b637"
Name="CDP_MA~1.CON" LongName="CDP_Marshaling.config"
src="NUnitAddin\runtimes\CDP_Marshaling.config" />
</Component>
<Component Id="C_3626c8bac9756919f631b830d6213c85"
Guid="3626c8ba-c975-6919-f631-b830d6213c85">
<File Id="F_3626c8bac9756919f631b830d6213c85" Name="MONO~1.CON"
LongName="mono.config" src="NUnitAddin\runtimes\mono.config" />
</Component>
<Component Id="C_4b2fb538595fafa3207fb503cbcc730c"
Guid="4b2fb538-595f-afa3-207f-b503cbcc730c">
<File Id="F_4b2fb538595fafa3207fb503cbcc730c" Name="NET10~1.CON"
LongName="net10.config" src="NUnitAddin\runtimes\net10.config" />
</Component>
<Component Id="C_14eb7860f8128506c36a706e0e14a193"
Guid="14eb7860-f812-8506-c36a-706e0e14a193">
<File Id="F_14eb7860f8128506c36a706e0e14a193" Name="NET11~1.CON"
LongName="net11.config" src="NUnitAddin\runtimes\net11.config" />
</Component>
<Component Id="C_076902cce67640035c94c11cde5c617c"
Guid="076902cc-e676-4003-5c94-c11cde5c617c">
<File Id="F_076902cce67640035c94c11cde5c617c" Name="NET12~1.CON"
LongName="net12.config" src="NUnitAddin\runtimes\net12.config" />
</Component>
<Component Id="C_97fbf17a2993af20f32712832b5fbcc7"
Guid="97fbf17a-2993-af20-f327-12832b5fbcc7">
<File Id="F_97fbf17a2993af20f32712832b5fbcc7" Name="NET20~1.CON"
LongName="net20.config" src="NUnitAddin\runtimes\net20.config" />
</Component>
</Directory>
<Directory Id="D_e8a17bec33054952bb6f31dbdb2e7a81" Name="lib"
LongName="lib">
<Component Id="C_d68012501a3e4796a09f43b0208902b1"
Guid="d6801250-1a3e-4796-a09f-43b0208902b1">
<File Id="F_d68012501a3e4796a09f43b0208902b1"
Name="MUTANT~3.DLL" LongName="MutantDesign.ManagedAddIns.dll"
src="..\ManagedAddIns\Tests\bin\MutantDesign.ManagedAddIns.dll" />
</Component>
<Component Id="C_79ba08747349da554584d763e9c3b536"
Guid="79ba0874-7349-da55-4584-d763e9c3b536">
<File Id="F_79ba08747349da554584d763e9c3b536"
Name="MUTANT~3.DLL" LongName="MutantDesign.ManagedAddIns.Services.dll"
src="..\ManagedAddIns\Tests\bin\MutantDesign.ManagedAddIns.Services.dll" />
</Component>
</Directory>
<Component Id="C_0d57b7d4022f1f0ee5cf9f3dc3e40020"
Guid="0d57b7d4-022f-1f0e-e5cf-9f3dc3e40020">
<File Id="F_0d57b7d4022f1f0ee5cf9f3dc3e40020" Name="MUTANT~1.DLL"
LongName="MutantDesign.ManagedAddIns.Services.dll"
src="NUnitAddin\..\..\ManagedAddIns\Tests\bin\MutantDesign.ManagedAddIns.Ser
vices.dll" />
</Component>
<Component Id="C_fdfe27ba7225eefb183c7fa00e00c9b4"
Guid="fdfe27ba-7225-eefb-183c-7fa00e00c9b4">
<File Id="F_fdfe27ba7225eefb183c7fa00e00c9b4" Name="Notes.htm"
LongName="Notes.htm" src="NUnitAddin\Notes.htm" />
</Component>
<Component Id="C_43a46a698b77ff2ea398a9c3ce6f717f"
Guid="43a46a69-8b77-ff2e-a398-a9c3ce6f717f">
<File Id="F_43a46a698b77ff2ea398a9c3ce6f717f" Name="NUNITA~1.CON"
LongName="nunitaddin.config" src="NUnitAddin\nunitaddin.config" />
</Component>
<Component Id="C_a14fc90fa19a9a5acdbea8f24e4cb8ef"
Guid="a14fc90f-a19a-9a5a-cdbe-a8f24e4cb8ef">
<File Id="F_a14fc90fa19a9a5acdbea8f24e4cb8ef" Name="NUNITA~1.EXE"
LongName="NUnitAddin.exe" src="NUnitAddin\bin\Debug\NUnitAddin.exe" />
</Component>
<Component Id="C_d1f9216d472c9165285a3517afc5c8c6"
Guid="d1f9216d-472c-9165-285a-3517afc5c8c6">
<File Id="F_d1f9216d472c9165285a3517afc5c8c6" Name="NUNITA~2.CON"
LongName="NUnitAddin.exe.config"
src="NUnitAddin\bin\Debug\NUnitAddin.exe.config" />
</Component>
<Component Id="C_4c92e542556b64cb5e7ced616636c9bd"
Guid="4c92e542-556b-64cb-5e7c-ed616636c9bd">
<File Id="F_4c92e542556b64cb5e7ced616636c9bd" Name="MUTANT~1.DLL"
LongName="MutantDesign.dll" src="MutantDesign\bin\Debug\MutantDesign.dll" />
</Component>
<Component Id="C_bbbb3733bacceab10740626158732f7a"
Guid="bbbb3733-bacc-eab1-0740-626158732f7a">
<File Id="F_bbbb3733bacceab10740626158732f7a" Name="MUTANT~1.DLL"
LongName="MutantDesign.EnvDte.dll"
src="MutantDesign.EnvDte\bin\Debug\MutantDesign.EnvDte.dll" />
</Component>
<Component Id="C_c26efcbb5aa7ad9545db861cc3e188fd"
Guid="c26efcbb-5aa7-ad95-45db-861cc3e188fd">
<File Id="F_c26efcbb5aa7ad9545db861cc3e188fd" Name="NUNITA~1.DLL"
LongName="NUnitAddin.TestRunner.dll"
src="NUnitAddin.TestRunner\bin\Debug\NUnitAddin.TestRunner.dll" />
</Component>
<Component Id="C_cea1597c41a7fc9d2a6ad6174ed3829f"
Guid="cea1597c-41a7-fc9d-2a6a-d6174ed3829f">
<File Id="F_cea1597c41a7fc9d2a6ad6174ed3829f" Name="NUNITA~1.DLL"
LongName="NUnitAddin.TestRunner.Framework.dll"
src="NUnitAddin.TestRunner.Framework\bin\Debug\NUnitAddin.TestRunner.Framewo
rk.dll" />
</Component>
<Component Id="C_dd1cc65557fa1b0aad383b8241a69d08"
Guid="dd1cc655-57fa-1b0a-ad38-3b8241a69d08">
<File Id="F_dd1cc65557fa1b0aad383b8241a69d08" Name="NUNITA~1.DLL"
LongName="NUnitAddin.TestRunner.Runtimes.dll"
src="NUnitAddin.TestRunner.Runtimes\bin\Debug\NUnitAddin.TestRunner.Runtimes
.dll" />
</Component>
<Component Id="C_336119253d86417257327f18a666614f"
Guid="33611925-3d86-4172-5732-7f18a666614f">
<File Id="F_336119253d86417257327f18a666614f" Name="NUNITA~1.DLL"
LongName="NUnitAddin.AdHoc.dll"
src="NUnitAddin.AdHoc\bin\Debug\NUnitAddin.AdHoc.dll" />
</Component>
<Component Id="C_c4fbba73ae9ea15c7c8da7260d564159"
Guid="c4fbba73-ae9e-a15c-7c8d-a7260d564159">
<File Id="F_c4fbba73ae9ea15c7c8da7260d564159" Name="NUNITC~1.DLL"
LongName="nunit.core.dll" src="NUnitAddin.NUnit\..\bin\NUnit\nunit.core.dll"
/>
</Component>
<Component Id="C_7d8d4deb750f1cdb13877abcd095bcd7"
Guid="7d8d4deb-750f-1cdb-1387-7abcd095bcd7">
<File Id="F_7d8d4deb750f1cdb13877abcd095bcd7" Name="NUNITF~1.DLL"
LongName="nunit.framework.dll"
src="NUnitAddin.NUnit\..\bin\NUnit\nunit.framework.dll" />
</Component>
<Component Id="C_70d92e0fa3048fcbc862c509bf833e4c"
Guid="70d92e0f-a304-8fcb-c862-c509bf833e4c">
<File Id="F_70d92e0fa3048fcbc862c509bf833e4c" Name="NUNITU~1.DLL"
LongName="nunit.uikit.dll"
src="NUnitAddin.NUnit\..\bin\NUnit\nunit.uikit.dll" />
</Component>
<Component Id="C_2676255db2265d5b5701d20b35c1da89"
Guid="2676255d-b226-5d5b-5701-d20b35c1da89">
<File Id="F_2676255db2265d5b5701d20b35c1da89" Name="NUNITU~1.DLL"
LongName="nunit.util.dll" src="NUnitAddin.NUnit\..\bin\NUnit\nunit.util.dll"
/>
</Component>
<Component Id="C_b88e98ae33aebcedf8500d6283320836"
Guid="b88e98ae-33ae-bced-f850-0d6283320836">
<File Id="F_b88e98ae33aebcedf8500d6283320836" Name="NUNIT-~1.EXE"
LongName="nunit-console.exe"
src="NUnitAddin.NUnit\..\bin\NUnit\nunit-console.exe" />
</Component>
<Component Id="C_6b3a3e57c4a46a6851e05d8ed4020963"
Guid="6b3a3e57-c4a4-6a68-51e0-5d8ed4020963">
<File Id="F_6b3a3e57c4a46a6851e05d8ed4020963" Name="NUNIT-~1.EXE"
LongName="nunit-gui.exe" src="NUnitAddin.NUnit\..\bin\NUnit\nunit-gui.exe"
/>
</Component>
<Component Id="C_a05778b889dc8f8bc2db9a3ec575f23a"
Guid="a05778b8-89dc-8f8b-c2db-9a3ec575f23a">
<File Id="F_a05778b889dc8f8bc2db9a3ec575f23a" Name="NUNITA~1.DLL"
LongName="NUnitAddin.NUnit.dll"
src="NUnitAddin.NUnit\bin\Debug\NUnitAddin.NUnit.dll" />
</Component>
<Component Id="C_7f34010c9d32ab9b9b72a761dbc8e483"
Guid="7f34010c-9d32-ab9b-9b72-a761dbc8e483">
<File Id="F_7f34010c9d32ab9b9b72a761dbc8e483" Name="NUNITA~1.DLL"
LongName="NUnitAddin.TestRunner.Server.dll"
src="NUnitAddin.TestRunner.Server\bin\Debug\NUnitAddin.TestRunner.Server.dll
" />
</Component>
<Component Id="C_cf2d9a23bab91fa0d04faebd7b838cb0"
Guid="cf2d9a23-bab9-1fa0-d04f-aebd7b838cb0">
<File Id="F_cf2d9a23bab91fa0d04faebd7b838cb0" Name="NUNITA~1.DLL"
LongName="NUnitAddin.Services.dll"
src="NUnitAddin.Services\bin\Debug\NUnitAddin.Services.dll" />
</Component>
<Component Id="C_88e0487a3873e87e79b151e4f004a4b6"
Guid="88e0487a-3873-e87e-79b1-51e4f004a4b6">
<File Id="F_88e0487a3873e87e79b151e4f004a4b6" Name="App.ico"
LongName="App.ico" src="WebServices\App.ico" />
</Component>
<Component Id="C_0226e97e099f56c9459e8cc37f0f81fc"
Guid="0226e97e-099f-56c9-459e-8cc37f0f81fc">
<File Id="F_0226e97e099f56c9459e8cc37f0f81fc" Name="TESTRU~1.ASM"
LongName="TestRunner.asmx" src="WebServices\TestRunner.asmx" />
</Component>
<Component Id="C_abaed4346402a89d24af5227fce1a2a7"
Guid="abaed434-6402-a89d-24af-5227fce1a2a7">
<File Id="F_abaed4346402a89d24af5227fce1a2a7" Name="WEB~1.CON"
LongName="Web.config" src="WebServices\Web.config" />
</Component>
<Component Id="C_efd8794321b374a62aa46415f0d4d49f"
Guid="efd87943-21b3-74a6-2aa4-6415f0d4d49f">
<File Id="F_efd8794321b374a62aa46415f0d4d49f" Name="NUNITA~1.DLL"
LongName="NUnitAddIn.WebServices.dll"
src="WebServices\bin\NUnitAddIn.WebServices.dll" />
</Component>
<Component Id="C_fd9a11e3d4055031bae078fd126e12a9"
Guid="fd9a11e3-d405-5031-bae0-78fd126e12a9">
<File Id="F_fd9a11e3d4055031bae078fd126e12a9" Name="NUNITA~1.DLL"
LongName="NUnitAddin.Tests.dll" src="bin\Debug\NUnitAddin.Tests.dll" />
</Component>
<Component Id="C_cdb5b4cd6f1c302d0c477730dce4198c"
Guid="cdb5b4cd-6f1c-302d-0c47-7730dce4198c">
<File Id="F_cdb5b4cd6f1c302d0c477730dce4198c" Name="NUNITA~1.DLL"
LongName="NUnitAddin.Tools.dll"
src="NUnitAddin.Tools\bin\Debug\NUnitAddin.Tools.dll" />
</Component>
<Component Id="C_c0039f0449819281a564efaf1b127a46"
Guid="c0039f04-4981-9281-a564-efaf1b127a46">
<File Id="F_c0039f0449819281a564efaf1b127a46" Name="PROCES~1.EXE"
LongName="ProcessInvocation.exe"
src="ProcessInvocation\bin\ProcessInvocation.exe" />
</Component>
</Directory>
</Directory>
</Module>
</Wix>
_____
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Riko Eksteen
Sent: 05 May 2004 10:15
To: ***@users.sourceforge.net; Anand Murugesan;
wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] Including all files under a directory
I finally understand why the FileGroup element is so dangerous, and I won't
be using it again (thanks Rob).
I had a look at the component rules in the SDK again, and realised that the
requirements there doesn't fit with FileGroup. Specifically, one should
never add or remove resources from a component without changing the
component code, otherwise those resources might not be
removed/repaired/upgraded etc. Think this is pretty self-evident. If that is
the case, "The <FileGroup/> element is a very dangerous thing to use"
because if files in a folder are included this way, there is no way to know
whether you actually add new resources to an already existing component.
That sent me an a mission to find out how InstallShield's dynamic file
linking works, because it would be subject to the same flaw in logic, so to
speak. InstallShield's dynamic linking includes both subfolders and files,
and what it actually does behind your back is to create new components per
subfolder, include all the files, and set the first as the KeyPath. It also
generates new component codes at build time, so that the above requirement
is met. So this would work, theoretically (we certainly haven't had
problems with it), but it does make it hard to keep track of what files
exactly are included in your components, and might lead to some problems
when doing upgrades.
Anyway, this brings me back to the right way to add files in WiX - manually.
This is fine and dandy, except that I've spent just about a whole day adding
every single xml file in the specific product (there 696 of these files and
212 related folders) and I'm still going. This is a bit of a problem: apart
from the fact that the text-based entry method is error prone, it will be a
hell of an ask to track changes and add them correctly. It is here that
InstallShield has a significant advantage.
I spoke to some of our developers yesterday and they are not very keen to
use something like this - they want an easier way to include files etc. So
now I feel like I'm back to square one - I don't want to use a product like
InstallShield, because 1) it's expensive to distribute all round 2) it does
stuff behind your back 3) it doesn't create the cleanest MSIs (unnecessary
tables etc.). I would like something that would allow the developers to
author and maintain their own MSIs, but Visual Studio Installer is too
high-level (hides everything away) and it looks like WiX will be difficult
to use for large projects, despite it's many advantages.
Any thoughts?
-----Original Message-----
From: Rob Mensching [mailto:***@users.sourceforge.net]
Sent: 04 May 2004 02:12
To: 'Anand Murugesan'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] Including all files under a directory
The <FileGroup/> element is a very dangerous thing to use and I always
discourage its use. Autogenerating Components (which would be necessary to
add Files from subdirectories) isn't just dangerous, it is down right scary.
You have to understand the Component Rules
(http://blogs.msdn.com/robmen/archive/2003/10/18/56497.aspx) and then you'll
see why autogenerating Components for each of your Directories is a really
scary thing to do.
The WiX toolset does not autogenerate Components. Full stop.
_____
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Anand Murugesan
Sent: Monday, May 03, 2004 4:43 PM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Including all files under a directory
Hi All,
I am trying to add all the files (including the subdirectories), under
C:\software\package1 into my MSI.
I am using the following MSI segment. But, it includes only the top level
files in the package1 directory. How do I make it to drill down to all
subdirectories ?
<FileGroup Prefix='bla' DiskId='1' src='C:\software\package1' />
Is this the right approach, or should I consider creating a separate
archieve or cab file and reference it in my wsx file. If thats the better
solution, how do I do that for the above mentioned scenario ?
Thanks,
Anand.