title: How to make NSIS create a file in an %APPDATA% of another user?
body: <p>I wrote an NSIS installer script for postgresql 9.1. The installer works properly, but after the reboot, the service is not started (right after the install, the database started properly though)</p>
  
  <p>I guess this is because the postgres service user has no pgpass.conf file in its %APPDATA%. As far as I understand my install script, the pgpass.conf file is added to the %APPDATA% of the user running the installer (an administrator account in my case). This will not help.</p>
  
  <p>I tried the following, to add the pgpass.conf to all users, bt I guess this adds it to a kind of wildcard, not to the %APPDATA% of each user :</p>
  
  <pre><code>SetShellVarContext "all"
  SetOutPath "$APPDATA\postgresql"
  File config\pgpass.conf
  SetShellVarContext "current"
  SetOutPath "$APPDATA\postgresql"
  File config\pgpass.conf
  </code></pre>
  
  <p>I couldn't find the macro name for c:/Users/postgres in the documentation. This could be a way to achieve it. But with WindowsXP, 7, I wish I need a portable way to address the /Users directory.</p>
  
  <p>I wish I could use something like SetShellVarContext "postgres", and then have NSIS write the pgpass.conf file in c:\Users\postgres\AppData\postgresql.</p>
  
  <p>Is there a way to do this ?</p>
  
  <p>Thnk you !</p>