Old 29th March 2011, 09:43   #1
macbeth8
Junior Member
 
Join Date: Mar 2011
Posts: 1
Question ExecDos and cancel/close (x) buttons

Hello everyone,

Is it somehow possible to terminate the thread created by ExecDos::exec when the user clicks on the cancel button?

I am using ExecDos::exec to run a perl script that installs some packages from CPAN and displays the progress from console in a multi-line text window. Since the installation can take several minutes, I would like to give the user the opportunity to stop the installation.

I can disable next, back and cancel buttons, but weird things happen also when I use the 'x' in the corner of the installer to close it (and I think that some users might try that if all the other buttons are disabled).

I was also thinking about creating a separate installer for the CPAN packages installation, is there any other function that respects the cancel button? (I've looked at nsExec documentation but haven't found anything useful yet)

Thank you for any suggestions.
macbeth8 is offline   Reply With Quote
Old 29th March 2011, 14:22   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Stopping in the middle of a Perl script? Is that a good idea? Also why isn't the X button disabled? You're not running your script in a section? This is generally bad practice - the machine should not be touched in any way until the sections are executed. If that is unavoidable the X button can also be disabled (http://forums.winamp.com/showthread.php?t=322433).

Stu
Afrow UK is offline   Reply With Quote
Old 29th March 2011, 14:26   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
But to answer your question regarding the Cancel button telling ExecDos to kill its thread; will that even work assuming you could (you can't)? Your Perl script will carry on regardless. You could have some UI for your Perl script with a cancel button on it but I realise that isn't pretty. There isn't really any other way.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
cancel, close, execdos

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