Which parts of the framework require a user to be more than a Standard User? The reason I'm asking is because I'm trying to compile a list of possible issues with our existing applications when migrating to Windows 7.
Now, I can think of a few things myself:
I really would like a more complete list and so far I've not come across a decent resource in which all this stuff is listed.
Note that I'm not looking for ways of elevating the privileges for the existing apps (which can be done by using a manifest), I'm simply identifying actions in code that might cause issues.
Well, your examples don't really have anything to do with Windows 7 or .NET. Actually they were already part of the "Designed for Windows NT 4.0" logo requirements. If you have written your application in a way that non-admin users were able to run it on NT, Win2k or XP, it will just work fine on Vista/Win7.
There is another common pitfall when you run your software on x64 systems (however this too isn't specific to Win7 but is true e. g. for Win2003 Server x64 or Win XP x64 as well): If you are working with native 32-bit code, like calls to a native DLL or COM interop with a in-process component), make sure to select "x86" as the platform target in Visual Studio project settings instead of "Any CPU". Otherwise your application will run as a 64 bit process, and you can't mix 32 and 64 bit code in the same process, so you would run into errors.
And of course, as it always has been best practice, use Environment.GetSpecialFolders
instead of hard-coded paths.
Thinking of it as "What library calls" is going to lead you down the wrong path. Think about anything that writes to a file. If that file is under Program Files (among other places), you need admin privs. If it's under AppData, you don't. Same library call, different outcomes. Ditto for writing to the registry - HKLM you need admin, HKCU you don't. Writing to Event Log is generally ok but creating your event source is not. And so on. It's not about what method you call, it's more about the params (eg path) you pass to it.
I don't believe getting environment variables need elevating privledges. At least I've never run into it, are there really cases where that's true?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With