--- /dev/null
+WIX = $(PROGRAMFILES)\Windows Installer XML v3\bin
+CANDLE = "$(WIX)\candle.exe"
+LIGHT = "$(WIX)\light.exe"
+HEAT = "$(WIX)\heat.exe"
+SED = sed
+BUILD = build\usr\local
+
+graphviz.msi : graphviz.wixobj bin.wixobj include.wixobj lib.wixobj share.wixobj
+ $(LIGHT) -ext WixUIExtension -cultures:en-us -out $@ $^
+
+%.wixobj : %.wxs
+ $(CANDLE) -sw1092 -out $@ $^
+
+# we need to post process dir.wxs with sed to:
+# (1) change the GUID markers PUT-GUID-HERE to the autogenerated *
+# (2) change the ComponentGroup1 ID to the dir
+# (3) change the graphviz id of a directory to dir_graphviz
+# (4) convert first <Directory Name="dir"> in Fragment to <DirectoryRef Id="dir">
+# (5) convert last </Directory> in Fragment to </DirectoryRef>
+bin.wxs include.wxs lib.wxs share.wxs : %.wxs : $(shell find "$(BUILD)" -type f)
+ $(HEAT) dir "$(BUILD)\$*" -sfrag -out $*-pre.wxs && \
+ $(SED) 's/PUT-GUID-HERE/*/g; s/Id="ComponentGroup1"/Id="$*"/g; s/Id="graphviz"/Id="$*_graphviz"/g; $!N; s/\(<Fragment>\W*\)<Directory.*Name="$*".*>/\1<DirectoryRef Id="$*">/g; s/<\/Directory>\(\W*<\/Fragment>\)/<\/DirectoryRef>\1/g; P; D' $*-pre.wxs >$*.wxs
+
+.PHONY : clean
+clean :
+ -rm *.msi *.wixobj bin*.wxs include*.wxs lib*.wxs share*.wxs
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product
+ Id="*"
+ Name="Graphviz"
+ Language="1033"
+ Version="@VERSION@"
+ Manufacturer="AT&T Corporation"
+ UpgradeCode="12345678-1234-1234-1234-123456789013">
+ <!-- Product Id is autogenerated, so every build is a "major upgrade" -->
+
+ <Package
+ Description="AT&T Graphviz"
+ Comments="AT&T Graphviz - Graph Visualization Software"
+ Manufacturer="AT&T Corporation"
+ InstallerVersion="200"
+ Compressed="yes" />
+
+ <Property Id="ARPCOMMENTS" Value="AT&T Graphviz - Graph Visualization Software" />
+ <Property Id="ARPHELPLINK" Value="http://www.graphviz.org/" />
+ <Property Id="ARPURLUPDATEINFO" Value="http://www.graphviz.org/Download_windows.php" />
+
+ <UIRef Id="WixUI_Mondo" />
+
+ <Media Id="1" Cabinet="graphviz.cab" EmbedCab="yes" />
+
+ <Upgrade Id="12345678-1234-1234-1234-123456789013">
+ <!-- don't install over same or newer versions -->
+ <UpgradeVersion
+ Minimum="@VERSION@"
+ IncludeMinimum="yes"
+ OnlyDetect="yes"
+ Language="1033"
+ Property="NEWPRODUCTFOUND" />
+ <!-- install over all older versions -->
+ <UpgradeVersion
+ Minimum="0.0.0.0"
+ IncludeMinimum="yes"
+ Maximum="@VERSION@"
+ IncludeMaximum="no"
+ Language="1033"
+ Property="UPGRADEFOUND" />
+ </Upgrade>
+
+ <Directory Id="TARGETDIR" Name="SourceDir">
+ <Directory Id="ProgramFilesFolder">
+ <Directory Id="ApplicationFolder" Name="Graphviz">
+ <!-- referenced by the directories in the heated wxs -->
+ <Directory Id="bin" Name="bin" />
+ <Directory Id="include" Name="include" />
+ <Directory Id="lib" Name="lib" />
+ <Directory Id="share" Name="share" />
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Feature Id="cli" Title="Command Line Tools and Libraries" Level="1">
+ <!-- refer to component groups in the heated wxs -->
+ <ComponentGroupRef Id="bin" />
+ <ComponentGroupRef Id="include" />
+ <ComponentGroupRef Id="lib" />
+ <ComponentGroupRef Id="share" />
+ </Feature>
+
+ <CustomAction Id="PreventDowngrading" Error="Same or newer version already installed." />
+
+ <InstallExecuteSequence>
+ <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
+ <RemoveExistingProducts After="InstallFinalize" />
+ </InstallExecuteSequence>
+
+ <InstallUISequence>
+ <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
+ </InstallUISequence>
+ </Product>
+</Wix>