views:

1039

answers:

3

I'm have written an msi file that offers a choice of "per-user" or "for all" installation in the UI phase, and now find that the installer fails on Vista:

  • if I just reuse the installer that works for XP, Vista will trigger a UAC prompt even for the "per-user" installation, making that installation pointless
  • if I turn off UAC in bit 3 of PID_WORDCOUNT, Vista won't invoke UAC at all anymore, so even if the user would have permission to install into the machine registry (say), the privilege raising doesn't happen, so the installation fails.

So: how can I prevent installer from invoking UAC when it isn't really needed? Alternatively, how can I programmatically request UAC even if bit 3 is set?

+3  A: 

Try this reference: UAC in MSI Notes: How to Build Packages that work for both Standard User and Per-Machine?

sascha
Please understand that I'm not talking about the UAC of an executable - there is no setup.exe. Instead, users launch the MSI file directly.
Martin v. Löwis
new reference provided...
sascha
This is a fantastic link to series of blog posts discussing how user access control (UAC) relates to Windows Installer (.msi) technology. Thanks for the link, @sascha!
dthrasher
+4  A: 

Unfortunately, the Windows Installer does not provide a way to create a single package that can install per-machine and per-user but only prompt for UAC on the per-machine case. The issue is that they bit that can suppress the UAC prompt is stored in the SummaryInformation stream and is not modifiable while the package is executing.

Rob Mensching
Thanks for the confirmation. Is there a serious design reason for this, or can we hope that this flag becomes a property some day?
Martin v. Löwis
I hear that MSI 5.0 is doing something is this area. But we'll need Win7 for that. <sigh/>
Rob Mensching
+1  A: 

Hello,

I turned off UAC by setting the bit 3 of PID_WORDCOUNT in my MSI package. I can able to install it for "ALLUSERS" and "PER-USER", and also write in for HKLM in both the modes on VISTA machines. Is it mandatory for you to get UAC popup for privileged user during installation?

Kallu
Turning off this bit did not work for me. Users would get "permission denied" errors, even though they are members of the administrator group. Only the administrator itself could successfully install the package.
Martin v. Löwis

related questions