问题
I have developed a WIX custom installer using C# WPF. I need to delete a file from "c:\Program Files" using c#. It shows error unauthorised. If i manually run with "run as administrator" it works. I tried adding manifest file and necessary changes. But it didn't work. I tried copying the same manifest file to a console application and it works.
回答1:
You can do this by creating a C# custom action project and referring it in the WIX project.
https://blogs.msdn.microsoft.com/jschaffe/2012/10/23/creating-wix-custom-actions-in-c-and-passing-parameters/
来源:https://stackoverflow.com/questions/46704056/wix-custom-installer-admin-privilege