<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Setup (WiX, MSI)</title>
        <link>http://geekswithblogs.net/jwatson/category/5612.aspx</link>
        <description>Setup (WiX, MSI)</description>
        <language>en-US</language>
        <copyright>John Watson</copyright>
        <managingEditor>jwatson3d@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Changing an install directory dynamically in WiX 2.0</title>
            <link>http://geekswithblogs.net/jwatson/archive/2006/11/03/96052.aspx</link>
            <description>&lt;p&gt;Somehow this topic seems so common place&amp;nbsp;and yet no where have I been able to find it spelled out clearly and simply. This reminds&amp;nbsp;me&amp;nbsp;of the joke about a helicopter pilot who's lost in the fog near Seattle, asks where he is and then is able to quickly navigate from there. When asked how he did that, he replied that the person in the window held up a sign saying "You're in a helicopter" which is such a typical engineer's response (accurate and truthful but not helpful or useful) so the pilot knew he was at the Microsoft campus and was able to navigate from there back to the airport.&lt;/p&gt; &lt;p&gt;If you need to set a directory "on the fly" either based upon a value from a dialog or some other means there are two things you need to do and one&amp;nbsp;caveat:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Create a custom action that sets the directory value:&lt;br&gt;&amp;lt;&lt;font color="#0000a0"&gt;CustomAction&lt;/font&gt; &lt;font color="#ff0000"&gt;Id&lt;/font&gt;&lt;font color="#0000a0"&gt;=&lt;/font&gt;"&lt;font color="#800000"&gt;AssignWebDir&lt;/font&gt;" &lt;font color="#ff0000"&gt;Directory&lt;/font&gt;&lt;font color="#0000a0"&gt;=&lt;/font&gt;"&lt;font color="#800000"&gt;WEBSITEDIR&lt;/font&gt;" &lt;font color="#ff0000"&gt;Value&lt;/font&gt;&lt;font color="#0000a0"&gt;=&lt;/font&gt;"&lt;font color="#800000"&gt;[WEBROOTDIR][SITE.NAME]&lt;/font&gt;"/&amp;gt;&lt;br&gt;&lt;/li&gt; &lt;li&gt;Schedule the action during the InstallExecution phase (must be after the CostFinalize step):&lt;br&gt;&amp;lt;&lt;font color="#0000a0"&gt;Custom&lt;/font&gt; &lt;font color="#ff0000"&gt;Action&lt;/font&gt;="&lt;font color="#800000"&gt;AssignWebDir&lt;/font&gt;" &lt;font color="#ff0000"&gt;After&lt;/font&gt;="&lt;font color="#800000"&gt;CostFinalize&lt;/font&gt;"&amp;gt;&lt;font color="#ff0080"&gt;&amp;lt;![CDATA[NOT Installed AND (&amp;amp;WebServer = 3) AND NOT (!WebServer = 3)]]&amp;gt;&lt;/font&gt;&amp;lt;/&lt;font color="#0000a0"&gt;Custom&lt;/font&gt;&amp;gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;The caveat is that at the time you've scheduled the custom action the directory name, which is also a&amp;nbsp;property, has been resolved. In the above example, assume that the parent directory, named WEBROOTDIR, is the default "C:\Inetpub\wwwroot\". Under the parent directory is where you've specified WEBSITEDIR to be. Even though you may specify an initial directory name (e.g. "mysite") on the &amp;lt;Directory&amp;gt; tag in the .wxs file you must use the full path&amp;nbsp;when changing the name - thus the new value in #1 above contains the parent directory name and the site name (which I prompt the user for).&lt;/p&gt; &lt;p&gt;To round out the notes for the above example - the &lt;font color="#ff0080"&gt;&amp;lt;![CDATA[...]]&amp;gt;&lt;/font&gt; syntax around the conditions "preserves" the xml integrity because of the ampersand (&amp;amp;) character in front of the Feature name. The full condition is if the product is not installed (i.e. it's being installed) and if the Feature (in this case the "WebServer" feature) is being installed locally&amp;nbsp;and it's not already installed locally. Finally the &lt;font color="#ff0000"&gt;Directory=&lt;/font&gt; attribute causes WiX to create a &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/custom_action_type_51.asp" target="_blank"&gt;Type 35&lt;/a&gt; Custom Action whereas using &lt;font color="#ff0000"&gt;Property=&lt;/font&gt; causes WiX to create a &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/custom_action_type_51.asp" target="_blank"&gt;Type 51&lt;/a&gt; Custom Action. I mention that because they're briefly mentioned buried in the .chm help although not the &lt;a href="http://wix.sourceforge.net/manual-wix2/wix_xsd_customaction.htm" target="_blank"&gt;online&lt;/a&gt; docs and not in the tutorial (more on that in a moment). When you're searching and trying things it's easy to miss that bit of info.&lt;/p&gt; &lt;p&gt;My "beef" and the reason for the reminder of the joke is that you can find lots of bits and pieces of WiX and MSI info such as &lt;a href="http://www.nabble.com/Dynamic-naming-directories-tf1461842.html#a3964057" target="_blank"&gt;"You can use a Custom Action to set a directory location"&lt;/a&gt; but the person giving the answer stops short of mentioning the rest or giving an example. I'm not picking on that one person - this seems to be the style and culture of the mailing lists on&amp;nbsp;SourceForge.&amp;nbsp;That is, I can find dozens of responses on directories and properties with&amp;nbsp;&lt;a href="http://www.nabble.com/Windows-Installer-XML-%28WiX%29-toolset-f4468.html" target="_blank"&gt;Nabble&lt;/a&gt; (which does a much better job of indexing, searching and providing results of the SourceForge mailing lists) but nobody bothered to offer a concise and complete answer.&lt;/p&gt; &lt;p&gt;Even the &lt;a href="http://www.tramontana.co.hu/wix/index.php" target="_blank"&gt;WiX Tutorial&lt;/a&gt; which I'm sure took a lot of effort and a long time to compile and update mentions the "facts" in bits and pieces: &lt;a href="http://www.tramontana.co.hu/wix/lesson3.php#3.2" target="_blank"&gt;3.2&lt;/a&gt; shows both&amp;nbsp;examples of dynamically setting a directory using either a&amp;nbsp;&lt;font color="#ff0000"&gt;Directory=&lt;/font&gt; or a &lt;font color="#ff0000"&gt;Property=&lt;/font&gt; attribute but fails to mention the difference (Type 35 or 51) or impact. I say both because you'll find both suggestions mentioned repeatedly on the mailing list without a complete example or a clear indication of which to use and why. The same 3.2 section shows how to schedule the actions up above the examples but doesn't mention that directories have to be scheduled after CostFinalize and require a fully-replaced path be specified because it's been resolved. It's only through&amp;nbsp;more searching elsewhere on the mailing list that you can dig up the fact&amp;nbsp;about cost finalize and scheduling directory/file name changes afterwards. Although&amp;nbsp;nobody spelled out the little tidbit about paths already being resolved at that point. Also, &lt;a href="http://www.tramontana.co.hu/wix/lesson5.php#5.6" target="_blank"&gt;5.6&lt;/a&gt; mentions creating directories (this is where you'd expect to find the information for changing them) but neglects to mention they can be changed and that to do so, you use a custom action with&amp;nbsp;links back to the relevant 3.2 section showing that. Going beyond this, if you want to put together a dialog to prompt and pass values, you'll have to spend a lot of time in Lessons &lt;a href="http://www.tramontana.co.hu/wix/lesson2.php" target="_blank"&gt;2&lt;/a&gt; and &lt;a href="http://www.tramontana.co.hu/wix/lesson8.php" target="_blank"&gt;8&lt;/a&gt; as well as the mailing lists. ;)&lt;/p&gt; &lt;p&gt;Finally, Rob teased us with his last entry on the directory table and Type 51 actions &lt;a href="http://blogs.msdn.com/robmen/archive/2006/10/17/deciphering-the-msi-directory-table-part-7-directories-are-properties.aspx" target="_blank"&gt;here&lt;/a&gt;&amp;nbsp;but at the rate he's been able to post it'll be around the holidays before we get the answer. ;)&lt;/p&gt; &lt;p&gt;I'll end my rant with one more Microsoft observation - I searched Rob's blog for "msi directory". What's the very first thing displayed at the top of the list? Why the number of results AND THE NUMBER OF FREAKIN' MILLISECONDS IT TOOK TO FIND THEM! Yeah, that's what I'm most interested in - NOT! Then there's the random order to the results list - not by date or title or even number of comments - who knows!&lt;/p&gt; &lt;p&gt;This is the&amp;nbsp;tired helicopter pilot signing off from the fog around Seattle :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96052"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96052" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jwatson/aggbug/96052.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>John Watson</dc:creator>
            <guid>http://geekswithblogs.net/jwatson/archive/2006/11/03/96052.aspx</guid>
            <pubDate>Fri, 03 Nov 2006 17:13:00 GMT</pubDate>
            <comments>http://geekswithblogs.net/jwatson/archive/2006/11/03/96052.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jwatson/comments/commentRss/96052.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jwatson/services/trackbacks/96052.aspx</trackback:ping>
        </item>
        <item>
            <title>Generate WiX 2.0 Web Folder Fragment</title>
            <link>http://geekswithblogs.net/jwatson/archive/2006/10/27/95251.aspx</link>
            <description>&lt;p&gt;This little &lt;a href="http://tinyurl.com/y85xzx"&gt;utility&lt;/a&gt; grew out of need. I'm offering it up for free because it's so rough around the edges - no documentation, brute force approach, hardcoding, assumptions, etc. - you get what you paid for! It consists of a command script, a VBScript and an Xsl file - you can download it &lt;a href="http://tinyurl.com/y85xzx"&gt;here&lt;/a&gt;. To use it, you also need another little utility I built which will generate a nested Xml directory listing that you can find &lt;a href="http://geekswithblogs.net/jwatson/archive/2006/10/27/95222.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;It will take an Xml directory file (from this &lt;a href="http://geekswithblogs.net/jwatson/archive/2006/10/27/95222.aspx" target="_blank"&gt;previous utility&lt;/a&gt;) and generate a WiX 2.0 compatible fragment with the following features:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;DirectoryRef element so it can easily be referenced&amp;nbsp;back to&amp;nbsp;a Directory in a "controlling" WiX file.&lt;/li&gt; &lt;li&gt;Component element for the web virtual directory with&amp;nbsp;WebVirtualDir and WebApplication child elements.&lt;/li&gt; &lt;li&gt;Component element representing the root of the web folder with a child elements for&amp;nbsp;all Files found there, including both long and short names as needed.&lt;/li&gt; &lt;li&gt;Nested Directory elements representing each of the sub folders under the root web folder (recursive) with all files.&lt;/li&gt; &lt;li&gt;Ignores Visual SourceSafe (*.scc) files. ;)&lt;/li&gt; &lt;li&gt;ComponentGroup element to pull together all the pieces of the web site so it can be easily referenced from a Feature (via ComponentGroupRef)&amp;nbsp;in a "controlling" WiX file.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Of course, there's been limited testing (very limited, ok...I've only tested it on one project) so you may find some bugs. There's also some hardcoding and assumptions. Pay special attention near the top of the Xsl file where it's building the web virtual stuff (e.g. AllowSessions, DefaultWebSite, etc.).&amp;nbsp;I didn't bother to get fancy and code for&amp;nbsp;parameters.&lt;/p&gt; &lt;p&gt;Because of lack of time it carries a big assumption about the various artifact names - it uses the root folder name that you're building from. For example, if your web folder source is located at [C:\Inetpub\wwwroot\mywebsite] then it'll pick up "mywebsite" as the internal WiX name for the vdir, webapp, alias, etc. Finally, it picks up the auto generated GUIDs from the directory Xml ("ah,&amp;nbsp;&lt;u&gt;that's&lt;/u&gt; why he stuck them in there" ;) ) to use for component IDs and GUIDs. Therefore, this probably only has limited use as a first time tool since changing the GUIDs on each release&amp;nbsp;of an MSI is generally frowned upon.&lt;/p&gt; &lt;p&gt;To use it simply drop the three files into your WiX build directory and invoke it from a command line: &lt;strong&gt;bldWebWxs "path_to_root_of_webFolder_source" wxsFilename&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Hopefully, this will save you some time and get you most of the way there.&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=95251"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=95251" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jwatson/aggbug/95251.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>John Watson</dc:creator>
            <guid>http://geekswithblogs.net/jwatson/archive/2006/10/27/95251.aspx</guid>
            <pubDate>Fri, 27 Oct 2006 16:48:00 GMT</pubDate>
            <comments>http://geekswithblogs.net/jwatson/archive/2006/10/27/95251.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jwatson/comments/commentRss/95251.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jwatson/services/trackbacks/95251.aspx</trackback:ping>
        </item>
        <item>
            <title>WiX3 doesn't yet support COM+ installations - Oct 17, 2006</title>
            <link>http://geekswithblogs.net/jwatson/archive/2006/10/18/94420.aspx</link>
            <description>&lt;p&gt;I found out while trying to make a COM+ installation that &lt;a href="http://wix.sourceforge.net/" target="_blank"&gt;WiX3&lt;/a&gt; doesn't yet support this. I was working on it originally with the latest WiX2 drop and ran into some difficulties (my own doing it turns out). While troubleshooting, I thought I'd give the latest 3.0 drop a try just in case some bugs had been fixed.&lt;/p&gt; &lt;p&gt;After backing up my *.wxs files and running them through the new wixcop using the -f switch to upgrade the schemas I received compile errors around the pubca extensions. Looking around, I found there wasn't any binaries for this in the drop. My next approach was to browse the CVS repositories thinking maybe they just weren't included in the packaging yet. Nope.&lt;/p&gt; &lt;p&gt;I jumped on the &lt;a href="http://sourceforge.net/mailarchive/forum.php?forum_id=39929" target="_blank"&gt;wix-devs&lt;/a&gt; mailing list and asked about the missing pubca stuff in Wix3. Kudos to &lt;a href="http://blogs.msdn.com/robmen/" target="_blank"&gt;Rob Mensching&lt;/a&gt; who responded within 30 mins. with the answer...the pubca custom action stuff has yet to be merged into the WiX3 codebase. So...if you're doing COM+ stuff you'll have to stick with WiX2 for now.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=94420"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=94420" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/jwatson/aggbug/94420.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>John Watson</dc:creator>
            <guid>http://geekswithblogs.net/jwatson/archive/2006/10/18/94420.aspx</guid>
            <pubDate>Wed, 18 Oct 2006 13:57:00 GMT</pubDate>
            <comments>http://geekswithblogs.net/jwatson/archive/2006/10/18/94420.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jwatson/comments/commentRss/94420.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/jwatson/services/trackbacks/94420.aspx</trackback:ping>
        </item>
    </channel>
</rss>