title: WIX: Where and how should my CustomAction create and read a temporary file?
body: <p>I have a script CustomAction (Yes, I know all about the opinions that say <em>don't use script CustomActions</em>. I have a different opinion.) </p>
  
  <p>I'd like to run a command, and capture the output.  I can do this using the WScript.Shell COM object, then invoking <code>shell.Exec()</code>. But, this flashes a visible console window for the executed command. </p>
  
  <p>To avoid that, I understand I can use the <code>shell.Run()</code> call, and specify "hidden" for the window appearance. But <code>.Run()</code> doesn't give me access to the StdOut of the executed process, so that means I'd need to create a temporary file and redirect the exe output to the temp file, then later read that temp file in script. </p>
  
  <p>Some questions:   </p>
  
  <ul>
  <li><p>is this gonna work?   </p></li>
  <li><p>How do I generate a name for the temporary file?  In .NET I could use a static method in the System.IO namespace, but I am using script here. I need to insure that the use has RW access, and also that no anti-virus program is going to puke on this.    </p></li>
  <li><p>Better ideas?  I am trying very hard to avoid C/C++.   </p></li>
  </ul>
  
  <hr>
  
  <p>I could avoid all this if there were a way to query websites in IIS7 from script, without resorting to the IIS6 Compatibility pack, without using .NET (<a href="http://msdn.microsoft.com/en-us/library/microsoft.web.administration.servermanager%28VS.90%29.aspx" rel="nofollow noreferrer">Microsoft.Web.Administration.ServerManager</a>), and without execing a process (<a href="http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe" rel="nofollow noreferrer">appcmd list sites</a>). 
  I already asked <a href="https://stackoverflow.com/questions/5370288">a separate question on that topic</a>; any suggestions on that would also be appreciated. </p>