Quantcast

Uninstalling with admin privileges on win 8 - 8.1

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Uninstalling with admin privileges on win 8 - 8.1

Smagin Alexander
 Hi, 
I create msi to install our company software. During installation it's required to register COM object. it requires admin privileges.
I use the following condition to detect admin privileges

<Condition Message="Only administrator is allowed to install the application.">
(Privileged and (VersionNT = 601 Or VersionNT = 602 or VersionNT = 603)) or VersionNT = 501
</Condition>

There is no problem when I install it on win 8.1, I execute it as administrator from popup menu.
Diring uninstalling I should unregister COM object and remove folder from ProgramFiles. When I try to unuinstall it during add/remove programs, It says that I'm not admin and does not allow to remove it. If I ommit this condition, then installer doesn't remove files from ProgramFiles and doesn't unregister COM object. Please help me to avoid it?

Thanks,
Alex
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Uninstalling with admin privileges on win 8 - 8.1

Phil Wilson
On UAC systems a check like the one you have will not always work properly
because Privileged doesn't get set until an MSI elevation prompt which is
after the launch conditions.
That check works when you run from an elevated prompt because that forces
elevation of the entire MSI including the launch condition, but it won't
work from an uninstall unless the uninstall is also elevated. To guarantee
that you are actually elevated you need a check for Privileged early in the
Execute sequence, with a type 19 custom action to stop the install
operation. I've forgotten what that type 19 is in WiX.
That seems to be the issue as far as I can tell. This may help:
http://blogs.msdn.com/b/rflaming/archive/2006/09/21/765665.aspx
together with the MSIUSEREALADMINDETECTION property.

Phil Wilson


On Mon, Nov 18, 2013 at 6:06 AM, Смагин Александр Михайлович <[hidden email]
> wrote:

>  Hi,
> I create msi to install our company software. During installation it's
> required to register COM object. it requires admin privileges.
> I use the following condition to detect admin privileges
>
> <Condition Message="Only administrator is allowed to install the
> application.">
> (Privileged and (VersionNT = 601 Or VersionNT = 602 or VersionNT = 603))
> or VersionNT = 501
> </Condition>
>
> There is no problem when I install it on win 8.1, I execute it as
> administrator from popup menu.
> Diring uninstalling I should unregister COM object and remove folder from
> ProgramFiles. When I try to unuinstall it during add/remove programs, It
> says that I'm not admin and does not allow to remove it. If I ommit this
> condition, then installer doesn't remove files from ProgramFiles and
> doesn't unregister COM object. Please help me to avoid it?
>
> Thanks,
> Alex
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Uninstalling with admin privileges on win 8 - 8.1

Smagin Alexander
 Thanks for clarification, but I do not understand anyway how to elevate the uninstall. Should I always use my setup.exe to uninstall the app instead of add/remove programs?

Понедельник, 18 ноября 2013, 17:05 -08:00 от Phil Wilson <[hidden email]>:

>On UAC systems a check like the one you have will not always work properly
>because Privileged doesn't get set until an MSI elevation prompt which is
>after the launch conditions.
>That check works when you run from an elevated prompt because that forces
>elevation of the entire MSI including the launch condition, but it won't
>work from an uninstall unless the uninstall is also elevated. To guarantee
>that you are actually elevated you need a check for Privileged early in the
>Execute sequence, with a type 19 custom action to stop the install
>operation. I've forgotten what that type 19 is in WiX.
>That seems to be the issue as far as I can tell. This may help:
>http://blogs.msdn.com/b/rflaming/archive/2006/09/21/765665.aspx
>together with the MSIUSEREALADMINDETECTION property.
>
>Phil Wilson
>
>On Mon, Nov 18, 2013 at 6:06 AM, Смагин Александр Михайлович < [hidden email]
>> wrote:
>
>>  Hi,
>> I create msi to install our company software. During installation it's
>> required to register COM object. it requires admin privileges.
>> I use the following condition to detect admin privileges
>>
>> <Condition Message="Only administrator is allowed to install the
>> application.">
>> (Privileged and (VersionNT = 601 Or VersionNT = 602 or VersionNT = 603))
>> or VersionNT = 501
>> </Condition>
>>
>> There is no problem when I install it on win 8.1, I execute it as
>> administrator from popup menu.
>> Diring uninstalling I should unregister COM object and remove folder from
>> ProgramFiles. When I try to unuinstall it during add/remove programs, It
>> says that I'm not admin and does not allow to remove it. If I ommit this
>> condition, then installer doesn't remove files from ProgramFiles and
>> doesn't unregister COM object. Please help me to avoid it?
>>
>> Thanks,
>> Alex
>>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Uninstalling with admin privileges on win 8 - 8.1

Smagin Alexander
 I have found a way to elevate my msi. The solution is to use InstallPrivileges="elevated" in <Package> and do not use setting  MSIUSEREALADMINDETECTION property.

<Package Id="*"
Description="Description"
InstallerVersion="301"
Compressed="yes"
InstallPrivileges="elevated"
InstallScope="perMachine"
Platform="x86"
/>

Thanks
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...