Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

sc.exe in vista .... another example of shelling commands in vista ...

Updated: 21 May 2010 | 4 comments
Prafful Sharma's picture
0 0 Votes
Login to vote
I have ended up in a scenario in Vista again .....

In Vista a MSI is already installed successfully, with a service "ABC" running fine.

now another user logs in as a "An administrator" in vista 
(i.e the user who was created by the administrator himself) ... the new msi wants to stop the already running service "ABC" to actually copy new content.

But the attempt was un-successfull as strict vista security complains "Access is denied".

The service is not able to be stopped by the user who wants to run the upgrade to the already installed MSI.
---------------------------------------------------------------------------------------------------------------------------------------------------------

I believe strict security of vista stops the user from stopping the service if,

sc.exe Stop "ABC" was issued ... vista doesn't stop the service.

is there a way to run a in-process command or another way to ensure that the service 
in stopped by using a already available command in Vista or using any wise custom actions.


Any further advice is highly appreciated.

With Regards
Prafful Sharma
Discussion Filed Under:

Comments

EdT's picture
20
May
2009
0 Votes 0
Login to vote

Does this work with UAC turned off?

With UAC turned on, Vista requires elevation for any tasks that require administrative access, as vista administrators only have standard user permissions by default.
(hence the "Run as Administrator" right click option when starting apps from the start menu).

You may therefore need to run the upgrade as an EXE using a manifest to "Run as Administrator"

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Prafful Sharma's picture
20
May
2009
0 Votes 0
Login to vote

works with UAC turned off

This works fine with UAC turned off. "run as administrator" may be an extra effort to install the product. If there was a custom action which could be utilized to automatically launch run as administrator or either, it would simplify end user experience. Thanks

EdT's picture
20
May
2009
0 Votes 0
Login to vote

If only...

"If there was a custom action which could be utilized to automatically launch run as administrator or either,
it would simplify end user experience."

That would make it easy for virus writers to circumvent Vista security and install their malware without involving the user at all.
You might as well instruct your users to turn off UAC and let them install without having to make any extra effort.........

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Prafful Sharma's picture
26
May
2009
0 Votes 0
Login to vote

bootstrapper ....

There may not be a custom action to handle this.

But I found something intersting on one of the MSDN sites postings recently ...

I have created a bootstrapper EXE. 
This bootstrapper unpacks the binaries to a temp location and then starts another process that initiates the installation.
When the process that started the installation completes, it returns control to the unpacker that starts the application.
This way the application is running with the standard user token.

this lets the sub-admin to actually bypass the "Access is denied" and kills the service behind the scenes.


Thanks.