The most useful recommendation I have for everyone doing this is to stop.Instead, do this configuration step later, after
the install.
The issue is that yes, custom actions generated by VS 2008 run with the system account. This allows them to run privileged on UAC systems. To turn this behavior off you'll have to change the MSI file after you've built it (there's no option in Visual Studio to control whether the custom action runs withimpersonation or not). Use Orca to edit the MSI file. Go to the CustomAction table, identify your custom action and turn off the msidbCustomActionTypeNoImpersonate bit.
http://msdn.microsoft.com/en-us/library/aa368069(VS.85).aspxYou'll also need to ensure that the install is run from a an elevated environment on UAC systems.
It's not clear to me whether this will always work. It means your code will run impersonating the installing user, but impersonation cannot be indefinitely propagated, so if SQL also attempts impersonation of your code, an already-impersonated user, there might be an issue. The bottom line here is that setup projects are not a good place to application configuration because you are *not* running in an application environment.
Phil Wilson