ExtractTemporaryFiles - Inno 6.2.0

277 views
Skip to first unread message

Tony Morris

unread,
Sep 21, 2021, 11:43:46 AM9/21/21
to innosetup
I *think* this is a bug???  Perhaps related to the number of '.' characters in the filenames?

Using either of these files entries:
    Source: ".\SupportingApps\SumatraPDF-3.3.3*.*"; Flags: dontcopy;
    Source: ".\SupportingApps\SumatraPDF-3.3.3*.*"; Flags: dontcopy; DestDir: "{tmp}";

Note that this pulls in two files (from "Compiler Output"):
   Compressing: C:\Dev\419_Jerry\Installer\.\SupportingApps\SumatraPDF-3.3.3-64-install.exe   (3.3.3.0)
   Compressing: C:\Dev\419_Jerry\Installer\.\SupportingApps\SumatraPDF-3.3.3-install.exe   (3.3.3.0)
   
I could not get either of the following to work:
    ExtractTemporaryFiles(ExpandConstant('{tmp}\SumatraPDF*'));
    ExtractTemporaryFiles(ExpandConstant('SumatraPDF-3.3.3*'));

For now, I am just using this call (singular file reference without wildcards) which works fine.  However, It would be nice to use the wildcard capable entry.
    ExtractTemporaryFile(ExpandConstant('SumatraPDF-3.3.3-64-install.exe'));

No biggie, just passing this along for others that may run into it as I did not see this bug mentioned in my search here.  ....just the odd documentation that threw me too for a minute.

Eivind Bakkestuen

unread,
Sep 22, 2021, 7:41:44 PM9/22/21
to inno...@googlegroups.com
Just for fun, try

ExtractTemporaryFiles(ExpandConstant('{tmp}\SumatraPDF*.*'));

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/5ace10a9-3342-447d-8af4-de700ee25f92n%40googlegroups.com.

Gavin Lambert

unread,
Sep 22, 2021, 8:00:31 PM9/22/21
to inno...@googlegroups.com
On 22/09/2021 3:43 am, Tony Morris wrote:
> I could not get either of the following to work:
>     ExtractTemporaryFiles(ExpandConstant('{tmp}\SumatraPDF*'));
>     ExtractTemporaryFiles(ExpandConstant('SumatraPDF-3.3.3*'));

Don't use ExpandConstant in the parameter for ExtractTemporaryFiles.
The internal name of the files contains the literal {tmp}, not the
actual directory that this represents.

You do need to use ExpandConstant when accessing the extracted files
themselves.

Tony Morris

unread,
Sep 23, 2021, 10:16:57 AM9/23/21
to innosetup

Thank you all!!  With a little nudge from intelligent people, ….and rereading the documentation, I see now that ExtractTemporaryFiles() does not need (nor can it use) the per-extraction of Directory Constants, such as {tmp}, using ExpandConstant().  ExtractTemporaryFiles() can handle Directory Constants on its own.

 

So, here is what worked.  With this file entry:

    Source: ".\SupportingApps\SumatraPDF-3.3.3*.*"; Flags: dontcopy; DestDir: "{tmp}";

 

This extraction call worked perfectly:

    ExtractTemporaryFiles('{tmp}\SumatraPDF*.*');


If I take the “{tmp}” out of the above call, it fails.

Reply all
Reply to author
Forward
0 new messages