{"id":2150,"date":"2009-03-08T09:08:39","date_gmt":"2009-03-08T13:08:39","guid":{"rendered":"http:\/\/www.hoogervorst.ca\/arthur\/?p=2150"},"modified":"2012-01-29T21:06:20","modified_gmt":"2012-01-30T01:06:20","slug":"ice-ice-maybe-part-2","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=2150","title":{"rendered":"Ice, Ice, Maybe (part 2)"},"content":{"rendered":"<p><span class=\"dropcap\">I<\/span> finally figured out why help is skimpy on <a href=\"wix.sourceforge.net\/\">Wix<\/a> (the Windows Installer XML toolkit): that&#8217;s mainly because the original designers of Wix <em>don&#8217;t want you to use Wix<\/a><\/em>. It&#8217;s that simple: Wix&#8217;s learning curve is so steep, I wouldn&#8217;t even recommend it if you&#8217;re not willing to spend time at it. Additionally, don&#8217;t bother looking for sample templates (that is if you can find them) or help for the cryptic warning and error messages.\n<\/p>\n<p>On the good side, there are a couple of good tutorials that should give you some leeway in your custom install script: There&#8217;s G\u00c3\u00a1bor DE\u00c3\u0081K JAHN&#8217;s <a href=\"http:\/\/www.tramontana.co.hu\/wix\/\">(excellent) basic tutorial on Wix<\/a>, which is probably the first site you should take a look at. Additionally, for more advanced application and use of Wix, you should probably check out <a href=\"http:\/\/blogs.technet.com\/alexshev\/pages\/from-msi-to-wix.aspx\">Alex Shevchuk&#8217;s pages<\/a>: his articles are highly technical and you may actually pick up some stuff regarding the inner workings of Microsoft&#8217;s Setup Installer SDK.\n<\/p>\n<p>Anyway: if you just figured out that you need to add an additional data directory to your application setup program and you ran into a roadblock of cryptic messages (don&#8217;t bother going in here if you&#8217;re not interested):\n<\/p>\n<p><!--more--><\/p>\n<p>The trick is simple according to the manual: Add an extra Directory entry in your main DirectoryRef tag. In the sample below, I decided to use the Local App Data folder as my main data directory (which is the preferred way in Windows XP\/Vista):<\/p>\n<ul>\n<li>In Wix, the User&#8217;s Local App folder is identified by the id &#8220;LocalAppDataFolder&#8221; (for a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa370905(VS.85).aspx#system_folder_properties\">complete list of SystemFolders you can use in Wix check out this MSDN article<\/a>).\n<li>Create another nested Directory entry inside of this with an arbitrary id (Uppercased) and the actual folder name.\n<li>Move the components and file entries in this nested directory (don&#8217;t forget to create GUIDs for them).\n<li>Add a CreateFolder entry (you can basically leave the name blank because it will take over the name you set in the parent&#8217;s entry.\n<li>Add a dummy RegistryValue entry (required).\n<li>Add a RemoveFolder entry and reference the LocalAppDataFolder  entry.\n<\/ul>\n<\/p>\n<p>Below is sample code how I did it for Convendro:\n<\/p>\n<p><PRE><br \/>\n&lt;Directory Id=&#8221;LocalAppDataFolder&#8221; Name=&#8221;LocalFiles&#8221;&gt;<br \/>\n\t&lt;Directory Id=&#8221;LOCALAPPFOLDER&#8221; Name=&#8221;Convendro&#8221;&gt;<br \/>\n\t    &lt;Component Id=&#8221;MyDataFiles&#8221;<br \/>\n\t\t\tGuid=&#8221;C0EAC254-0185-458B-98DD-DABFD8ABB2F1&#8243;<br \/>\n\t\t\tDiskId=&#8221;1&#8243;&gt;<br \/>\n\t\t\t&lt;File Id=&#8221;CommandsFile&#8221; Name=&#8221;cmddesc.xml&#8221;<br \/>\n\t\t\t\tSource=&#8221;..\\convendro\\bin\\Debug\\cmddesc.xml&#8221;\/&gt;<br \/>\n\t\t\t&lt;File Id=&#8221;PresetsFile&#8221; Name=&#8221;presetsdata.xml&#8221;<br \/>\n\t\t\t\tSource=&#8221;..\\convendro\\bin\\Debug\\presetsdata.xml&#8221;\/&gt;<br \/>\n\t\t\t&lt;File Id=&#8221;ReadmeFile&#8221; Name=&#8221;ReadMe.txt&#8221;<br \/>\n\t\t\t\tSource=&#8221;..\\convendro\\bin\\Debug\\ReadMe.txt&#8221;\/&gt;<br \/>\n\t    \t&lt;CreateFolder \/&gt;<br \/>\n\t\t\t&lt;RegistryValue Root=&#8217;HKCU&#8217;<br \/>\n\t\t\t\tKey=&#8217;SOFTWARE\\ArthurHoogervorst\\Convendro&#8217;<br \/>\n\t\t\t\t    Type=&#8217;string&#8217; Value=&#8217;INSTALLED&#8217;<br \/>\n\t\t\t\t\tKeyPath=&#8217;yes&#8217; \/&gt;<br \/>\n\t\t   \t&lt;RemoveFolder Id=&#8221;LocalAppDataFolder&#8221;<br \/>\n\t\t\t\tOn=&#8221;uninstall&#8221; \/&gt;<br \/>\n\t\t&lt;\/Component&gt;<br \/>\n\t&lt;\/Directory&gt;<br \/>\n&lt;\/Directory&gt;<br \/>\n<\/PRE><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I finally figured out why help is skimpy on Wix (the Windows Installer XML toolkit): that&#8217;s mainly because the original designers of Wix don&#8217;t want you to use Wix. It&#8217;s that simple: Wix&#8217;s learning curve is so steep, I wouldn&#8217;t &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=2150\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[56,375,376],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/2150"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2150"}],"version-history":[{"count":0,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/2150\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2150"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}