PDA

View Full Version : Compatability Mode



NewsArchive
10-14-2007, 08:21 PM
Relating to another thread I raised regards Vista and UAC I have now find
another anomaly perhaps.

If my manifest is set to "asInvoker", what happens if I set Compatibility
Mode to "Run as an Administrator"? I use Compatibility Mode to disable
Themes.

Does this override the manifest settings and is it only here in case a
manifest has not been added?

Bottom line - I have a problem apparently writing to the registry sometimes.
So if my Manifest is "asInvoker" and my Compatibility Mode set to "Run as
Administrator" would this resolve the problem?

TIA

John Fligg

NewsArchive
10-14-2007, 08:21 PM
John,

If administrator execution level privileges are requested in a manifest OR
in the application compatibility settings, then UAC will prompt the user for
elevation (even if your application is marked as "asInvoker").

But you should never do this! A standard application should not request or
require administrator execution level privileges. IMO, something is wrong
with your registry function (e.g. it tries to get full access privileges or
something like that).

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
10-14-2007, 08:22 PM
Thanks Friedrich. That clears that up.

But the underlying problem I still have, accepting that I need to check out
the registry template, is why would this only ever do it on one machine and
not my Vista machines here in the office?

Somehow I need to recreate this clients configuration (and Janes) so I can
see if my "fix" works.

Jane says "I installed your demo on a Vista Ultimate machine with default
security (UAC, etc.). " and it failed to get the registry values yet when
she right clicked on the shortuct and ran as an administrator it worked.

HTH

John

NewsArchive
10-14-2007, 08:22 PM
Hi John,

As I understand it, Jane can reproduce this problem with your asInvoker
application. IMO, it's definitely caused by the registry template. Perhaps
your registry function opens (for whatever reason) the registry with
KEY_ALL_ACCESS (combines the all possible access rights). This may fail
under Vista if you do not have administrator execution level privileges.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
10-14-2007, 08:23 PM
Hi John,

BTW, if your application (or template) tries to open the registry key with
"full" access, just change it to "read/query" only and you are done.

Friedrich

NewsArchive
10-14-2007, 08:23 PM
Thanks Friedrich - I can certainly change to use the standard Clarion
registry functions.

In the meantime this particular client is getting pretty nasty. There's
always one. Also I am not really all that familar with Vista, UAC and
priviledges.

Can you suggest some wording I can send him to find what his execution level
settings are for a non computer literate person. i.e. a step by step idiots
guide for him to follow and report back to me. I can then use those also to
check out what my settings are here in the office.

I ask because he steadfastly refuses to take any upgrade unless it is
guaranteed to fix the problem so changing the code and sending it is not an
option here.

Many thanks

John

NewsArchive
10-14-2007, 08:24 PM
Hi John,

If the read registry function in your application fails on his machine, then
I assume he is running as a Standard User. So your application does not run
elevated. If he starts your app with "Run as administrator" then Vista will
prompt for the admin password and your "asInvoker" application will execute
elevated. In this case, your read registry function will work as expected
(IMO).

BTW, did I misinterpret your previous message? As I understand it, Jane can
reproduce the read registry issue, right? Your app cannot read the registry
when running unelevated - but it works when running with administrator
execution level privileges (elevated)? If this is the case, just check your
registry template and find all instances where full access is requested.
Then change it to a "read/query" equivalent and this should fix the problem.
And of course, the standard (built-in) C6 read/write registry functions are
also Vista compatible.

Does this help?

Friedrich

NewsArchive
10-14-2007, 08:24 PM
OK Friedrich. Yes you did read me orrectly and have understood the situation
correctly.

I have checked the template but it all a bit "gobbledygook" to me. The ONLY
thing I can see in there that has any remote reference is:

KEY_READ equate(band(STANDARD_RIGHTS_READ + |
KEY_QUERY_VALUE+ |
KEY_ENUMERATE_SUB_KEYS + |
KEY_NOTIFY, |
NOTSYNCHRONIZE) |
)

In any event, because of my concerns it would be so much easier to simply
change to Clarion functions instead. At least I know that everything is
compatible.

The ONLY thing that concerns me is that when the user right clicked on the
shortcut and ran as administrator, he said it did NOT fix the problem. Of
course I have no idea what he said to the prompts etc. and to be honest
cannot really trust what he is telling me!

John

NewsArchive
10-14-2007, 08:25 PM
> The ONLY thing that concerns me is that when the user right clicked on the
> shortcut and ran as administrator, he said it did NOT fix the problem. Of
> course I have no idea what he said to the prompts etc. and to be honest
> cannot really trust what he is telling me!

Hi John,

With respect to the above, is it feasible in this case to have "him" send
you a Remote Assistance request so you can see for yourself what is
happening on his PC??? And maybe even "fix" the problem for him???

JAT

