title: Wix Read and Write Network Service
body: <p>I've been trying to get my .msi to install a service on my machine. I used exe4j to make my Java code, archived in .jar file, for it to be held in a .exe file. The service needs to have privileges to read and write across networks. I managed to get it all working except that the service hasn't got read and write privileges when account is set to 'NT AUTHORITY\NetworkService' in the ServiceInstall element.</p>
  
  <pre><code>public static void main(String[] args)
  {
      try
      {
          MainService instance = new MainService();
          instance.processArgs(args);
          watcher.run();
      }
      catch(Exception e)
      {
          error(e.getMessage());          
          e.printStackTrace();
      }
      System.exit(1);   // only get here after an exception
  }
  </code></pre>
  
  <p>This is some of my WiX code</p>
  
  <pre><code>&lt;File Name="tService.exe" Source="tService.exe" KeyPath="yes" /&gt;
  
  &lt;ServiceInstall Id="ServiceID" Description="Copies assets" ErrorControl="normal" Name="tService" Start="demand" Interactive="no" Type="ownProcess" Account="NT AUTHORITY\NetworkService" /&gt;
  
  &lt;ServiceControl Id="StartService" Stop="both" Remove="uninstall" Name="InterConnectService" Wait="yes" /&gt;
  </code></pre>
  
  <p>What Account do I need or how could I get Read and Write privileges with my service? I want the .msi file to install the service with these read and write privileges. I don't want to start creating accounts manually.</p>
  
  <h1>Update:</h1>
  
  <p>'NetworkService' just fails at installation time with the msi "Service ... could not be installed. verify that you have sufficient privileges to install system services". When I use 'NT AUTHORITY\NetworkService' the installation process works fine. However with 'NT AUTHORITY\NetworkService' I cannot read or write across networks.</p>
  
  <p>Any ideas how I could read and write across networks? Your responses are much appreciated.</p>