- NSIS Discussion
- FindProc usign MUI
Archive: FindProc usign MUI
rafaeldmt
3rd December 2007 10:57 UTC
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
Anders
3rd December 2007 11:10 UTC
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
rafaeldmt
3rd December 2007 11:22 UTC
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
Anders
3rd December 2007 11:31 UTC
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}
rafaeldmt
3rd December 2007 12:10 UTC
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,
Anders
3rd December 2007 12:19 UTC
Why do you have to compile yourself? the large dll on the wiki works fine for me
rafaeldmt
3rd December 2007 12:34 UTC
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?
Anders
3rd December 2007 12:42 UTC
nope, XP SP2 MCE2k5UR2/IE6
Fightin_Foo
3rd December 2007 15:12 UTC
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.
rafaeldmt
3rd December 2007 19:56 UTC
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