In WiX 3.5, I am trying to create an MSI that can do both per-machine 
(ALLUSERS=1) and per-user (ALLUSERS="") installs from the same MSI. In 
this case, I want the default behavior to be per-machine, unless the 
user takes explicit steps to install per-user.

I read several forum posts (and some of the Microsoft documentation), 
but they are confusing, or not promising. I am hoping that some 
ingenious folks here can figure out how to do this!

Here is the scenario:
Using WixUI_Advanced
When double-clicking on the MSI (i.e., msiexec /i path-to-msi.msi, 
without setting any properties explicitly):
On Windows XP:
  if the user is an administrator (privileged), the default Install 
button installs per-machine.
  if the user is not an administrator (not privileged), the default 
Install button installs per-machine--which will fail. However, clicking 
the "Advanced" button allows the user to install per-user.
On Windows Vista/Windows 7:
  if the user is an administrator (privileged), AND elevated, the 
default Install button installs per-machine. (The shield icon may or may 
not be visible.)
  if the user is an administrator (privileged), AND NOT elevated, the 
default Install button installs per-machine. (The shield icon should be 
visible.)
  if the user is not an administrator (not privileged), the default 
Install button installs per-machine--which will require the user to be 
prompted for an administrator's credentials. (The shield icon should be 
visible.) However, clicking the "Advanced" button allows the user to 
install per-user.

In all cases, explicitly setting ALLUSERS="" or ALLUSERS=1 at the 
msiexec command-line will force per-user or per-machine installs.

********
The closest we have gotten thus far is:
<Package Id="*" InstallerVersion="200" Compressed="yes" 
InstallScope="perMachine" InstallPrivileges="limited" ReadOnly="no" 
Keywords="!(loc.PackageKeywords)" 
Description="!(loc.PackageDescription)" Comments="!(loc.PackageComments)" />

(And various other supporting WiX elements.)

In the configuration above:
On Windows XP, the behavior is correct.

On Windows Vista/Windows 7:
  *CORRECT*: if the user is an administrator (privileged), AND elevated, 
the default Install button installs per-machine. (The shield icon is NOT 
visible.)
  *INCORRECT*: if the user is an administrator (privileged), AND NOT 
elevated, the default Install button installs per-machine. The shield 
icon is visible. However, the package does NOT elevate. The error given 
is: "You do not have sufficient privileges to complete this installation 
for all users of the machine. Log on as administrator and then retry 
this installation." Error 1925.
  *INCORRECT*: if the user is not an administrator (not privileged), the 
default Install button installs per-machine. The shield icon is visible. 
However, the package does NOT elevate. Same error as above. Clicking the 
"Advanced" button allows the user to install per-user successfully, 
without elevation.

In all cases, explicitly setting ALLUSERS="" at the command-line 
performs the intended behavior of forcing per-user installation. 
ALLUSERS=1 at the command-line has the intended behavior of forcing 
per-machine installation, but it does NOT force elevation--so 
per-machine fails on Vista and 7.

********
So basically, is there some way through custom actions or otherwise, to 
cause an MSI built with InstallPrivileges="limited" to request 
elevation? Alternatively, is there a way to cause an MSI built with 
InstallPrivileges="elevated" to reconfigure itself so that it does not 
request elevation?

Thanks all,

Sean

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to