]> granicus.if.org Git - graphviz/commitdiff
WiX builds for MSI installation packages on Windows
authorglenlow <devnull@localhost>
Thu, 6 Mar 2008 07:13:20 +0000 (07:13 +0000)
committerglenlow <devnull@localhost>
Thu, 6 Mar 2008 07:13:20 +0000 (07:13 +0000)
configure.ac
windows/graphviz.msi.make [new file with mode: 0755]
windows/graphviz.wxs.in [new file with mode: 0755]

index 9bfb9831c0c4e7922b97f5dc14a276f4491e07c0..1ea301d390de416e4fb653d9be3b54e5add83466 100644 (file)
@@ -2495,6 +2495,7 @@ AC_CONFIG_FILES(Makefile
        macosx/Info.plist
        macosx/graphviz.pmdoc/01local.xml
        macosx/graphviz.pmdoc/02graphviz.xml
+       windows/graphviz.wxs
        plugin/Makefile
        plugin/core/Makefile
        plugin/devil/Makefile
diff --git a/windows/graphviz.msi.make b/windows/graphviz.msi.make
new file mode 100755 (executable)
index 0000000..ef0b4cb
--- /dev/null
@@ -0,0 +1,27 @@
+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 
diff --git a/windows/graphviz.wxs.in b/windows/graphviz.wxs.in
new file mode 100755 (executable)
index 0000000..fd8e0de
--- /dev/null
@@ -0,0 +1,76 @@
+<?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&amp;T Corporation"
+               UpgradeCode="12345678-1234-1234-1234-123456789013">
+               <!-- Product Id is autogenerated, so every build is a "major upgrade" -->
+
+               <Package
+                       Description="AT&amp;T Graphviz"
+                       Comments="AT&amp;T Graphviz - Graph Visualization Software"
+                       Manufacturer="AT&amp;T Corporation"
+                       InstallerVersion="200"
+                       Compressed="yes" />
+
+               <Property Id="ARPCOMMENTS" Value="AT&amp;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>