how to install files even though user clicks NO in uac prompt for msi?

前端 未结 2 1115
慢半拍i
慢半拍i 2021-01-26 01:42

I have created a msi using Visual Studio Installer Projects. When i run the msi, uac prompt always appears in all machines. This is fine.

But for standard users, uac ask

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-26 02:39

    To avoid the UAC window, your installer shouldn't do anything that is require elevated permissions (e. g. install files to Program Files sub-folders or writing to registry in HKLM sub keys). And you should specify this before the Windows Installer will go to the installation stage and show you the UAC window.

    You'll need to make separate features for each configuration and switch them according to some conditions. For example, you could ask a user about which kind of installation he/she wants to perform or check if the user is an admin. According to this you should switch on/off the corresponding features in your MSI.

提交回复
热议问题