mIRC Homepage

7.57 //exit -nr bug

Posted By: drowsy

7.57 //exit -nr bug - 03/08/19 12:32 AM

//exit -nr

Doesn't reboot the client anymore.
Posted By: Khaled

Re: 7.57 //exit -nr bug - 03/08/19 09:33 AM

Thanks this issue has been fixed for the next version.
Posted By: Wims

Re: 7.57 //exit -nr bug - 08/08/19 10:59 AM

/exit -nr is not restarting mIRC for me, tested on a clean install of the latest beta.
Posted By: Khaled

Re: 7.57 //exit -nr bug - 08/08/19 11:10 AM

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?
Posted By: Wims

Re: 7.57 //exit -nr bug - 08/08/19 11:18 AM

Win7 64bits
Posted By: Khaled

Re: 7.57 //exit -nr bug - 08/08/19 11:45 AM

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?
Posted By: TECO

Re: 7.57 //exit -nr bug - 08/08/19 06:27 PM

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
}
Posted By: Wims

Re: 7.57 //exit -nr bug - 08/08/19 06:57 PM

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.
Posted By: Khaled

Re: 7.57 //exit -nr bug - 09/08/19 08:22 AM

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.
Posted By: Khaled

Re: 7.57 //exit -nr bug - 09/08/19 06:58 PM

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.
Posted By: Wims

Re: 7.57 //exit -nr bug - 11/08/19 10:25 AM

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
Posted By: TECO

Re: 7.57 //exit -nr bug - 13/08/19 07:04 PM

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.
Posted By: Wims

Re: 7.57 //exit -nr bug - 13/08/19 07:57 PM

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.
Posted By: Khaled

Re: 7.57 //exit -nr bug - 17/08/19 12:53 PM

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.
© 2020 mIRC Discussion Forums