Archive: FindProc usign MUI


FindProc usign MUI
Hello,

I'm trying to check if notepad.exe is running.

in .onInit, i call the macro, but allways show that "Is not Running". Do you know what can be the problem? I compile in Unicode. Maybe can be a path problem?

Function .onInit
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_LANGDLL_DISPLAY
!insertmacro CHECK_NOTEPAD_RUNNING
FunctionEnd

!macro CHECK_NOTEPAD_RUNNING
FindProcDLL::FindProc "notepad.exe"
StrCmp $R0 "1" found not_found
found:
MessageBox MB_ICONEXCLAMATION|MB_OK "Is running" Abort
not_found:
MessageBox MB_ICONEXCLAMATION|MB_OK "Is Not Running"
!macroEnd

Thanks,

Rafa


It seems to be case sensetive (major bug)

on my system:
FindProcDLL::FindProc "Notepad.exe"
MessageBox mb_ok $R0 >> 1

FindProcDLL::FindProc "notepad.exe"
MessageBox mb_ok $R0 >> 0


Hello Anders,

I'm sorry, it is doesnt work. I attach an small project, just to test that. Please may you test if it is works in your case? In my case never is running the program.

I'm crazy finding the solution. But maybe is a problem becuase I'm using Unicode compiler, but in theory it doesnt affect, but...

Thanks,

Rafa


I was using the size optimized version from http://nsis.sourceforge.net/FindProcDLL_plug-in , the other one seems to work fine (http://nsis.sourceforge.net/mediawik...c/FindProc.zip)

So, use the 24k version

You should also consider using the LogicLib so you can write code like:

!include LogicLib.nsh
FindProcDLL::FindProc "notepad.exe"
${If} $R0 == 1
MessageBox mb_ok "foo"
quit
${Else}
MessageBox mb_ok "bar"
${EndIf}


Thanks for your quick answer.

I compile again the vc++ project and I replace all the old DLL. I changed the code and LogicLib is included. Please, may you test if works in your computer? Im testing here in two and doesn't works, always msg "bar".

Thanks,


Why do you have to compile yourself? the large dll on the wiki works fine for me


I compliled becuase with the official DLL doesn't works. Now I see that is not a problem of the DLL. Are you running on Vista?


nope, XP SP2 MCE2k5UR2/IE6


I've also had some problems with FindProcDLL on Vista, you might want to check out the Processes Plugin. It seems to work pretty well on Vista. I am not sure if it will solve your case sensitive problem though, but it may be worth a shot.


Hi,

I test also and it doesn't work. Do you think that works in nsis unicode can be the problem?

Please, may you compile and test if it detect correctly?

Thanks for the help.

Rafa