Old 15th August 2015, 00:23   #1
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 342
Question 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 is offline   Reply With Quote
Old 15th August 2015, 08:26   #2
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 342
i can use from this code (But):

PHP Code:
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
r2du-soft is offline   Reply With Quote
Old 15th August 2015, 10:50   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th August 2015, 11:35   #4
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 342
thanks mr for help,solve problem...
whit this code if use rename exe file and run again,if application running then not again run..

PHP Code:
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 ?
r2du-soft is offline   Reply With Quote
Old 15th August 2015, 12:44   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
Use CreateMutex, not CreateMutexA. Please use a generated GUID and not a simple string like myMutex!

IntOp $PostCount $PostCount + 1
Anders 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