title: NSIS - Variable is not resolving properly
body: <p>I'm trying to check the version of folder with !define variable from compiler.nsh. On mismatch of version, I'm trying to update compiler.nsh with ReplaceInFile macro. But the Filepath I have provided on the ReplaceInFile macro is not resolving variable ${CURRENT_KIT}. Am I missing something? Please help</p>
  <pre><code>;***************************************************************************************
  ; Version Check 
  ;***************************************************************************************
  Var /GLOBAL CURRENT_KIT
  Var /GLOBAL CURRENT_VER
  
  
  ;Function CompilerFile
  Section 
      System::Call &quot;kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)&quot;
  
      ${WordFind} &quot;$0&quot; &quot;\&quot; &quot;-1&quot; &quot;$CURRENT_KIT&quot;
      ${CharStrip} &quot;${APP_CLASSKIT}&quot;  &quot;$CURRENT_KIT&quot; &quot;$CURRENT_VER&quot;
      
      Push &quot;$CURRENT_VER&quot;
      Push &quot;${CHK_VERSION}&quot;
      Call VersionCheck
      Pop $0
      
      ${If} $0 == 0
      MessageBox MB_OK &quot;Kit Version matches compiler.nsh&quot;
      !define APP_VERSION &quot;${CHK_VERSION}&quot;
      ${ElseIf} $0 == 1
          !insertmacro _ReplaceInFile **&quot;${NETWORK_PATH}\${CURRENT_KIT}\compiler.nsh&quot;** '!define CHK_VERSION &quot;${CHK_VERSION}&quot;' '!define APP_VERSION &quot;$CURRENT_VER&quot;'
  
      ${EndIf}
  </code></pre>