Contenu |
---|
Rechercher |
---|
Login |
---|
Qui est en ligne? |
---|
Nous avons 247 invités en ligne |
Navigation |
---|
Les plus récents |
---|
Articles vedettes |
---|
Navigation |
---|
Scan a disk path or an entire disk with Inno Setup |
![]() |
Code source - Inno Setup | |||||||||
Écrit par Thomas | |||||||||
Lundi, 01 Juin 2009 19:30 | |||||||||
Page 1 de 4
For an installation program I wanted to give the user an option to automatically scan for a particular file on his hard drive or maybe only in a subtree of a drive. A search through the Inno Setup newsgroups brings up several posts to discourage people to do so. It is understandable, because network and local drives could contain several million files or a similar amount of folders. It could take hours to read the directory tree in and search for a single file. The reasonable alternative is to find the file through other clues like registry entries. However, the location of the file my installation program is supposed to look for is stored nowhere. The software saves its settings in a Windows ini file, and this file resides just next to the executable file in the same folder.
Preparing the Inno Setup script to search for it in a given folder tree or an entire drive seems helpful to the user. It didn't even look very complicated as the helpfile has a pretty good example on how to use the functions FirndFirst and FindNext. The only minor obstacle was my limited Pascal knowledge which had become a bit rusty over the years, and of course because Inno Setup's Pascal script is not comparable with a fully-featured Pascal compiler. That's probably the reason why my first attempt didn't want to work on larger directory trees. I kept getting an 'Out of memory' message after a few seconds. I had tried to read the tree into a string array (TArrayOfString) by dynamically expanding it as files and folder names where coming in from the tree reading function. I wanted a flexible function to read the folder tree and then go through the array and process every single file and directory in a second step outside that reading function.
When this function is called, the installer can't do anything else. In effect, that means that not even the installation wizard's window can be moved. The user interface blocks completely without feeding anything back.
|
|||||||||
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 |