Old 28th April 2018, 14:14   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
nsProcess

I'm (again) in trouble...

I've dowloaded and installed this plugin.
The files are in the right place:

nsProcess.dll in Plugins/x86-ansi
nsProcess.nsh in Include

I try to execute the example .nsi file but exit error:

Plugin not found

What'appened? (I had same error with registry.dll, but then I missed Include.nsh in my code... Now the code is written from the programmer!).

I want only find notepad.exe, and close it in my processes and discard the other code.
Could you help me to clean the original sample?

Following the ORIGINAL CODE:







Name "nsProcessTest"
OutFile "nsProcessTest.exe"



Var RADIOBUTTON

Page components
Page instfiles


Section "Find process" FindProcess
${nsProcess::FindProcess} "Calc.exe" $R0
MessageBox MB_OK "nsProcess::FindProcess$\n$\n\
Errorlevel: [$R0]"

${nsProcess::Unload}
SectionEnd


Section /o "Kill process" KillProcess
loop:
${nsProcess::FindProcess} "NoTePad.exe" $R0
StrCmp $R0 0 0 +2
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'Close "notepad" before continue' IDOK loop IDCANCEL end

${nsProcess::KillProcess} "NoTePad.exe" $R0
MessageBox MB_OK "nsProcess::KillProcess$\n$\n\
Errorlevel: [$R0]"

Exec "notepad.exe"
Exec "notepad.exe"
Exec "notepad.exe"
BringToFront
MessageBox MB_OK "Press OK and 3 notepad's windows will be closed"

${nsProcess::KillProcess} "NoTePad.exe" $R0
MessageBox MB_OK "nsProcess::KillProcess$\n$\n\
Errorlevel: [$R0]"

end:
${nsProcess::Unload}
SectionEnd


Function .onInit
StrCpy $RADIOBUTTON ${FindProcess}
FunctionEnd

Function .onSelChange
!insertmacro StartRadioButtons $RADIOBUTTON
!insertmacro RadioButton ${FindProcess}
!insertmacro RadioButton ${KillProcess}
!insertmacro EndRadioButtons
FunctionEnd


Thanks
Gluck is offline   Reply With Quote
Old 29th April 2018, 03:32   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,913
Post the exact error message.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th April 2018, 09:16   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
I HAVE UNDERSTOOD!!!!! (Perepè, Perepè, perepè!).

Was the same defect of last plugin...
To resolve this trouble I have to restart the computer, not only NSIS.
After restart, everything works fine!
Gluck is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump