Super! Thanks Peter... that helps with the initial fiddly bits like namespaces and some typical XPath queries.
-----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: Tuesday, 23 October 2012 9:07 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] ServiceInstaller for harvested file Here's an extract we use to tidy up a heated help files. It's no use in itself but you can see a way to handle namespaces, select Wix elements, etc. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" exclude-result-prefixes="wix xs"> <xsl:strip-space elements="*" /> <xsl:output indent="yes" /> <!-- Caller must pass parameters "helpBuildPrefix" "targetDirName" and "targetSubdirName". --> <xsl:param name="helpBuildPrefix" /> <xsl:param name="targetDirName" /> <xsl:param name="targetSubdirName" /> <xsl:variable name="libPrefix" select="concat($helpBuildPrefix, 'Help')"/> <!-- Add in a componentgroup because heat's -cg switch wont handle this many components. The map.xml component also needs moving up a directory level. --> <xsl:template match="wix:Fragment/wix:DirectoryRef"> <DirectoryRef xmlns="http://schemas.microsoft.com/wix/2006/wi" > <xsl:apply-templates select="@*" /> <!-- Make a copy of the map.xml component here. --> <xsl:apply-templates select="wix:Component[@Id='Map.xml']" /> <Directory Id="{$libPrefix}TargetDir" Name="{$targetDirName}"> <Directory Id="{$libPrefix}TargetSubdir" Name="{$targetSubdirName}"> <!-- Process everything except the map.xml component. --> <xsl:apply-templates select="* except wix:Component[@Id='Map.xml']"/> </Directory> </Directory> </DirectoryRef> <!-- Add a component group. Include the lib prefix on the ComponentRef Ids. --> <ComponentGroup Id="{$libPrefix}Components" xmlns="http://schemas.microsoft.com/wix/2006/wi" > <xsl:for-each select=".//wix:Component"> <ComponentRef Id="{concat($libPrefix, current()/@Id)}" /> </xsl:for-each> </ComponentGroup> </xsl:template> <!-- Insert an ID on the fragment with the wixlib ID and build number. --> <xsl:template match="wix:Fragment"> <xsl:copy> <xsl:attribute name="Id">$(var.libName)=$(var.SdlBuildNumber)</xsl:attribute> <xsl:apply-templates /> </xsl:copy> </xsl:template> <!-- Add lib prefix to every directory, component and file Id. --> <xsl:template match="wix:File/@Id | wix:Directory/@Id | wix:Component/@Id"> <xsl:attribute name="Id"> <xsl:value-of select="concat($libPrefix, .)" /> </xsl:attribute> </xsl:template> <!-- Copy everything else with an identity transform. --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> </xsl:stylesheet> -----Original Message----- From: Johann A. Hough [mailto:joh...@silverskysoftware.com.au] Sent: 23 October 2012 11:38 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] ServiceInstaller for harvested file Thanks all I've started looking at using an XSLT transformation - it's been years since I had to write XSL so it'll be slow going initially. Is there perhaps a set of WiX XSL examples available somewhere? -----Original Message----- From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] Sent: Tuesday, 23 October 2012 4:25 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] ServiceInstaller for harvested file Retrying this as the last attempt bounced.. If you are using heat you could provide it with a -t and an XSLT transform which would be used to tweak the default output to your liking. This would allow you to only have the need for the generated file. Jacob -----Original Message----- From: Johann A. Hough [mailto:joh...@silverskysoftware.com.au] Sent: Monday, October 22, 2012 9:31 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] ServiceInstaller for harvested file Hi all I've started the arduous process of recreating a new installer using WiX to replace our existing VS2010 Setup Projects. Unfortunately it's not been smooth sailing, because to be able to create some basic installation capabilities like dependencies discovery, website installation, content harvesting, etc. has taken a lot of time and research. I've bridged most of those with various solutions from the web, but have now struck out with the installation of a service. Specifically we harvest content and dependencies using heat (during Build Event) because website projects, and other projects have content that regularly change) and it's simply not feasible to manually update the .WXS file for those changes. One of those projects for installation is a Windows service (in fact it's a .NET Service with a ServiceInstaller implemented). The frustration I'm having is being able to point <ServiceInstall ... /> to the service executable, without having to place the <ServiceInstall /> for it inside the generated (harvested) .WXS file (within in the same <Component ... /> for the <File />). Given my relatively basic understanding of WiX I'm wondering if there is a way to reference that component in a fragment or something so that the <ServiceInstall ... /> can find the service it needs to install. Stating the same problem differently, the <File /> pointing to the Service executable is located in one .WXS (a generated one) and the <ServiceInstall /> for it is located in another .WXS file (manually maintained) - how can I marry the Service Install to make it work? I also have another question regarding some of the properties for Service Install - and I'm not sure why they are there, for example DisplayName, Description, Account, etc. - these are already defined in the .NET ServiceInstaller code and should just be used not so? Thanks all Johann ----------------------------------------------------------------------------- - Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ----------------------------------------------------------------------------- - Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ----------------------------------------------------------------------------- - Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users SDL PLC confidential, all rights reserved. If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us. SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207. Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, UK. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users