NSIS:NsProcess意外的输出 [英] NSIS : NsProcess UnExpected Output

查看:73
本文介绍了NSIS:NsProcess意外的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NSIS中的Newbee,我试图实现nsProcess插件来检查当前应用程序是否正常运行!我成功地在示例代码中实现了相同的功能,但是当我尝试在项目中实现相同的功能时,却得到了无法预期的输出,如下面的图像消息框中所示!我为什么要得到这个?请任何人可以指导我.感谢您的提前帮助:)

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 :)

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

$ R0返回该值!!!为什么???

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

推荐答案

这很可能是ANSI vs Unicode编译器/插件不匹配.

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

如果您使用的是NSIS v2,则需要从.zip(除非您使用的是第三方NSIS分支)中将正确的插件版本解压缩到plugin文件夹中.如果您使用的是NSIS v3,则每种类型都有一个插件子文件夹,请确保在每个子文件夹中都放置了正确的插件.Unicode插件.dll通常位于Unicode子文件夹中,或者.zip存档中的文件名中带有"W"后缀.

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.

这篇关于NSIS:NsProcess意外的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