Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix How do Directories work?

I'm trying to build a WIX installer, which allows the user to specify the install path through command line arguments.

<Property Id="IISROOTPATH">
   <RegistrySearch Id="FindInetPubFolder" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Name="PathWWWRoot" Type="directory" />
</Property>    
...
<Directory Id="TARGETDIR" Name="SourceDir">
   <Directory Id="IISROOTPATH">
      <Directory Id="INSTALLPATH" Name="WebsiteFolder">
...

If the user doesn't pass in any arguments, it will look up registry for the iisroot folder, and install the files under a folder called "WebsiteFolder"

But in order for the user to change the install path, they must pass in an absolute path eg

INSTALLPATH="C:\InetPub\wwwroot\CustomWebsiteFolder"
  1. How does this work? does it then ignore the other Directory elements TARGETDIR and IISROOTPATH?

  2. How can I change INSTALLPATH to just WEBSITEFOLDERNAME so the user is only required to pass in the folder name rather than the absolute install path. Thus forcing the user to always install into inetpub?

like image 490
EdmundYeung99 Avatar asked Jul 06 '11 20:07

EdmundYeung99


1 Answers

You should understand the Directory table - the MSI concept behind the Directory element. The best explanation I've ever met is a set of Rob's articles (the link is to the part 1, there are 6 parts, if I remember correctly).

like image 137
Yan Sklyarenko Avatar answered Nov 15 '22 11:11

Yan Sklyarenko