Contenu |
---|
Rechercher |
---|
Login |
---|
Qui est en ligne? |
---|
Nous avons 166 invités en ligne |
Navigation |
---|
Les plus récents |
---|
Articles vedettes |
---|
Navigation |
---|
Scan a disk path or an entire disk with Inno Setup - Cancel button |
![]() |
Code source - Inno Setup | |||||||||
Écrit par Thomas | |||||||||
Lundi, 01 Juin 2009 19:30 | |||||||||
Page 3 de 4
As mentioned earlier, the scan could take a very long time, maybe even several hours. It is unacceptable not to provide an option to cancelling the process. The Cancel button is actually there, stuck on the installation wizard. It's just not visible while the progress page works. To get the button back, it needs to be made visible:
Once the Cancel button is visible it automatically gets its function back. Of course, it can't interrupt the directory reading function while files are read in and being processed. When Cancel is clicked, the directory scan happily carries on, and as soon as it is finished Inno Setup asks if the installation is to be aborted. This still is not how it should be. The scan should be stopped immediately, or at least as quickly as possible. Inno Setup's script engine provides an event function for the Cancel button: CancelButtonClick (). With a simple message box identical to the 'Exit Setup' confirmation message I tricked the user in believing that they see Inno Setup's original confirmation:
The difference between this 'Exit Setup' confirmation box and Inno Setup's own can be seen in the window title. The original confirmation message box is called 'Exit Setup' (image on the top) while mine contains the title of the setup (bottom image), which is 'Setup' by default. Although this is a fairly good working solution already, I was not happy with this difference. Since Inno Setup uses the Windows API MessageBox (), I was sure it can be used too to correct the window title. I found the declaration for Pascal script on the ISXKB under MessageBox () and nicked it from there: [Code] Pascal seems a bit picky when it comes to types, hence I didn't want to bother with all those required conversions and looked up the parameter constants in the file WinUser.h from the Windows SDK instead. Here's the relevant excerpt from that file:
I used the values directly and changed the function accordingly:
The outcome is an example Inno Setup script that scans the entire C: drive. If the user gets bored of watching the scan they can press the Cancel button and terminate the installer.
|
|||||||||
Mise à jour le Jeudi, 15 Octobre 2009 15:26 |
You need to login or register to post comments.
Discutez de ceci sur le forum. (5 posts)
Re: Scan a disk path or an entire disk with Inno Setup
Apr 02 2018 20:10:17 Not sure I understand what a "registry directory" is
![]() |
#2352 |
Scan a disk path or an entire disk with Inno Setup
Apr 02 2018 17:13:28 hi
this above scanning drive inno setup code can be use just like installaing files to registry directory |
#2351 |
Scan a disk path or an entire disk with Inno Setup
Apr 02 2018 17:11:28 hi
this above scanning drive inno setup code can be use just like installaing files to registry directory |
#2349 |