I'm writing a launcher/installer for end users which, among other things, will optionally generate shortcuts in the Start Menu and/or on the Desktop.
Ideally, I'd like these shortcuts to support these scenarios:
- the user changes the displayed name to their liking;
- the user moves or copies the shortcut somewhere else (e.g., to Quick Launch);
- the launcher later on discovers that it needs to update the icon and/or target location of the shortcut.
Right now, the launcher isn't smart about this — if it already finds a shortcut with the current name, it will leave it alone; if it doesn't, it will create a new one. Thus, if something about the shortcut has changed, either by the user, or by the launcher's database, you now end up with one that's current, and one that's not.
In order to properly track shortcuts including moves and copies and, I'm wondering if putting an NTFS alternate data stream "FoobarInstaller.Shortcut" in each of these shortcuts which simply contains a UUID is a viable option. I'd then ideally like to scan the entire user directory tree (or perhaps just typical locations like Desktop, Start Menu and Quick Launch) for files with the stream, and see if I need to apply updates to those.
What I don't know is if this is efficient. Does NTFS/Win32 feature an API to efficiently find all files with a certain ADS by name?