0

I didn't work with WIX Installer. Now I work with latest WIX v4. I want to check with which rights was started installer and after this dynamically select the installation path.

Idea example:

if is_admin()
    StandardDirectory Id="ProgramFiles6432Folder"
else
    StandardDirectory Id="LocalAppDataFolder"

I see these steps:

  1. User see UAC prompt
  2. User Click Yes or No
  3. Here I try to understand execution level

How can I do this?

I tried to find information how to do it and found that I can use Privileged property but I not found any example of code on WIX v4... Or maybe on WIX v3

Thank you!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Does this answer your question? [How do I get WiX installer to request administrative privileges?](https://stackoverflow.com/questions/14348156/how-do-i-get-wix-installer-to-request-administrative-privileges) – Palle Due Feb 01 '23 at 09:55
  • That's not the way it works. You don't check admin rights, you just request them and then it's up to the user to provide them. See suggested duplicate. – Palle Due Feb 01 '23 at 09:56
  • @PalleDue thanks for answer but I don't need to Request admin rights. Installer can be executed in silent mode so I need to understand execution level on the fly... 1) User see UAC prompt 2) User Click Yes or No 3) Here I try to understand execution level Can I do this? – Gregory Gustavin Feb 01 '23 at 10:51
  • @PalleDue, I have a question - Can I reach my goal through Custom Action? For example I write plugin DLL on C# which realize function is_admin() which exexutes on the fly. Thank you for your help – Gregory Gustavin Feb 01 '23 at 12:33
  • That's one way to do it, but not easy. – Palle Due Feb 02 '23 at 09:29

0 Answers0