Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Uninstallation prompts UAC after silent PerUser installation

Hi AI-team,

I've attached uninstall_cu.aip project. It has only 2 changes against default project:
- Installation type: Per-machine if user is administrator, per-user otherwise.
- In Dialogs added: InstallType Dlg.

The msi could be easily installed silently Per User from command line without prompting UAC window:

Code: Select all

msiexec /i <msi> /qn ALLUSERS=""
But when I'm trying to uninstall with full UI, UAC is prompting:

Code: Select all

msiexec /x <msi>/qf
Why does it happens? I've expected that PerUser installation shouldn't require admin rights to uninstall. What is the proper way to install msi silently for current user?
This is very important scenario, because if application is distributed silently by Group Policies it couldn't be updated in background silently.

2 strange facts:
Everything works fine if uninstall silently:

Code: Select all

msiexec /x <msi>/qn
Also the MSI uninstalls correctly without prompting UAC if it had been installed with full UI.


Kind regards,
Andrey
Attachments
u_cu.aip
(11.4 KiB) Downloaded 515 times
Last edited by Andrey on Wed Nov 19, 2014 9:26 am, edited 1 time in total.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Uninstallation prompts UAC after silent PerUser installa

Hi Andrey,

I'm not sure why you encountered this behavior.
I've tested your scenario using the provided sample and everything worked as expected. When performing a Per-User installation, I didn't get any UAC prompt on install or uninstall.
Of course, during a Per-Machine installation I got the UAC prompt during install and uninstall process.

Can you please try to test this on multiple machine and see if the behavior still persist?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Uninstallation prompts UAC after silent PerUser installa

Hi Dan,

I have reproduced the problem on virtual machine (Windows 8 En x64).
Here is simple batch script:
msiexec /i %1 /qn ALLUSERS=""
msiexec /x %1
Best regards,
Andrey
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Uninstallation prompts UAC after silent PerUser installa

Hi Andrey,

In order to perform a Per-user installation, you need to pass the following properties with the following values through the command-line:
  • ALLUSERS = 2
  • MSIINSTALLPERUSER = 1
So your command line statement should look something like that:

Code: Select all

msiexec.exe /i "Your Application.msi" /qb ALLUSERS=2 MSIINSTALLPERUSER=1
Using this command line a Per-User installation type will be made.

Please take a look on the ALLUSERS property article and MSIINSTALLPERUSER property article for a better view about this.

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Uninstallation prompts UAC after silent PerUser installa

Thank a lot Dan!
You really helped me.

I have checked this solution on win 7 and win8. Hope that it also work fine on win xp.

best regards,
Andrey
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Uninstallation prompts UAC after silent PerUser installa

You're welcome Andrey,

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Uninstallation prompts UAC after silent PerUser installa

Hi,
I have tested on xp, so as written in article this parameters will not work.

Correct combination for Windows 7 and higher:

Code: Select all

Current User: ALLUSERS=2 MSIINSTALLPERUSER=1
Local Machine: ALLUSERS=2 MSIINSTALLPERUSER=""
For Vista and lower:

Code: Select all

Current User: ALLUSERS=""
Local Machine: ALLUSERS=1
Hope this can be helpful for those who develop installers.

Best regards,
Andrey

Return to “Common Problems”