jrsoftware.org // Jordan Russell's Software


-Inno Setup







visitors since
Jan. 1998

Inno Setup Knowledge Base
Return to index

PRB: Wildcard matches unexpected extensions

Article Created: 2003-12-23 20:29 GMT by Jordan Russell
Last Updated: 2006-10-10 06:49 GMT by Jordan Russell

If the following wildcard is used in a [Files] section entry:

Source: "*.htm"; DestDir: "{app}"

you may find that it matches not only files with an .htm extension, but also files with an .html extension.

This happens because in Windows, wildcards match both long filenames and 8.3 aliases ("short filenames"). By default, a file named "webpage.html" will have the 8.3 alias "WEBPAG~1.HTM"; hence, *.htm will match the file.

To avoid this, add an Excludes parameter to explicitly filter out files with an .html extension:

Source: "*.htm"; Excludes: "*.html"; DestDir: "{app}"

Alternatively, there is a registry tweak you can make to prevent this from happening system-wide; see the Microsoft KB article 164351. With the Win95TruncatedExtensions registry entry set to 0, a file created with the name "webpage.html" will be assigned the 8.3 alias "WEBPAG~1.HT~". The tilde in the extension effectively prevents *.htm from matching the file.

Site contents Copyright © 1997-2020 Jordan Russell. All rights reserved.
Portions Copyright © 2000-2020 Martijn Laan. All rights reserved.