When using WiX, what should I supply for INSTALLDIR if I'm installing a Windows exe and a Web App?

StackOverflow https://stackoverflow.com/questions/23297011

  •  09-07-2023
  •  | 
  •  

Question

My solution consists of a Web application, hosting a web service, and a Windows Forms client that communicates with that web service. The windows client is expected to run on the same machine as the web service, while remote clients access the web service via HTTP as per usual.

The installer I wish to write is to install the Web Application under \InetPub\wwwroot\MyWebApp while the Windows Forms client goes into \Program Files\MyWindowsClient.

I'm getting stumped on what to specify for the INSTALLDIR directory; I barely understand what its purpose is, given the presence of TARGETDIR (as a side note: why does the Name attribute of the TARGETDIR directory element have the value "SourceDir"? Convention? Magic value expected by Windows Installer?) My attempt at the WiX directory structure is:

<Directory Id="TARGETDIR" Name="SourceDir">
  <!-- Put stuff in Inetpub on the fattest drive.
       But what happens if user wants to override? -->
  <Directory Id="INETPUB" Name="Inetpub"> 
     <Directory Id="WwwRoot" Name="wwwroot">
       <Directory Id="INSTALLDIR" Name="MyWebService" />
     </Directory>
  </Directory>
  <Directory Id="ProgramFilesFolder">
     <Directory Id="??INSTALLDIR?? " Name="MyWindowsClient" />
  </Directory>
</Directory>

I guess my issue boils down to not understanding what the difference between the public properties TARGETDIR and INSTALLDIR, and whether or not I'm allowed to install two binaries in widely disparate places.

Was it helpful?

Solution

Generally I do something like:

[ProgramFilesFolder]Company\Product
[ProgramFilesFolder]Company\Product\WebSite

I put the win app exe in the product folder and the IIS content under Website. I'd then create another website and/or virtual directory in IIS and configure the document directory to point to the websites folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top