View Full Version : File List
NewsArchive
07-09-2010, 01:31 AM
Hi Friedrich,
why must I specify a variable if I use "Free File List"?
Markus
NewsArchive
07-09-2010, 01:31 AM
Hi Markus,
>
> why must I specify a variable if I use "Free File List"?
>
Fixed!
Thank you.
Friedrich
NewsArchive
07-09-2010, 01:32 AM
OK,
and why must I specify a variable by Load File List? It holds the number
of the files found, but this value is already returned in %_SB_RETURNEX%.
Markus
NewsArchive
07-09-2010, 01:38 AM
> OK,
>
> and why must I specify a variable by Load File List? It holds the number
> of the files found, but this value is already returned in %_SB_RETURNEX%.
Yes, it is returned in both the variable and %_SB_RETURNEX%.
The extra %_SB_RETURNEX% variable value was introduced 16 months ago (to be
consistent with the "Copy File(s)...", "Copy Folder Tree..." "Move
File(s)..." and "Move Folder Tree..." script functions. %_SB_RETURNEX%
variable holds the number of copied/moved files and it was requested to do
the same with "Load File List".
Friedrich
NewsArchive
07-09-2010, 01:39 AM
Hi Friedrich,
Thanks for your answer. I've just discovered, that Load File list
doesn't work when using a root path like that:
Set Variable %LIST% to FUNCTION:Handle File Listing(Load File List, 1)
of "C:\"
It always returns 0.
Markus
NewsArchive
07-09-2010, 01:39 AM
Markus,
> Thanks for your answer. I've just discovered, that Load File list doesn't
> work when using a root path like that:
>
> Set Variable %LIST% to FUNCTION:Handle File Listing(Load File List, 1) of
> "C:\"
>
> It always returns 0.
Yes, that part is missing in the documentation (I don't know why -- added
now). By design, the function does not allow to process the root folder.
Friedrich
NewsArchive
07-09-2010, 01:40 AM
:-(
For me, it looks more like an error. But as far as I can see I anyway
can't use two different file lists at the same time, so I have to write
my own solution.
Can you add a "FileListEx" function to your suggestion list with the
following extensions:
- Have multiple file lists. Lists can be referenced via a variable,
which holds a "handle"
- Can process root path
Markus
NewsArchive
07-09-2010, 01:40 AM
> :-(
>
> For me, it looks more like an error. But as far as I can see I anyway
> can't use two different file lists at the same time, so I have to write my
> own solution.
Yes, it's a documentation error. In the first versions, there was a file
limit of 512 items for "Handle File Listing". This limit was reached very
quickly by processing the C:\ root and 1 or 2 sub-folder levels.
BTW, the same documentation error exists for "Delete Folder Tree" (limited
for security reasons) and "Check In-Use Folder Tree". Also fixed now.
> Can you add a "FileListEx" function to your suggestion list with the
> following extensions:
> - Have multiple file lists. Lists can be referenced via a variable, which
> holds a "handle"
I can add this to the suggestion list, but it will definitely not be
available in SB7. It's impossible to change the FileList function in such a
way that different file lists can be handled at the same time. It requires
a complete new function (perhaps in SB8).
>
> - Can process root path
>
We can handle up to 10,240 files now so the limitation is not required any
longer. I have removed it for the "Handle File Listing" now.
Friedrich
NewsArchive
07-09-2010, 01:42 AM
BTW, please note that a search depth of 0 searches all folders and
sub-folders. If you do this on C:\, make sure you limit it to Search Depth
1.
Friedrich
NewsArchive
07-09-2010, 01:42 AM
Thanks,
this was just a typo in my example.
FYI: A colleague is now programming a dll, which gives me SB-compatible
access to FindFirstFile, FindNextFile and FileClose. So, if it is to
much work to add this extended functionality (even in SB8), I have a
solution, which solves my problem.
p.s.: There is a possibility, to add the "multiple File Lists"
functionality in SB7 WITHOUT breaking existing scripts:
At the moment, the variable %_SB_RETURN% is NOT used by "Load File
List". You can return a "handle" in this variable.
You can add an additional Field "Handle" to the dialog, used by all
other File List funnctions. If this field is empty (as it would be in
all existing scripts), you simply use the LAST loaded file list, is the
value is set, you use the file list associated with the given handle.
There are two additional changes needed:
- On subsequent calls of "Load File List", you must create a new "File
List Object" instead of reusing the existing one.
- Add a compiler warning, if there are less (or more) "Free File List"
calls as "Load File List" calls to prevent memory leaks.
Markus
NewsArchive
07-09-2010, 01:43 AM
Markus,
> this was just a typo in my example.
>
> FYI: A colleague is now programming a dll, which gives me SB-compatible
> access to FindFirstFile, FindNextFile and FileClose. So, if it is to much
> work to add this extended functionality (even in SB8), I have a solution,
> which solves my problem.
Cool!
> p.s.: There is a possibility, to add the "multiple File Lists"
> functionality in SB7 WITHOUT breaking existing scripts:
>
> At the moment, the variable %_SB_RETURN% is NOT used by "Load File List".
> You can return a "handle" in this variable.
>
> You can add an additional Field "Handle" to the dialog, used by all other
> File List funnctions. If this field is empty (as it would be in all
> existing scripts), you simply use the LAST loaded file list, is the value
> is set, you use the file list associated with the given handle.
>
> There are two additional changes needed:
> - On subsequent calls of "Load File List", you must create a new "File
> List Object" instead of reusing the existing one.
> - Add a compiler warning, if there are less (or more) "Free File List"
> calls as "Load File List" calls to prevent memory leaks.
In theory "yes", in practice "no" <g> If it was that easy you would see it
in the next build;-) But unfortunately, the installer runtime is a very complex
animal.
Friedrich
NewsArchive
05-06-2011, 01:28 PM
Hi Friedrich,
> a complete new function (perhaps in SB8).
I would really love to see this in SB8. What are the prospects?
Markus
NewsArchive
05-06-2011, 01:28 PM
Hi Markus,
> > a complete new function (perhaps in SB8).
>
> I would really love to see this in SB8. What are the prospects?
It's not in the SB8 implementation yet (but research and development is
still ongoing). I can confirm that this item is listed as a "Feature
Request" in the SetupBuilder wishlist.
Friedrich
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.