There are a couple approaches that occur to me off the bat.
If you truly need a unique id embedded directly in the executable, then you are talking about:
- Compiling a separate executable for each download, in which case you'll need to script out the act of changing some file used to build the exe, and calling csc.exe to compile a unique exe file for each user at the time of the download.
- Locating the unique key embedded in the .exe file itself, and editing it in-place just before downloading the file.
Both of these seem a bit heavy-handed to me. Why can't you just keep the unique key in a separate file? As long as it's unique to each user, I don't see why it would need to be embedded directly into the exe. You'll still need a way to package it up for delivery, of course. You could zip up the "key file" with an installer, and script the installer to copy the key file to the location of the exe file, I suppose.
Of course, the identifier should be encrypted somehow to stop casual hackers from breaking your system, perhaps using the registered user's name as the initialization vector (IV) or salt value to the encryption routine. As long as the executable itself doesn't actually use the key for anything, then it won't even need to have the private key used to decrypt it. To the exe, it's just a magic value that it uses when asking for updates. The exe could pass this value in the querystring or post data of the request for updates. On your end, you decrypt the value, pull out the user ID, and use that to generate the new download if there is one.
If you want the executable to use the value, perhaps at startup to verify that it's a "genuine" copy, then you're going to have to give it the ability to decrypt the key. This means embedding the decryption key into the exe file, and hoping no-one digs it out with Reflector or something.
At this point, you're talking about full-fledged copy protection, in which case you're much better off finding a commercially available system than trying to write one yourself.