Page 2 of 3
Re: XYCopy 2.0 and UAC
Posted: 22 Aug 2011 19:13
by admin
nas8e9 wrote:admin wrote:The problem: I don't know how to detect whether the target requires elevation.
FWIW,
this post on StackOverflow suggests opening the (first) file for writing. If this throws an error, providing it can be handled silently, one could try an alternative action, i.e. Windows Shell copy. One caveat is that UAC virtualisation on Vista and later, makes writing to certain locations silently fail in the sense of redirecting the write, with those locations listed
here, meaning those locations would have to be hard-coded exceptions to Custom Copy.
Regardless of the above test, would it be an idea to hard-code those exceptions in Custom Copy? I'd guess that covers most cases where lack of file permissions cause a problem, although people disabling UAC wouldn't need this of course.
Or let the user add a list of folders where shell copy would be used?
Re: XYCopy 2.0 and UAC
Posted: 22 Aug 2011 20:17
by nas8e9
admin wrote:nas8e9 wrote:admin wrote:The problem: I don't know how to detect whether the target requires elevation.
FWIW,
this post on StackOverflow suggests opening the (first) file for writing. If this throws an error, providing it can be handled silently, one could try an alternative action, i.e. Windows Shell copy. One caveat is that UAC virtualisation on Vista and later, makes writing to certain locations silently fail in the sense of redirecting the write, with those locations listed
here, meaning those locations would have to be hard-coded exceptions to Custom Copy.
Regardless of the above test, would it be an idea to hard-code those exceptions in Custom Copy? I'd guess that covers most cases where lack of file permissions cause a problem, although people disabling UAC wouldn't need this of course.
Or let the user add a list of folders where shell copy would be used?
A user-defined Custom Copy blacklist with perhaps the UAC virtualisation folders included as factory-default, sounds good to me.
Re: XYCopy 2.0 and UAC
Posted: 22 Aug 2011 20:21
by admin
nas8e9 wrote:admin wrote:nas8e9 wrote:admin wrote:The problem: I don't know how to detect whether the target requires elevation.
FWIW,
this post on StackOverflow suggests opening the (first) file for writing. If this throws an error, providing it can be handled silently, one could try an alternative action, i.e. Windows Shell copy. One caveat is that UAC virtualisation on Vista and later, makes writing to certain locations silently fail in the sense of redirecting the write, with those locations listed
here, meaning those locations would have to be hard-coded exceptions to Custom Copy.
Regardless of the above test, would it be an idea to hard-code those exceptions in Custom Copy? I'd guess that covers most cases where lack of file permissions cause a problem, although people disabling UAC wouldn't need this of course.
Or let the user add a list of folders where shell copy would be used?
A user-defined Custom Copy blacklist with perhaps the UAC virtualisation folders included as factory-default, sounds good to me.
You mean these?
%Program Files%
%WinDir%
%WinDir%\System32
Re: XYCopy 2.0 and UAC
Posted: 22 Aug 2011 20:32
by nas8e9
admin wrote:nas8e9 wrote:A user-defined Custom Copy blacklist with perhaps the UAC virtualisation folders included as factory-default, sounds good to me.
You mean these?
%Program Files%
%WinDir%
%WinDir%\System32
Yes, and additionally %ALLUSERSPROFILE% isn't user-writable and on 64-bit Windows, %ProgramFiles(x86)% would also qualify.
Re: XYCopy 2.0 and UAC
Posted: 22 Aug 2011 20:36
by highend
A user-defined Custom Copy blacklist with perhaps the UAC virtualisation folders included as factory-default, sounds good to me
+1
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 02:02
by eil
admin wrote:Or let the user add a list of folders where shell copy would be used?
i don't really need it at the moment, but i feel it's a good feature

Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 10:56
by admin
nas8e9 wrote:admin wrote:nas8e9 wrote:A user-defined Custom Copy blacklist with perhaps the UAC virtualisation folders included as factory-default, sounds good to me.
You mean these?
%Program Files%
%WinDir%
%WinDir%\System32
Yes, and additionally %ALLUSERSPROFILE% isn't user-writable and on 64-bit Windows, %ProgramFiles(x86)% would also qualify.
Would this also include all subfolders of these dirs?
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 11:08
by highend
Inheritance is activated automatically so yes, all subfolders have the same access rights (at least for system folders, it can be different for the %allusersprofile% dir).
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 11:17
by admin
highend wrote:Inheritance is activated automatically so yes, all subfolders have the same access rights (at least for system folders, it can be different for the %allusersprofile% dir).
So %WinDir%\System32 does no have to be listed because it is implied with %WinDir% anyway.
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 11:31
by highend
admin wrote:So %WinDir%\System32 does no have to be listed because it is implied with %WinDir% anyway.
Correct.
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 15:22
by nas8e9
The root of the boot drive (on Vista and later always C:) also isn't user-writable. I'm not sure how the drive letter of the boot drive can be checked programmatically; should that be impossible, C: hardcoded would probably be the most pragmatic solution.
Unfortunately, the above would need to be an exception to the rule that exclusions are inherited from the top object.
Finally, the CustomCopyBlacklist.dat-file isn't yet included in the installer?
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 15:31
by admin
nas8e9 wrote:The root of the boot drive (on Vista and later always C:) also isn't user-writable. I'm not sure how the drive letter of the boot drive can be checked programmatically; should that be impossible, C: hardcoded would probably be the most pragmatic solution.
Unfortunately, the above would need to be an exception to the rule that exclusions are inherited from the top object.
Finally, the CustomCopyBlacklist.dat-file isn't yet included in the installer?
Hmm, simple things quickly attract complications... One might append a * to the paths that shall be blacklisted recursively.
Not sure if I should add it to the installer. I rather let it ripen first in the scarred hands of selected power users.
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 15:35
by nas8e9
admin wrote:nas8e9 wrote:The root of the boot drive (on Vista and later always C:) also isn't user-writable. I'm not sure how the drive letter of the boot drive can be checked programmatically; should that be impossible, C: hardcoded would probably be the most pragmatic solution.
Unfortunately, the above would need to be an exception to the rule that exclusions are inherited from the top object.
Finally, the CustomCopyBlacklist.dat-file isn't yet included in the installer?
Hmm, simple things quickly attract complications... One might append a * to the paths that shall be blacklisted recursively.
At first sight the root of the boot drive, is the only one that shouldn't be handled recursively. Perhaps only marking the exception to the rule with a "*"?
admin wrote:Not sure if I should add it to the installer. I rather let it ripen first in the scarred hands of selected power users.
Got it.
Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 15:42
by admin
nas8e9 wrote:At first sight the root of the boot drive, is the only one that shouldn't be handled recursively. Perhaps only marking the exception to the rule with a "*"?
Since the list is open for any user-specific additions and since an appended * (at least to me) seems a quite natural way to say "including all contents" I would rather stay with my initial suggestion. But maybe further still invisible complications will call for yet another way...

Re: XYCopy 2.0 and UAC
Posted: 23 Aug 2011 16:03
by nas8e9
admin wrote:nas8e9 wrote:At first sight the root of the boot drive, is the only one that shouldn't be handled recursively. Perhaps only marking the exception to the rule with a "*"?
Since the list is open for any user-specific additions and since an appended * (at least to me) seems a quite natural way to say "including all contents" I would rather stay with my initial suggestion. But maybe further still invisible complications will call for yet another way...

I forgot the general meaning of "*" as a wildcard. Sounds good to me.