title: Nsis temp folder
body: <pre><code>Function .onInit
  DetailPrint "Temp folder - $TEMP"
  System::Call 'Kernel32::GetTempFileName(t $TEMP, t "tmp", i 0, t.r0) i.r1 
  DetailPrint "Temp folder name - $0" //$0  gives empty string
  FunctionEnd
  </code></pre>
  
  <p>When I call <code>Kernel32::GetTempFileName</code> in <code>.onInit</code> function i retrieves an empty file name. But when i call it from section everything is ok!</p>
  
  <p>Can you explain me why?</p>