Re: Vista and Elevation
- From: "Dan Tallent" <spam@xxxxxxxxxxxxx>
- Date: Fri, 23 Mar 2007 08:36:45 -0400
The problem with this method is the code needs validated. It must be a
"good" code for the program to accept it. The routine was quite complicated
for encrypting these codes, and it was written in VFP.
The reason I choose to ask for the code when you first run my app is because
all the required resource files have been installed at this point.
My directive is to get it to work for Vista so we can continue adding
features.. as quickly as possible.. so I am trying not to rewrite massive
amounts of code.
Thanks
Dan
"Craig Berntson" <craig@xxxxxxxxxxxxxxxxx> wrote in message
news:uiSng7MbHHA.2552@xxxxxxxxxxxxxxxxxxxxxxx
Instead of asking for the code on first use, make it part of the Setup
program, which runs under elevated Amin level.
--
----
Craig Berntson
MCSD, Visual FoxPro MVP
Salt Lake City Fox User Group
"Dan Tallent" <spam@xxxxxxxxxxxxx> wrote in message
news:uIi%23tPLbHHA.2552@xxxxxxxxxxxxxxxxxxxxxxx
Hello all!
I have been working for 2 days trying to figure out how to change my
application (written in VFP9) to work with Vista. The first objective
is writting to the registry. The way our application works... the first
time you launch it, it asks for a Code. The user enters this code and
the program saves it to the registry under HKEY_LOCAL_MACHINE.
This works great under XP. This way if they change users or they are
running terminal server, they all find this entry in the same location.
In order to write to the HKEY_LOCAL_MACHINE on Vista, you must be
elevated to Administrative level. I have read several articles on
how to achieve this, but the common belief is to create a separate
program that can be run from your main program. This new "separate"
program should be setup to require administrative rights using a manifest
file. Now the trick I needed to pull off was to be able to call this
program and wait for it to close. I tried a few solutions... but the
one that seemed to work best for me was to create a third program. This
third program will be a COM Object accessable by Foxpro, with the sole
purpose of running the "separate" program mentioned above and wait for it
to close. I call the COM Object from VFP and it stops the VFP programs
execution until the separate program is closed. Perfect!
It seems like I found the answer.. but because I knew it had to be too
good to be true I decided to test a little. I created two shortcuts on
my Vista desktop. Both shortcuts run Foxpro 9, but one is flagged as
"Run as Administrator" and labeled "Admin". The other shortcut runs as
Standard User is titled "Standard". When I run the Standard VFP
shortcut and execute the Com Object, everything is perfect. Life if
great! Now I tried to run the VFP shortcut "Admin" and access the COM
Object. Here is where the problem is.....
Class definition x.y is not found
Help! I don't know what to do next. When I run the "Admin" shortcut,
Vista prompts be to "Allow / Cancel". It is elevating my instance of VFP
to Admin level. But when I attempt to execute the COM Object it cannot
find the class definition.
Any ideas on how to get around this "little" problem? How is everyone
else handling this?
Thanks
Dan Tallent
.
- Follow-Ups:
- Re: Vista and Elevation
- From: Craig Berntson
- Re: Vista and Elevation
- References:
- Vista and Elevation
- From: Dan Tallent
- Re: Vista and Elevation
- From: Craig Berntson
- Vista and Elevation
- Prev by Date: Re: buffering
- Next by Date: Re: Vista and Elevation
- Previous by thread: Re: Vista and Elevation
- Next by thread: Re: Vista and Elevation
- Index(es):
Relevant Pages
|