mIRC Home    About    Download    Register    News    Help

Print Thread
#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.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks this issue has been fixed for the next version.

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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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?

Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Win7 64bits


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.
Joined: Jul 2014
Posts: 308
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 308
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 (Co-Admin)
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2014
Posts: 308
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 308
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 (Co-Admin)
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Link Copied to Clipboard