Archive: How to enable the Cancel Button during install


How to enable the Cancel Button during install
After searching around and looking all over, I am stuck..

I have a simple installer that basicly is downloading files from the web and copying files from one folder/cd to another basied on various ini and XML files.

This can be a long process and the cancel button is disabled for all of this.

I want to enable the cancel button during any of this. I got to the point that if i cancel a download, it will pop a box that i canceled with "do I wish to continue".

But, for the file copy portion, the user is stuck waiting for 1000's of files to copy. and is forced to 3finger salute it.

Am I overlooking an obvious feature to abort?

I do not need a call back or unistall of what they have installed to this point. in fact it is prefered that it stays where it is since my script does a CRC check of files I have installed to this point and resumes or copies new/changed file.


In the InstFiles page's Pre or Show function, add:


GetDlgItem $0 $HWNDPARENT 2 ; The Cancel button..
EnableWindow $0 1 ; ..enable it

You're kidding me.. lol..

I swear i tried that...

I must have had a typo.

Thanks.

I pasted that example into the the script. It works like a charm.

It did leave a few a few random temp files in the folder and i forgot that i need to unload the UAC function. It looks like .onUserAbort cleans all of that up nicely...

Thanks again. You saved me from going bald ripping my hair out.