Old 23rd October 2009, 15:54   #1
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
Problem with the plug-in processes

I had a strange situation. I'm using the plug-in processes to find out whether the application that I want to install or uninstall is currently running. Let's imagine that my application is named ApplicationName.exe and my installer - SetupApplicationName.exe.
Before to preform installation I use in my code the following line:
Processes::FindProcess "ApplicationName"
I'm sure that the ApplicationName.exe is not running, but I always get result "1" that means running application. When I rename my installer to Setup.exe instead of SetupApplicationName.exe, everything works just fine. Is it possible that the plug-in recognizes wrongly the process, because the installer's executable contains in his name the name of the installed application?
Please, give me advice how to solve this problem...
TrifonovS is offline   Reply With Quote
Old 23rd October 2009, 16:00   #2
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
Interesting, my first thought is that the plugin is seeing the "ApplicationName" at the end of the "SetupApplicationName". If this is indeed true then it would be a definite bug in the plugin.

Try renaming the Setup exe and try again to test the theory. It's my Birthday and frankly I'm going to lazy and not test it myself :P
Zinthose is offline   Reply With Quote
Old 23rd October 2009, 19:48   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
What is the displayed name of the installer? The one defined by the Name command.
MSG is offline   Reply With Quote
Old 25th October 2009, 16:37   #4
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
The name of the installer is the same like the installed application - ApplicationName. Is it a problem?
TrifonovS is offline   Reply With Quote
Old 25th October 2009, 18:28   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Well it shouldn't be a problem, seeing how renaming the installer exe solves the problem... But it might be relevant to finding the cause of the bug, so I just thought I'd ask. Does using a different Name have any effect?
MSG is offline   Reply With Quote
Old 26th October 2009, 05:36   #6
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
No, the name doesn't change anything. I have made several installers. Some of them have the same name like the installed application, but some of them not. The problem always exists. I made some further tests. I renamed the installer's executable to SetupApplicationName1.exe. I still have the mentioned problem. But if I change only one letter from ApplicationName than everything works fine. It really looks like a bug. Can you advice me how to solve my problem (with some kind of workaround or another plug-in), because I can not wait until somebody fixes the bug. I will try now to use the plug-in FindProcDll. From it's description it looks that it makes the same (and I hope that the same bug is not inside )...
TrifonovS is offline   Reply With Quote
Old 26th October 2009, 07:45   #7
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
Now I can make a concussion. There is a bug in Processes.dll. When I look in the source I see the following code on line 143:
if( NULL != strstr( szCurrentProcessName, szProcessName ) )
The function strstr() makes this behavior. It searches for a sub-string in a string. I think that the function strcmp() must be used instead of it, then everything will be ok. By the way, I used FindProcDll plug-in and I don't have such a problem with it. It work fine with nsProcess plug-in too.

Last edited by TrifonovS; 26th October 2009 at 08:58.
TrifonovS 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