Skip to content
⌘ NSIS Forum Archive

Set exe file process name

5 posts

r2du-soft#

Set exe file process name

how can set a default process name for created installer app?
for example my exe file name is example.exe now when i open that see a process name with my exe name in between process...
i want set a default name (for example: AppTone) for that exe and when open example.exe i see AppTone.exe in in between process...
this is possible with nsis?
thanks
r2du-soft#
i can use from this code (But):

Function .onInit
FindProcDLL::FindProc "$EXEFILE"
IntCmp $R0 1 Close Continue
Close:
MessageBox MB_OK|MB_ICONINFORMATION "Application Is Run!"
Quit
Continue:
FunctionEnd 

but if user rename application and open again that,application run again...
i need default name set for application...
thanks
Anders#
Are you just making up concepts now? There is no such thing as a default process name.

If you only want one instance then you can use a mutex...
r2du-soft#
thanks mr for help,solve problem...
whit this code if use rename exe file and run again,if application running then not again run..

Function .onInit
   System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
  pop $0
  StrCmp $0 183 0 +3
    MessageBox MB_OK "installer already running"
    Abort
  StrCmp $0 0 done
    MessageBox MB_OK "error creating mutex, getlasterror didn't return success"
  done:  
FunctionEnd 

mutex run in all windows xp,7,...,10 x64.x86 ?
Anders#
Use CreateMutex, not CreateMutexA. Please use a generated GUID and not a simple string like myMutex!