PDA

View Full Version : UAC problems



NewsArchive
09-11-2012, 01:45 AM
Hello,

I have a service manager app that is used to manage the 13 services that my
main app uses. The service manager app, via Capesoft's Self-Service, is used
to install the Windows service for the 13 service apps. Because the service
manager app is installing services it is required by Windows 7 to be run as
an administrator or Windows will not let it install the services.

I have set the embedded manifest to run the service manager app execution
level as "require Administrator". This works fine and the end user does not
have to fiddle with compatibility settings. But, every time the service
manager app is run, UAC kicks in and asks the user for permission to run the
app - I'm sure this is because it is being run as an administrator. This
service manager app is also started via the startup menu so if the computer
is rebooted, UAC kicks in again and ask for run permission. If the computer
does an unattended reboot this causes problems, obviously.

In the service manager app global properties where the manifest is set there
is a "Application requires UIAccess" checkbox - it appears that this
checkbox, when checked, will cause the UAC not to kick in for the app, but
this does not work for me.

Boils down to this - is there any way to avoid UAC asking for permission for
a "run as administrator" app, without turning off UAC?

C8.0 9034

regards,

Chuck

NewsArchive
09-11-2012, 01:46 AM
> Hello,
>
> I have a service manager app that is used to manage the 13 services that my
....
> manager app is run, UAC kicks in and asks the user for permission to run the
> app
....

Do you have SetupBuilder? Write a little script that takes a command
line param with the service request. Start, stop, install, remove...
whatever and set it to requrieAdministrator. Then set your service
monitor app to asInvoker and just shellexecute the SB script with the
command line set. Works like a charm, SetupBuilder rules.

Larry Sand

NewsArchive
09-11-2012, 01:46 AM
Larry,

Yes, I use Setup Builder, but the 13 services must be controlled from the
service manager app. It needs to stop and restart the services for various
reasons so there is no alternative to run it as an administrator. If all I
need to do was install the services then your suggestion would work.

regards,

Chuck

NewsArchive
09-11-2012, 01:46 AM
> Yes, I use Setup Builder, but the 13 services must be controlled from the
> service manager app. It needs to stop and restart the services for various
> reasons so there is no alternative to run it as an administrator.

Re-read what I wrote.

Your "service manager" program is run asInvoker.

It starts (using ShellExecute) the SB program with over the shoulder
auth becuase you have it set to asAdministrator. It then starts or
stops the service. SB has a number of service control options as
script commands. The SB script doesn't "install" anything, it's just
executes the service commands (pass them to it via the command line).

Our script looks something like:

If %SERVICEACTION% Equals "START" Then
If %SERVICEISRUNNING% Eqals "0" Then
Start Service "%SERVICENAME%"
End
ElseIf yada....

Read the SB help for FUNCTION:Check Service to know if it's installed
or running, and then read about Edit Service Function to
Start/Stop/Pause/Resume/Remove the service.

Larry Sand

NewsArchive
09-11-2012, 01:47 AM
Sorry Larry - I misunderstood you. That is a great idea. Thanks

regards,

Chuck