mIRC Home    About    Download    Register    News    Help

Print Thread
7.57 //exit -nr bug #265832 03/08/19 12:32 AM
Joined: Oct 2014
Posts: 17
D
drowsy Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Oct 2014
Posts: 17
//exit -nr

Doesn't reboot the client anymore.

Re: 7.57 //exit -nr bug [Re: drowsy] #265834 03/08/19 09:33 AM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
Thanks this issue has been fixed for the next version.

Re: 7.57 //exit -nr bug #265868 08/08/19 10:59 AM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
/exit -nr is not restarting mIRC for me, tested on a clean install of the latest beta.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: 7.57 //exit -nr bug [Re: Wims] #265869 08/08/19 11:10 AM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
Hmm. I am no longer able to reproduce this issue in the beta. When I use /exit -nr, it exits and restarts.

Which version of Windows are you using?

Re: 7.57 //exit -nr bug [Re: Khaled] #265870 08/08/19 11:18 AM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
Win7 64bits


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: 7.57 //exit -nr bug [Re: Wims] #265871 08/08/19 11:45 AM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
If you use //run $mircexe, /url to open a link, or open Received files via the Tools menu, do these work?

Update: I installed Windows 7 to test this out and /exit -nr is working for me with the latest beta. Is it possible that something is interfering with the beta, eg. anti-virus software?

Last edited by Khaled; 08/08/19 01:17 PM.
Re: 7.57 //exit -nr bug [Re: Khaled] #265874 08/08/19 06:27 PM
Joined: Jul 2014
Posts: 126
Tiago Offline
Vogon poet
Offline
Vogon poet
Joined: Jul 2014
Posts: 126
I also tested in the last beta and it didn't work.

OS: Win10 Pro build 1903

I have this little code that has the same effect, but in mIRC version 7.55 it works, and in the last beta it doesn't work.

Code
restart {
  .run " $+ $mircexe $+ "
  !exit
}

Last edited by Tiago; 08/08/19 06:33 PM.

TECO
irc.PTirc.org (IRCop)
Re: 7.57 //exit -nr bug [Re: Khaled] #265875 08/08/19 06:57 PM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
No, my test are all done with AV software disabled temporarily.

//run $mircexe from that clean install works as expected, "/url google.com" didn't work, but "/url www.google.com" did work. Opening received files also works.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: 7.57 //exit -nr bug [Re: Wims] #265878 09/08/19 08:22 AM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
Thanks for the feedback.

Another issue I noticed with the 7.57 and the beta is that ShellExecuteEx() no longer reports errors because it is running asynchonously. So while "/run nosuchfile.exe" used to report errors, it does not in 7.57 or the beta. This also affects the way URLs are opened because mIRC needs to detect if an error was reported in order to try alternative methods under different versions of Windows.

I have tested out various combinations of flags with ShellExecuteEx() and unfortunately the only flag that seems to resolve the original issue and the current issues with /run, /exit -nr, /url, etc. in all of the various contexts, including error reporting, is the deprecated flag SEE_MASK_FLAG_DDEWAIT.

I have tested the change under XP, 7, and 10 and it seems to be working correctly for me in all of these contexts but we will need to see how it works for everyone in the next beta.

Re: 7.57 //exit -nr bug [Re: Khaled] #265887 09/08/19 06:58 PM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
Quote
I have tested the change under XP, 7, and 10 and it seems to be working correctly for me in all of these contexts but we will need to see how it works for everyone in the next beta.

The above solution is not working as expected.

To prevent /run from triggering windows messages during script events, it has to be asynchronous (which also prevents error reporting). But to make /run work during /exit -nr or with calling /exit right after it, it needs to be synchronous.

The ShellExecute()/ShellExecuteEx() APIs are used in many ways, from opening folders, opening default file associations, opening URL protocols, running applications, etc., some of which also need to detect errors, so it's difficult to see a way around the original issue without breaking other features.

At this point, I cannot see a viable solution, so I will be reverting all changes relating to this issue to v7.56.

Re: 7.57 //exit -nr bug [Re: Khaled] #265903 11/08/19 10:25 AM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
Just in case, I just realized that I extracted the new beta to C:\ instead of C:\mIRC\, so I was still using the 528 beta.

/exit -nr works on the lastest beta, as well as /url and opening Tools > received files


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: 7.57 //exit -nr bug [Re: Wims] #265913 13/08/19 07:04 PM
Joined: Jul 2014
Posts: 126
Tiago Offline
Vogon poet
Offline
Vogon poet
Joined: Jul 2014
Posts: 126
I use the latest beta version of mIRC 7.57.669 and the /exit -nr command does not work. mIRC shuts down but then does not restart. But I've also tried removing my entire script from the C:\mIRC folder and putting only pure mIRC, and then the /exit -nr command already works and mIRC shuts down and restarts. But I have nothing in my script that prevents mIRC from restarting.


TECO
irc.PTirc.org (IRCop)
Re: 7.57 //exit -nr bug [Re: Tiago] #265914 13/08/19 07:57 PM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
When it was not working, it was also closing, but not rerunning itself, which seems to be only a /run call.
Just tested again and it works with the same install, files and folders in the mircdir.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: 7.57 //exit -nr bug [Re: Wims] #265932 17/08/19 12:53 PM
Joined: Dec 2002
Posts: 4,578
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,578
Quote
When it was not working, it was also closing, but not rerunning itself, which seems to be only a /run call.
Just tested again and it works with the same install, files and folders in the mircdir.

The only solution that would resolve this thread's issue and the original post issue would be to make ShellExecuteEx() asynchronous and to add a small delay after /run or /url to allow the external process to begin. This would ensure that an immediate exit after /run or /url would still allow them to work.

However, the asynchronous method would also prevent /run from reporting an error. If everyone is happy with /run no longer reporting errors if an application cannot be run, I can make this change in the next beta.

Update: Actually, I think this change should be made due to the effect that using /run or /url in a remote script can have. This change will be in the next beta.

Last edited by Khaled; 17/08/19 01:25 PM.