Yesterday, a friend asked for some assistance debugging an issue with Windows Installer. It was one of those situations where you've looked at the problem so closely, so many times, that you just needed another set of eyes. (They're close to shipping, so they've been doing nothing but look at bugs, probably for a while.)
Some background: What they're doing is a rather interesting use of Windows Installer. They're using it to drop a setup.exe and then run it. So, they have a custom action of type 0xC02, which is a deferred custom action, promoted to not use impersonation, which runs as an exe. This custom action spawns another version of itself (with different arguments), and then the process exits so the installer can complete. The second version of this custom action then wants to uninstall the msi, as well as launch the setup.exe. So, the msi is just a way to package up the setup.exe.
And, with UAC, it was breaking.
Now, with UAC issues, you typically think of access denied. But we didn't expect that at all here. We had promoted the custom action, so it should be running as local system. How could local system be receiving an access denied error? Perhaps we weren't being promoted for some reason?
So, I took a peek with Process Explorer. The processes had the privileges I expected, Local System. Here's the chain of process creation and token inheritance:
Microsoft, Windows Vista, Debugging, Troubleshooting, Installation, Tips and Tricks