none
msi should install files even though user clicked NO in uac prompt RRS feed

  • Question

  • Hi all,

    I have created a msi. It works fine in admin account machines.

    But when msi is run from standard user account, standard users can type admin password in uac prompt, click YES and proceed installation. If they do not have admin password, they will click NO and but installation get failed.

    What i want is - even though when standard user clicks NO - installation should proceed, tasks which do not need admin privilege will succeed, tasks which need admin privilege alone will fail, but files will be installed.

    In simple words, installation should also happen when user clicks NO in uac prompt. 

    Kindly someone help me as soon as possible.

    Thanks

    Tuesday, March 26, 2019 11:24 AM

All replies

  • Hi all,

    I have created a msi. It works fine in admin account machines.

    But when msi is run from standard user account, standard users can type admin password in uac prompt, click YES and proceed installation. If they do not have admin password, they will click NO and but installation get failed.

    What i want is - even though when standard user clicks NO - installation should proceed, tasks which do not need admin privilege will succeed, tasks which need admin privilege alone will fail, but files will be installed.

    In simple words, installation should also happen when user clicks NO in uac prompt. 

    Kindly someone help me as soon as possible.

    Thanks

    What you desire is not possible for a single msi created by a visual studio installer project.

    What you should do is to use 2 msi files; one that installs items where installation requires elevated privileges and another that installs items where elevation is not required.

    By default, the msi created by a visual studio installer project will cause an elevation prompt to appear if it is run by a standard user or a member of the administrator's group when UAC is enabled.

    You can use the Orca tool (available as part of the Windows SDK) to edit the msi file for items where elevation is not required so that the UAC prompt will not appear.  The property to edit is the Word Count of the msi file's summary information stream.  See https://docs.microsoft.com/en-us/windows/desktop/Msi/word-count-summary
    Tuesday, March 26, 2019 2:18 PM
  • ok, if it is not possible by using visual studio, is it possible with single msi using orca or any other tool?

    (or)

    Scenario:

    i want it to be uac enabled by default in msi.

    IN STANDARD USER ACCOUNT:

    i will show a message box using vbscript (custom action) after double-clicking msi but before welcome dialog appears.

    when user clicks YES, then uac appears and installation proceeds.

    when user clicks NO, vbscript should disable uac at run-time, and installation proceeds.

    Atleast is this possible?

    Kindly suggest me asap


    Tuesday, March 26, 2019 3:18 PM
  • ok, if it is not possible by using visual studio, is it possible with single msi using orca or any other tool?

    (or)

    Scenario:

    i want it to be uac enabled by default in msi.

    IN STANDARD USER ACCOUNT:

    i will show a message box using vbscript (custom action) after double-clicking msi but before welcome dialog appears.

    when user clicks YES, then uac appears and installation proceeds.

    when user clicks NO, vbscript should disable uac at run-time, and installation proceeds.

    Atleast is this possible?

    Kindly suggest me asap


    You can do your own research to determine what might or might not be possible.
    Tuesday, March 26, 2019 3:22 PM
  • I think you should think about this problem the other way around. Most setup work as an executable that lead on to executing a .msi file.

    You can write this executable file to ask if they want to install for all users, and if they do then elevate. If they don't then you can not elevate.

    You may require two .msi files for this, but you can always work hard and try to create one which does a per machine install and a per user install.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Tuesday, March 26, 2019 3:33 PM
  • Hi Shabari Pragash,

    Welcome to MSDN forum.

    This forum is discussing the installation of visual studio. I will move your case to appropriate forum to seek for better support.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 27, 2019 6:17 AM
  • Here is some existing Microsoft documentation that you might find helpful - https://docs.microsoft.com/en-us/windows/desktop/Msi/single-package-authoring
    Friday, March 29, 2019 1:58 PM