0

Newbee in NSIS, I was trying to implement the nsProcess plugin to check whether the current application is working or not ! I was successful in implementing the same in an example code, but when i tried implementing the same in my project i am getting an un expected output as shown in the Image message box below !! why am i getting this ?? please can anyone guide me. Thanks for the help in advance :)

Project Snipet!

  !include "MUI2.nsh"
      ;!include "MUI.nsh"
      !include LogicLib.nsh
      !include "StrFunc.nsh"
      !include "FileFunc.nsh"
      !include WinMessages.nsh
      !include "nsProcess.nsh"
      ;!include "FindProcess.nsh"

      #Dummy Section
      ...
    #EndSecton


!macro CheckAppRunning_ _FILE _ERR

   App_Running_Check:
   ${nsProcess::FindProcess} "MyApp.exe" $R0
    MessageBox MB_OK "$R0"
   ${If} $R0 == 0
      MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Please stop App.exe before continuing" /SD IDCANCEL IDRETRY App_Running_Check
      Quit
   ${EndIf} 

notRunning:
!macroend

Function .onInit
    !insertmacro CheckAppRunning_ `MyApp.exe` $R0   
FunctionEnd

enter image description here

$R0 returns this value!!! why ???

faisal
  • 53
  • 1
  • 9

1 Answers1

1

This is most likely a ANSI vs Unicode compiler/plug-in mismatch.

If you are using NSIS v2 then you need to extract the correct plug-in version from the .zip (ANSI unless you are using a 3rd-party NSIS fork) into the plugin folder. If you are using NSIS v3 then there is a plug-in subfolder for each type, make sure you put the correct plug-in in each subfolder. The Unicode plug-in .dll is often in a Unicode subfolder or has a 'W' suffix in the filename in the .zip archive.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Hey Anders! Thanks for the reply. But how is it working fine when implemented separately in an example (http://nsis.sourceforge.net/NsProcess_plugin ) as i have only one version (NSIS 3.01) installed – faisal Apr 20 '17 at 11:01
  • One .nsi script might contain `Unicode true` while the other says false or not present. Hard to say because you did not post your complete code! – Anders Apr 20 '17 at 11:12
  • Hey Anders, Thanks a lot, the problem was with Unicode flag! Thanks again. – faisal Apr 20 '17 at 11:24