[wix-users] Custom BA: Reading Registry Key Without User Read Permission

Bryan Dam bryand at recastsoftware.com
Wed Feb 17 08:37:20 PST 2021


We have a custom BA to install an extension/plugin to a Microsoft product.  We need to get some connection information about that product from the user and ideally verify that the service account they provide can access it.  Nothing too crazy there and that's all working just fine.  However, the idea was put forth that we should be able to automatically detect a lot of that information.  We might have to bounce around making some remote registry calls but the info is all there.  I've got that working with a singular exception: some of the registry keys do not have read only permissions for the Users group.  It's not my product, I'm not writing those keys, so there's nothing I can do about that part.  If I right click and run the installer as administrator it all works beautifully.  Any ideas on how to handle this?

Auto-elevating the entire BA would obviously work but I've read those threads and it seems that's just bad ju-ju even if I'm not modifying anything.

There's Engine.Elevate() but that intentionally doesn't elevate the UI and I'm not exactly sure what handle I should be giving it.  Is it possible to elevate the engine and then run elevated code using Detect/Plan callbacks?

Or is this just a fools errand?

       Thanks,
             Bryan


More information about the wix-users mailing list