PDA

View Full Version : Vista, UAC, User accounts etc. - SORTED!



NewsArchive
10-16-2007, 02:24 AM
I am posting this by way of attempting to help the Clarion community as I
have learnt several valuable lessons this weekend.

I would also like to publicly thank everyone who has contributed to the
threads recently.

Lesson 1 - DO NOT under any circumstances turn off UAC in Vista as quite
correctly identified by Jane. It caught me out. If you do, then in some
circumstances your software can fail and you will not know about it.

Lesson 2 - Create a Standard User account with absolutely no privileges and
test your software using that. Also combine this with Lesson 1. Again as
suggested by Arnor.

Lesson 3 - Make all your installs Vista compatible and what better product
than Setup Builder to do that. Has that helped me out or what recently!

Lesson 4 - Make sure that your 3rd party tools are completely Vista
compatible. This can be in any way from the location of ini files to
actually working!

What happened to me was the following .....

I was reading a value from the registry at startup and if the value was not
there then the program issued a warning. A client (only one out of hundreds)
reported the warning on a Vista box. We could not replicate that here. What
we did not know was that (a) we had turned off UAC and (b) not created a
Standard Account. (c) we had no idea what setup our client was using.
Replicating his "assumed" setup finally revealed the problem in about 10
seconds. He was a Standard User with no privileges.

A third party registry management template we use was presumably trying to
gain write access to the registry despite only supposed to be reading a
value, which with a Standard Account with no privileges would not work.
Hence our error message. The classic Vista scenario - well the data is there
but is actually only a virtual representation of it.

The writer of the template has now been in touch saying that he will look
into the matter but had not thought about Vista which in itself should be a
lesson. I cannot blame him because I should have taken the responsibility of
making sure it was Vista compatible.

I have now changed my code and re testing the "fix". YES It works.

Hopefully, from my mistakes and assumptions others may learn and not end up
wasting 3 days chasing what turned out to be a very simple problem.

Many thanks to all again who contributed.

John Fligg

NewsArchive
10-16-2007, 02:25 AM
John,

A couple of comments from the "peanut gallery'.

1. Welcome to the converted ;) To me, turning off UAC on a development
machine is both irresponsible and petulant.

2. I always do this on XP or earlier. But actually, my testing of your
UAC problem was done on an Ultimate and a Home Premium box using an
administrator account. However, unless you specify Run-as-administrator (or
your app's manifest is requireAdministrator), the "administrator" user is
actually running as a standard user due to the split token that Vista
introduces. Still a good idea to use a "normal" account as far as any
possible NTFS permissions issues go.

3. But of course :D

4. FM3's upgrade file is one specifically to remember.

4+. Actually, virtualization was NOT a factor in this error. Because your
app has a Vista-aware manifest, Vista didn't virtualize the attempted
registry write. It just blocked the call. You can verify this by checking
the virtual path in the registry (see my second clarionmag.com article on
virtualization). With virtualization, rather than an outright failure
you're more likely to get data that's incorrect (unless yours is the only
user account on the machine.)

4++ "Simple" problems are "simple" once you've seen the solution <G>

Jane