--
Best Regards,
Earl R Coker
www.kwiksystems.net
www.kwiksystems.com
www.kwiksystems.net/appshell/index.htm
www.kwiksystems.com/clarion.htm (BigTamer(tm) Templates)

NewsArchive
10-14-2007, 08:27 PM
Good idea and not wishing to put any obstacles in the way <g>:

1. I have never used Remote Assistance so a bit dubious about doing anything
when not sure myself
2. In the current climate, the less I have to do with htis machine directly
the better. If I change anything he will always be back on to me.

A good suggestion all the same and thanks but I feel that fixing the problem
is probably best. Once I can recreate it on my machine I can test my fix
(i.e removing the template and putting in my own code). But I need to set my
machine up so that it fails from the get go.

I am not sure what to set up on our Vista boxes here so that I am a Standard
user. I think I changed something in the early days because Vista was a
total nightmare so not sure how to reverse it. It was something in the UAC.

Many thanks

John

NewsArchive
10-14-2007, 08:27 PM
Hi John,

> I am not sure what to set up on our Vista boxes here so that I am a
> Standard user. I think I changed something in the early days because Vista
> was a total nightmare so not sure how to reverse it. It was something in
> the UAC.

Just create a new user account (Standard User) and switch to it. Takes only
10-20 seconds.

Friedrich

NewsArchive
10-14-2007, 08:28 PM
<g> Thanks Friedrich. Will do that tomorrow and do a before and after test
and change my code in the meantime to ditch the template.

Thanks for all your help and sorry to have taken up so much time.

John

NewsArchive
10-14-2007, 08:28 PM
If he's turned off UAC altogether (whether in Control Panel or through Local
Security Policy), just creating a new account won't suffice. He needs to
turn UAC back on.

Jane

NewsArchive
10-14-2007, 08:31 PM
Hi John,

See below...
--
Best Regards,
Earl R Coker
www.kwiksystems.net
www.kwiksystems.com
www.kwiksystems.net/appshell/index.htm
www.kwiksystems.com/clarion.htm (BigTamer(tm) Templates)


> Good idea and not wishing to put any obstacles in the way <g>:
>
> 1. I have never used Remote Assistance so a bit dubious about doing
> anything when not sure myself.

Find someone to learn about Remote Assistance with and do a practice session
or two. Click on [Start] >> Help and Support >> Invite a friend to connect
to your computer with Remote Assistance and then follow the prompts. I
think the easiest way to send a request is to send the request by email.
Here is are some links about how to use Remote Assistance...

http://technet.microsoft.com/en-us/library/bb457004.aspx

another one...

http://www.microsoft.com/windowsxp/using/helpandsupport/learnmore/remoteassist/intro.mspx

and another one...

http://www.onecomputerguy.com/networking/winxp_remote_assistance.htm

> 2. In the current climate, the less I have to do with htis machine
> directly the better. If I change anything he will always be back on to me.

Well then, just be an "observer" and tell him that all you want to do is to
"see/observe" what he is experiencing "so you can (try) and help him with
the problem and that you do NOT want to do a request to "take control" of
his PC while using Remote Assistance. Remote Assistance only allows you to
"observe" what is happening on the "remote/connected" PC UNLESS you "take
control".

The operator of the Remote PC must AUTHORIZE your REQUEST to take control of
the Remote PC. Of course it would be a good idea to be on the phone with
them at the same time or else you can use the "chat" feature built into
Remote Assistance. The way it works is that you can request to "take
control" of the remote/connected PC from your PC but then he/she must click
on a button in a dialog box on the remote/connected PC to AUTHORIZE that
(e.g. give you permission) or you can't take control of the remote/connected
PC. Doing this Remote Assistance thing seems to me to be a very good way
(maybe the only way) for you to "really" find out "for sure" actually what
the problem (e.g. what his "setup") is. <g>

> A good suggestion all the same and thanks but I feel that fixing the
> problem is probably best. Once I can recreate it on my machine I can test
> my fix (i.e removing the template and putting in my own code). But I need
> to set my machine up so that it fails from the get go.
>
> I am not sure what to set up on our Vista boxes here so that I am a
> Standard user. I think I changed something in the early days because Vista
> was a total nightmare so not sure how to reverse it. It was something in
> the UAC.

My WAG is that you probably disabled UAC. Just re-enable it again.

NewsArchive
10-14-2007, 08:32 PM
Many thanks Earl. I do not want to sound ungrateful in any way and I have
saved your valued input.

As Friedrich says, this is almost definitely to do with the registry
template I am using. I will switch our Vista boxes as suggested and see what
happens before and after the code changes.

If that does the trick and his problem is still there then it's down to him
or his adminstrator!

Many thanks

John

NewsArchive
10-14-2007, 08:33 PM
Hi John,

> The ONLY thing that concerns me is that when the user right clicked on the
> shortcut and ran as administrator, he said it did NOT fix the problem. Of
> course I have no idea what he said to the prompts etc. and to be honest
> cannot really trust what he is telling me!

