Manifests not working for control panel applets

Posted: 05-26-2006, 03:58 AM
Hi,

I've been testing my app on vista beta 2 and have hit a roadblock with LUA.

One part of the app is a control panel applet. It exists solely to
configure global settings used by the service, so it needs access to
administrator priviliges to open the service control manager and to
write to HKLM.

When I started it as administrator it immediately barfed saying it
couldn't open the SCM. No problem... I setup a manifest in the file set
to requireAdministrator. This didn't work!

It seems that control panel applets don't respect manifests at all..
which means I'm screwed, basically.

I could rearchitect the file a bit.. I could do it with a priviliged
thread etc. but I can't see any way of doing it - the documentation
talks about rewriting the thing into a COM object (not an option given
the timescale and the amount of testing that would require), or passing
special flags to ShellExecute and running it as an external app - which
is messy, would require multiple windows to be up etc.

I even tried asking for the admin username/password & doing an
impersonate but LUA thwarts me again (my boss liked this version as he's
mostly an OSX user and wants a little padlock icon ideally.. can't see
how that would be implementable in LUA).

A similar problem exists with the server parts - several of them can be
run standalone as an unprivileged user (so I can't use
requireAdministrator), but there are operations that need admin access..
now these no longer work for administrators. I just need to elevate
privileges for maybe 2 or 3 instructions then back again.

How have others solved this?

Tony
Reply With Quote

Responses to "Manifests not working for control panel applets"

Josh
Guest
Posts: n/a
 
Re: Manifests not working for control panel applets
Posted: 05-31-2006, 01:36 PM
Tony,

Can you post the Manfest file you used here? What setting are you using in
your manifest, higest available, what?


josh
http://windowsconnected.com

"Tony Hoyle" <TonyHoyle@nospam.nospam> wrote in message
news:OHdQVBHgGHA.3916@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I've been testing my app on vista beta 2 and have hit a roadblock with
> LUA.
>
> One part of the app is a control panel applet. It exists solely to
> configure global settings used by the service, so it needs access to
> administrator priviliges to open the service control manager and to write
> to HKLM.
>
> When I started it as administrator it immediately barfed saying it
> couldn't open the SCM. No problem... I setup a manifest in the file set
> to requireAdministrator. This didn't work!
>
> It seems that control panel applets don't respect manifests at all.. which
> means I'm screwed, basically.
>
> I could rearchitect the file a bit.. I could do it with a priviliged
> thread etc. but I can't see any way of doing it - the documentation talks
> about rewriting the thing into a COM object (not an option given the
> timescale and the amount of testing that would require), or passing
> special flags to ShellExecute and running it as an external app - which is
> messy, would require multiple windows to be up etc.
>
> I even tried asking for the admin username/password & doing an impersonate
> but LUA thwarts me again (my boss liked this version as he's mostly an OSX
> user and wants a little padlock icon ideally.. can't see how that would be
> implementable in LUA).
>
> A similar problem exists with the server parts - several of them can be
> run standalone as an unprivileged user (so I can't use
> requireAdministrator), but there are operations that need admin access..
> now these no longer work for administrators. I just need to elevate
> privileges for maybe 2 or 3 instructions then back again.
>
> How have others solved this?
>
> Tony
Reply With Quote
Tony Hoyle
Guest
Posts: n/a
 
Re: Manifests not working for control panel applets
Posted: 06-03-2006, 01:29 PM
Josh wrote:
> Tony,
>
> Can you post the Manfest file you used here? What setting are you using
> in your manifest, higest available, what?
>
>
I eventually gave up... the manifest is correct (the same manifest in a
separate test executable produced an elevation dialog - albeit with
'unknown application' as the title), and the XP theming support works
just fine so it's being read.

I can see why - there's no way for an application to raise its own
privileges (even via LogonUser - tried that route.. there's no
CreateElevatedThread function either) - you have to create a new process
- and control panels are just DLLs running in the context of
control.exe, so can never be privileged.

MS seems to have got around this using HTML pages calling separate
applications... don't really have that option (since it wouldn't work
all the way back to NT4 which is a requirement for us).

Theres an executable in the system32 directory called
RunLegacyCPLElevated.exe which seems to work like rundll32... it's a
workaround for now... better than ditching vista compatibility efforts
completely.

The long term idea is to have a windows service running that takes
instructions from the control panel and makes changes as required, so
the app itself needs no privileges.. (now what would be really nice
would be a service that could create an elevated impersonation token for
a process... hmm...)

Tony
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control Panel Home Is Missing BillyBob Windows Vista File Management 4 09-09-2006 06:43 PM
Control panel view issue Vette Windows Vista Performance & Maintenance 19 08-14-2006 10:16 AM
User Account Control Panel xanatos Windows Vista Administration 4 08-03-2006 11:14 PM
Control panel issue!!! Kooby Windows Vista Performance & Maintenance 8 06-19-2006 04:25 PM
Repair icon the the control panel David Sherman Windows Vista Install & Setup 6 04-28-2006 04:03 PM