[wix-users] Elevated priviledges for custom actions

Todd Hoatson todd.hoatson at gmail.com
Mon Apr 29 17:50:16 PDT 2019


Thanks for the quick response, Rob...

> Deferred custom actions are elevated (unless impersonating).

In the installer code I'm looking at, the custom action is in the
InstallExecuteSequence, After="AppSearch".  And the custom action is
defined with Execute="immediate".  So it would seem something's amiss
here.  Being in the Execute sequence, it should be deferred, and therefore
elevated.  But it is set to execute after AppSearch, which is in the UI
sequence!  But I don't get any error message(s) about this.  The fact that
it is set for immediate execution makes me think it was originally written
to be part of the UI sequence, but then the custom action was moved to the
Execute sequence without this action being thought through very carefully.

This custom action is primarily for setting properties to indicate which
fonts need to be installed.  But it contains a call to delete the font file
from the system if it's an older version than the one provided with the
installer, and I assume this is the reason it is in the Execute sequence.

Since I'm still relatively new to WiX, I want to double-check my
understanding...

It seems that I have 2 options in order to make things more consistent:
1)  change the custom action to fire After="InstallValidate", but still
Execute="immediate".
2)  change the custom action to fire After="InstallInitialize", but with
Execute="deferred".

I'm not sure how to evaluate which approach is more appropriate (i.e.
playing by the rules of Windows installer).  Any input on this?

thanks,
Todd

On Mon, Apr 29, 2019 at 12:53 PM Rob Mensching <rob at firegiant.com> wrote:

> Deferred custom actions are elevated (unless impersonating).
> _____________________________________________________________
>  Short replies here. Complete answers over there:
> http://www.firegiant.com/
>
> -----Original Message-----
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of
> Todd Hoatson via wix-users
> Sent: Monday, April 29, 2019 9:39 AM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Cc: Todd Hoatson <todd.hoatson at gmail.com>
> Subject: [wix-users] Elevated priviledges for custom actions
>
> Hi, while pursuing a font installation issue on another forum, I received
> the following comment from another poster:  "Even if your installer is
> running with elevated privilege It is possible that your custom action is
> not running elevated."
>
> Can someone comment about how this works with WiX?  Is there a default for
> custom actions?  Is there a way to set the priviledge to elevated for a
> custom action?
>
> thanks,
> Todd Hoatson
>


-- 
Todd Hoatson
Mobile: 763-291-3312
Email:   todd.hoatson at gmail.com
www.linkedin.com/in/toddhoatson



More information about the wix-users mailing list