Vista difficulties

B

Bruce

Under Vista, the Dev Studio program installer adds a desktop shortcut
to the Desktop. (.Net application.) The shortcut does not have a
context menu item to run as administrator. However, if you create a
shortcut manually from the exe file it does have a context menu item
to run as administrator. Why are they different?

The big question is, why does the program only run if you run as
admin???
 
P

Peter Duniho

Under Vista, the Dev Studio program installer adds a desktop shortcut
to the Desktop. (.Net application.) The shortcut does not have a
context menu item to run as administrator. However, if you create a
shortcut manually from the exe file it does have a context menu item
to run as administrator. Why are they different?

Good question. This is a pet-peeve of mine: the Windows shortcut file
format allows for customing the right-click menu, including not including
the "Run As..." item. And Windows provides no way to go in and change the
shortcut. I haven't looked too closely at the specifics, but I've always
been able to find the target application for the shortcut and run that
directly with "Run As...", or create a new, more conventional shortcut
that I can use the "Run As..." from.

Now, that said...assuming you're talking about running Visual Studio, it
should run just find without you being an admin. You do have to run it
once as an admin, to make sure some things are initialized properly, but
even that isn't strictly necessary (as near as I can tell, it's some
indexes that make certain things work better).

I think it's poor design to do it that way: the installer should
initialize whatever things need to be initialized so that non-admin users
can run the program immediately after installation. But the work-around
is pretty direct and harmless. Just run as admin once, and then you're
good to go. No "Run As..." necessary.

Pete
 
B

Bruce

I should have made it clear that this was not Dev Studio but an
application we develop
and trying to get the kinks worked out under Vista. We cannot get it
to run under a
normal user account unless we run as admin. Any ideas about that?
 
M

Mr. Arnold

The big question is, why does the program only run if you run as
admin???

That's because of UAC and escalated user privileges, and in some cases, even
a user that has Admin rights is forced to a Standard user model to protect
the O/S, for what that's worth, the privileges must be escalated by using
Run As Admin.

You can always disable UAC, but in doing that where applications are looking
at UAC, it may cause said application to terminate.

http://www.winsupersite.com/showcase/winvista_ff_uac.asp
 
G

Guest

you need a manifest to "Make" your executable run as Adminstrator:

<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" >
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="someExecName"
type="win32" />
<description>Program description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>


If you search in this group, Willy DeNoyette has a much more detailed post
on this which the above was extracted from.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
 
W

Willy Denoyette [MVP]

Bruce said:
Under Vista, the Dev Studio program installer adds a desktop shortcut
to the Desktop. (.Net application.) The shortcut does not have a
context menu item to run as administrator. However, if you create a
shortcut manually from the exe file it does have a context menu item
to run as administrator. Why are they different?

The big question is, why does the program only run if you run as
admin???


In top of what peter said, the program runs when not running as an admin,
all you get is a dialog that it is "recommended" to run as administrator,
but for most of the development tasks it's safe to run as admin.
If you don't get that dialog, make sure you have installed SP1 and the
update for SP1 for VS2005 for Vista.

Willy.
 
W

Willy Denoyette [MVP]

Bruce said:
I should have made it clear that this was not Dev Studio but an
application we develop
and trying to get the kinks worked out under Vista. We cannot get it
to run under a
normal user account unless we run as admin. Any ideas about that?

That means that your tries to execute some API or API's that needs
"administrator" privileges, that also means that this code needs an
administrator account to run on XP. What exactly are you doing in this
application, is this an administrative application or not?

Willy.
 
P

Peter Duniho

you need a manifest to "Make" your executable run as Adminstrator:
[...]
If you search in this group, Willy DeNoyette has a much more detailed
post on this which the above was extracted from.

I don't suppose VS provides a more user-friendly way to edit the manifest
than copying and pasting that example into the XML file?

For example, a little checkbox that says "Require Administrator". :)

Pete
 
W

Willy Denoyette [MVP]

Peter Duniho said:
you need a manifest to "Make" your executable run as Adminstrator:
[...]
If you search in this group, Willy DeNoyette has a much more detailed
post on this which the above was extracted from.

I don't suppose VS provides a more user-friendly way to edit the manifest
than copying and pasting that example into the XML file?

For example, a little checkbox that says "Require Administrator". :)


This (and some other issues) is taken care of in Orcas, for the time being
you can do this from a post build step.

Willy.
 
C

Cowboy \(Gregory A. Beamer\)

It has to do with the way Vista interprets the install, which was created
prior to Vista. With SP1 and the Vista patch installed, it will bring up a
dialog box that informs you to run as admin. I believe this fixes the
shortcut, as well, but I am not certain.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top