Okay, I understand.

If running as administrator really does not fix it for him, then perhaps he
(or his admin) played with the registry security levels. There are levels
of security that will keep you from even reading a registry key.
KEY_QUERY_VALUE is a right that can be denied. In this case, your function
would fail.

What you can do is the following. Recompile your main application .exe.
Create a new full install for him and change the requested execution level
for your application (#embed Vista manifest...) from "asInvoker" to
"requireAdministrator". But do this just for him (to test it)!!! This will
make sure your application is running elevated.

What do you think?

BTW, but it's definitely caused by your registry functions. That's why it
worked fine when Jane tested it with admin execution level privileges.
Something in the registry stuff does not play nicely with UAC.

Friedrich

NewsArchive
10-14-2007, 08:35 PM
Friedrich,
I ran John's installer last night on a Vista Ultimate machine with default
UAC settings.
No problems with the installer.
His main app has an asInvoker manifest.
In HKLM are settings for default language for the app (pic). No settings
that I can find in HKCU.
When I run his app normally, it comes up with an error message about not
being able to read the language information (from HKLM) (pic)
If I right-click the shortcut and Run-As-Administrator, no problems.
He's using some library to read the registry other than the built-in Clarion
GetReg command, and I'm guessing it's asking for write access at the same
time.

Jane

NewsArchive
10-14-2007, 08:36 PM
Hi Jane,

Hmm, do you think this is an "official" Windows error message?

Perhaps a message from a license protection software or the GetReg system
itself. IMO, this is not a Windows error message <g>

Friedrich

NewsArchive
10-14-2007, 08:37 PM
No, I think it's John's own error message.
If I click No rather than accepting the default language choice, the next
screen is a rather obviously Clarion halt screen (pic).

Jane

NewsArchive
10-14-2007, 08:38 PM
Yes, I agree.

Friedrich

NewsArchive
10-14-2007, 08:39 PM
<g> Yes it's MY message. No produces the HALT but YES allows the user to
continue.

HTH

John (busy taking the template out of my apps!)

NewsArchive
10-14-2007, 08:40 PM
Hi Jane,

Re-read your message and I am sure it's a message from the application.

What happens if you write a quick SetupBuilder application, set the
Requested Execution Level (General Information) to "asInvoker" and then use
"Get Registry Key Value" to read one of the "Country" value from the
Dentists Manager" registry key?

Can you display the retrieved value or does it return an error? Don't have
access to a Vista machine right now so I cannot test it myself.

Friedrich

NewsArchive
10-14-2007, 08:43 PM
Didn't bother with an SB project, just a little test app (attached) that
reads it fine (pic) using GetReg.
Jane

NewsArchive
10-14-2007, 08:43 PM
Hi Jane,

Confirmed. And I created a small SetupBuilder "asInvoker" app to simulate
it. I have access to my Vista machines now - works without any problem in
Standard User mode.

Tested on Vista Ultimate (32- and 64-bit) and Vista Business (32-bit).

Friedrich

NewsArchive
10-14-2007, 08:45 PM
Hi Jane, John,

>In HKLM are settings for default language for the app (pic). No settings
>that I can find in HKCU.
>When I run his app normally, it comes up with an error message about not
>being able to read the language information (from HKLM) (pic)

If you run RegMon from Sysinternals, you can observe exactly what
registry keys are accessed and what access is requested. It runs fine
under Vista. It is absolutely invaluable in helping determine what is
going on with the registry. As with other SysInternal tools you can
limit it to a selected application to filter out any other junk.

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
10-14-2007, 08:45 PM
Arnór
I agree that procmon can be invaluable.
My little experiment with John's app last night was just a brief "does it
work" punctuated by a glass of cabernet. That it ran under "as
administrator" and errored normally was all I was looking for at the moment.

I don't know for sure that John turned off UAC at some time (some of his
posts in the threads today make me think he probably did), but that's why I
think it's SOOOO shortsighted for the developers we've seen who post here
how they hate UAC and automatically turn it off. How can you test your
software if you do???

Jane

NewsArchive
10-14-2007, 08:46 PM
Hi Jane,

>I agree that procmon can be invaluable.

I like RegMon better for registry stuff as then there is nothing else
cluttering the scene<g>

>think it's SOOOO shortsighted for the developers we've seen who post here
>how they hate UAC and automatically turn it off. How can you test your
>software if you do???

Absolutely. I'm not turning it off on my Vista machine, even though
it can be a bit of a bother (not much really). Although I suspect
that most Clarion developers are logged in as administrators and as
such have a bit more access than regular users, that would be an
unwise assumption for the general public. So I'm not too frantic
about 3rd party tools, but anything that goes out in public has to be
tested back and forth with UAC and made sure it works:)

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php