View Full Version : Mutex name of Ninjatrader Application.
poojakrishna
04-01-2010, 10:47 AM
Hi,
I need to know the mutex name of Ninjatrader application to specify on the installer code of indicator. I'm using Inno setup script to prepare the installer.
I need to specify the mutex name to prevent the user from installing indicator or new versions of inducator while Ninjatarder is running.
Please help.
Regards,
Pooja Krishna.
NinjaTrader_Bertrand
04-01-2010, 12:13 PM
Pooja Krishna, welcome to our forums - unfortunately we would not know what that is exactly, could you perhaps clarify your request for us?
Thanks
poojakrishna
04-01-2010, 08:43 PM
Bertrand,
Thanks. I'm using Inno script to create the Installer for a NinjaTrader indicator as it has a custom DLL to manage license.
I want to ask user to exit NinjaTrader before installing or uninstalling the Indicator, the straight forward way to do so in inno script is to specify the mutex name of the application. I have work arounds here, if NinjaTrader has no Mutex name.
Plesae see the following link describing mutex usage with Inno script:
http://www.innosetup.com/ishelp/topic_setup_appmutex.htm
NinjaTrader_Bertrand
04-02-2010, 05:07 AM
Thanks for clarifying, unfortunately we would not know - would the PID in this context help you also?
http://www.visualbasicscript.com/tm.aspx?high=&m=82034&mpage=1#82034
poojakrishna
04-02-2010, 08:52 AM
Thanks for the support.
I will check the existance with the PID or Window name with class.
poojakrishna
04-02-2010, 10:47 AM
I have used the following code to find the existance of NinjaTrader in my Inno script.
function NextButtonClick(CurPageID: Integer): Boolean;
var
NTWin: HWND;
begin
NTWin:= FindWindowByClassName('WindowsForms10.Window.8.app .0.378734a');
if NTWin<> 0 then
begin
Msgbox('The installer has detected that Ninjatrader is currently running.'+#13+'Please close all instances of NinjaTrader now, then click Next to continue, or Cancel to exit the Installer." ', mbError, MB_OK);
Result := FALSE;
end;
end;
NinjaTrader_Bertrand
04-02-2010, 10:48 AM
Great, thanks for posting your solution here!