title: Nullsoft Installer (NSIS) Get Value and save to file
body: <p>am working on an installer for specific tinc-vpn installations. I need to have nullsoft installer ask me for two things:</p>
  
  <ol>
  <li>The VPN address</li>
  <li>The name of the computer on the VPN network.</li>
  </ol>
  
  <p>These values will be written to text files by the installer (that's a later step).</p>
  
  <p>for now, I am trying to figure out how to access the vars once they have been put in.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code> !include LogicLib.nsh
   !include nsDialogs.nsh
  
   Name nsDialogs
   OutFile nsDialogs.exe
  
   XPStyle on
  
   Var Dialog
   Var Label1
   Var Label2
   Var IPAddr
   Var VPNName
  
   Page custom nsDialogsPage nsDialogsPageLeave
   Page instfiles
  
   Function nsDialogsPage
  nsDialogs::Create 1018
  Pop $Dialog
  
  ${If} $Dialog == error
      Abort
  ${EndIf}
  
  ${NSD_CreateLabel} 0 0 100% 12u "What's Your IP Address on the VPN?"
  Pop $Label1
  
  ${NSD_CreateText} 0 12u 100% 12u ""
  Pop $IPAddr
  
  ${NSD_CreateLabel} 0 24u 100% 12u "What's Your IP Address on the VPN?"
  Pop $Label2
  
  ${NSD_CreateText} 0 36u 100% 12u ""
  Pop $VPNName
  
  nsDialogs::Show
  
   FunctionEnd
  
   Function nsDialogsPageLeave
  ${NSD_GetText} $VPNName $0
  DetailPrint "VPN Name: $0"
   Function End
  
   Section
  
   SectionEnd
  </code></pre>
  
  <p>This, of course, fails in the compiler. Does anyone know how to make this work? I just want to do something simple: prompt for a text value, then store that text value in a text file, and copy that file to a desination...</p>