\
Source Code
Commands
FolderIcon
The "FolderIcon" Command |
This command can be used to create a "desktop.ini" file for a directory.
There is virtually no good information on creating the INI files but this
command correctly creates them in "unicode" format and I used these plus other
links to gather information:
- https://hwiegman.home.xs4all.nl/desktopini.html
- https://www.sevenforums.com/tutorials/15699-folder-template-default.html
- https://www.pcreview.co.uk/threads/how-keep-large-icons-after-renaming-a-folder.2543315/
- https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102(v=vs.85).aspx
As all values the INI file are supplied as
msi formatted strings, you will need to escape any
square brackets they may contain.
After folder creation it can take some time for all attributes you apply to
display correcly in Explorer.
The macro takes these parameters:
- DirKey (required)
This is the key that the folder is known by (possibly created with
the "Directory" command).
- InfoTip (optional)
This is the text that should be displayed when someone hovers the mouse
over the folder.
- IconFile (optional)
This names the resource containing the icon.
The filename can be relative.
If the file contains more than once icon then you will need to use the
"IconIndex" parameter.
- IconIndex (optional)
Specifies the index of the icon in the file specified by the
"IconFile" parameter (it defaults to "0").
- IconResource (optional)
This defines both the "IconFile" and the "IconIndex" at the same type
(the values are separated by a comma).
If this parameter is used then "IconFile" can't be.
- View (optional)
This defines the default folder view and should be one of:
- ICONS
- LIST
- DETAILS
- THUMBNAIL
- TILES
- FILMSTRIP
- DEFAULTDROPEFFECT (optional)
This is as per the INI files documentation value
- CONFIRMFILEOP (optional)
This is as per the INI files documentation value
- FOLDERTYPE (optional)
This is as per the INI files documentation value
<$DirectoryTree Key="INSTALLDIR" Dir="c:\program files\TryMe">
<$FolderIcon DirKey="INSTALLDIR" IconFile="TryMe.ico" InfoTip="Some tootltip text to describe the folder">
;--- Some other variations ---
; <$FolderIcon DirKey="INSTALLDIR" IconFile="TryMe.ico" InfoTip="[test infotip]"> ;;This will fail due to the unescaped square brackets!
; <$FolderIcon DirKey="INSTALLDIR" IconFile="TryMe.ico" InfoTip="<$LSB>test infotip<$RSB>"> ;;This won't fail as the square brackets are escaped!
; <$FolderIcon DirKey="INSTALLDIR" IconResource="TryMe.ico,0" VIEW="TILES">
Main FolderIcon Related Options + Constants |
Please see the "options for commands" section of the manual.
;--- Custom Action scheduling options ---
#define? FOLDERICON_SCHEDULE_INSTALL_SEQ DuplicateFiles- ;;After "CreateFolders" doesn't work!!!
#define? FOLDERICON_SCHEDULE_INSTALL_CONDITION <$CONDITION_EXCEPT_UNINSTALL>
#define? FOLDERICON_SCHEDULE_INSTALL_TYPE System ;;Allow it to work under program files...
#define? FOLDERICON_SCHEDULE_UNINSTALL_SEQ <-DuplicateFiles ;;"<-RemoveFolders" doesn't work!!!! It leaves the folder behind
#define? FOLDERICON_SCHEDULE_UNINSTALL_CONDITION <$CONDITION_UNINSTALL_ONLY>
#define? FOLDERICON_SCHEDULE_UNINSTALL_TYPE System
;--- Define "[ViewState]->VID" options "(V)iew (ID)" and associated "mode" ---
#define? FOLDERICON_VIEW_ICONS {0057D0E0-3573-11CF-AE69-08002B2E1262}
#define? FOLDERICON_VIEW_LIST {0E1FA5E0-3573-11CF-AE69-08002B2E1262}
#define? FOLDERICON_VIEW_DETAILS {137E7700-3573-11CF-AE69-08002B2E1262}
#define? FOLDERICON_VIEW_THUMBNAIL {8BEBB290-52D0-11D0-B7F4-00C04FD706EC}
#define? FOLDERICON_VIEW_TILES {65F125E5-7BE1-4810-BA9D-D271C8432CE3}
#define? FOLDERICON_VIEW_FILMSTRIP {8EEFA624-D1E9-445B-94B7-74FBCE2EA11A}
#define? FOLDERICON_MODE_ICONS 1
#define? FOLDERICON_MODE_LIST 3
#define? FOLDERICON_MODE_DETAILS 4
#define? FOLDERICON_MODE_THUMBNAIL 5
#define? FOLDERICON_MODE_TILES 6
#define? FOLDERICON_MODE_FILMSTRIP 7