Skip to content

Commit 41ceeaf

Browse files
committed
Example project that tries to demonstrate how to use HarvestDirectory. Currently failing because the files cannot be found during the link step.
0 parents  commit 41ceeaf

File tree

7 files changed

+92
-0
lines changed

7 files changed

+92
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/obj
2+
/bin

README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Sample project which attempts to show how to use the HarvestDirectory target
2+
provided by WiX:
3+
4+
http://wixtoolset.org/documentation/manual/v3/msbuild/target_reference/harvestdirectory.html

foo.wixproj

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<ProductVersion>1.0.0</ProductVersion>
4+
<DefineConstants>ProductVersion=$(ProductVersion)</DefineConstants>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7+
<ProjectGuid>27e80d9b-d8b6-423a-a6ff-1d9c5b23bb31</ProjectGuid>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<OutputName>foo-$(ProductVersion)</OutputName>
10+
<OutputType>Package</OutputType>
11+
<DefineSolutionProperties>false</DefineSolutionProperties>
12+
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
15+
<OutputPath>bin\$(Configuration)\</OutputPath>
16+
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
17+
<DefineConstants>Debug;ProductVersion=$(ProductVersion)</DefineConstants>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
20+
<OutputPath>bin\$(Configuration)\</OutputPath>
21+
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
22+
</PropertyGroup>
23+
<ItemGroup>
24+
<Compile Include="foo.wxs" />
25+
<HarvestDirectory Include="items">
26+
<DirectoryRefId>ItemDir</DirectoryRefId>
27+
<ComponentGroupName>Items</ComponentGroupName>
28+
<!-- <PreprocessorVariable>var.ItemDir</PreprocessorVariable> -->
29+
</HarvestDirectory>
30+
<WixExtension Include="WixUIExtension" />
31+
</ItemGroup>
32+
<Import Project="$(WixTargetsPath)" />
33+
</Project>

foo.wxs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<?define ItemDir = "items" ?>
4+
<Product Name="Foo"
5+
Version="$(var.ProductVersion)"
6+
Manufacturer="Foo Inc."
7+
Language="1033"
8+
UpgradeCode="0c8504c9-4e62-4e2c-9e1c-4fbe1c478b37"
9+
Id="*">
10+
11+
<Package Description="Foo"
12+
Manufacturer="Foo Inc."
13+
Compressed="yes"
14+
InstallerVersion="301" />
15+
16+
<MajorUpgrade AllowDowngrades="no"
17+
DowngradeErrorMessage="A newer version of this software is already installed."
18+
AllowSameVersionUpgrades="no" />
19+
20+
<Media Id="1" Cabinet="cabinet.cab" EmbedCab="yes" />
21+
22+
<Property Id="ARPCOMMENTS">
23+
Foo package.
24+
</Property>
25+
<Property Id="ARPCONTACT">Foo Inc.</Property>
26+
<Property Id="ARPURLINFOABOUT">https://www.example.com/</Property>
27+
28+
<Directory Id="TARGETDIR" Name="SourceDir">
29+
<Directory Id="ProgramFilesFolder" Name="PFiles">
30+
<Directory Id="INSTALLDIR" Name="Foo">
31+
<Component Id="readme">
32+
<File Id="readme" Name="README.txt" Source="README.txt" />
33+
</Component>
34+
<Directory Id="ItemDir" />
35+
</Directory>
36+
</Directory>
37+
</Directory>
38+
39+
<Feature Id="Software"
40+
Title="Foo"
41+
AllowAdvertise="no"
42+
ConfigurableDirectory="INSTALLDIR">
43+
<ComponentRef Id="readme" />
44+
<ComponentGroupRef Id="Items" />
45+
</Feature>
46+
47+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
48+
<UIRef Id="WixUI_InstallDir" />
49+
</Product>
50+
</Wix>

items/apple.txt

Whitespace-only changes.

items/banana.txt

Whitespace-only changes.

test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"
2+
"$MSBUILD" -t:rebuild -p:Configuration=Release -p:TreatWarningsAsErrors=True \
3+
foo.wixproj

0 commit comments

Comments
 (0)