[wix-users] [WIX]: UAC Prompt issue when InstallScope="perUser"
Wesley Manning
wmanning at dynagen.ca
Tue Sep 15 05:39:53 PDT 2015
Off topic but why are per-machine installs are recommended over per-user?
Wes
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phil Wilson
Sent: September-04-15 2:58 PM
To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] [WIX]: UAC Prompt issue when InstallScope="perUser"
This question is essentially the same text that you posted on 8/31 but with a different subject line. You haven't said why the responses to that were such that you re-posted the same question. It was also pointed out that if you were to say what key you want to write then there may be a way to do it with Windows Installer, as Rob says.
In a per machine install with InstallPrivilege elevated you will get a UAC prompt for the install, and the custom action will run elevated if it's impersonation=no, but it cannot simply write to HKCU for the installing user because it will be running with the SYSTEM account. If you run with impersonation=no you will run with the user's account, but the account profile (i.e. the user's registry hive) will not be loaded, so you still can't write to HKCU.
Converting to a per user install is not a good strategy to make it work, basically because per machine installs are recommended over per user. In any case it still will most likely fail. Your custom action will run with the installing user's account but again you may not be running with the user's profile actually loaded into the process (because loading the user's profile for every CA exe would really slow things down) so it's likely you still can't write to that HKCU key. You could write to HKLM in a per machine elevated install with an impersonation=no custom action, but you still may not be able to write to HKCU.
So I suspect you are up the proverbial creek without a paddle and it might be better to state your actual problem detail rather than ask why your attempted solution is failing. Reading between the lines of your post, maybe you want to know where the MSI has been extracted to and will therefore install from, and if so the SourceDir property will tell you that as soon as the install starts up.
Phil
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Rob Mensching
Sent: Friday, September 04, 2015 9:44 AM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] [WIX]: UAC Prompt issue when InstallScope="perUser"
Why write a custom action to write registry keys? Windows Installer writes registry keys (and rolls them back!) quite well.
_______________________________________________________________
FireGiant | Dedicated support for the WiX toolset | http://www.firegiant.com/
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Griesshammer, Christoph (GE Healthcare)
Sent: Friday, September 4, 2015 8:39 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] [WIX]: UAC Prompt issue when InstallScope="perUser"
When you have Impersonate="no" for your custom action, it does not request elevation. Set it to yes and you should see the prompt.
Christoph
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Dileep S
Sent: Friday, September 04, 2015 10:30 AM
To: WiX Toolset Users Mailing List
Subject: [wix-users] [WIX]: UAC Prompt issue when InstallScope="perUser"
Hi All,
I have created a sample C++ exe to write Registry Key in the following
location:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion
I have packaged this "Sample.exe" using WIX script.
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
InstallPrivileges="elevated" />
I have written custom action in *.WXS file as below:
<CustomAction Id="InstallDRV" Directory="INSTALLDIR" Execute="deferred"
ExeCommand="[$(var.RootDirID)]$(var.EXEFileName)" Impersonate="no"
Return="asyncNoWait" />
"Sample.exe" should write the registry key which was specified after extracting the MSI package.
*Issue:*
After extracting the MSI package, "Sample.exe" launches and written a registry key in the below location not in the specified location:
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Windows
How to resolve this issue?
I have modified the InstallScope="perUser" as below <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser"
InstallPrivileges="limited" />
But Issue is UAC prompt is not appearing.
How to display UAC prompt, when InstallScope="perUser"
Please help me to resolve this issue.
Thanks in advance.
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=BQI
CAg&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=-l6_npd-dx-ekbVSbypvaw-I
cErQ11UE3f78jQgrCDw&m=feEYlrG-Ucnk3Gw0-eySWQZlUxb75TYiqKKVnSMdeXo&s=cB6c5iBO
L02T5EDwOFgUHK3l8_KB4XB54BGjE7PpAJE&e=
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list