Run as administrator

Wishlists for new functionality and features.
Post Reply
Bugmenot
Posts: 2
Joined: 27 Sep 2020 14:15

Run as administrator

Post by Bugmenot »

Hi,
I like HxD very much, but often I like to open a disk drive with write access which needs admin permissions. Usually I start HxD, try to open the drive and then remember I have to run it as an administrator. It would be nice if permissions could be given without reopening the program or at least without manually running it as an administrator. Notepad++ and TreeSize offer to restart the program as an administrator when permissions are insufficient. That would make using HxD a bit easier (it would be even better without a restart).

Maël
Site Admin
Posts: 1297
Joined: 12 Mar 2005 14:15

Re: Run as administrator

Post by Maël »

I considered implementing such a feature, but this is non-trivial due to arbitrarily large file support.
Also when disk editing, changes are kept in memory until saving on purpose (otherwise you have yet again to make sure you don't write on the disk you are editing, causing yet again odd inconsistencies that are hard to communicate to the user, and keep aware of when using HxD).

For security reasons, programs of different privilege levels should not communicate, or have minimal communication only.

That's why most programs just choose to restart with the opened files as parameter. This is not possible with HxD due to large file support and handling of changes. You would need to either write to the disk, which I try to avoid as said above, or copy memory from one HxD instance to another. This would leave a door wide open, which is hard to secure properly.

For simple things, such as changing Explorer integration in the options dialog, there is support for automatic elevation without restarting.

If you mainly edit disks, maybe you can just set HxD to run as admin by default (you can set this option in Windows' Explorer)?

Bugmenot
Posts: 2
Joined: 27 Sep 2020 14:15

Re: Run as administrator

Post by Bugmenot »

I tried your suggestion and enabled running as administrator by default, but it did not change anything. I see the setting is saved in the file properties, but it does not ask for elevation when starting the program and I cannot write to physical drives. I also tried using a link (.lnk), but had the same results. Maybe this is because the program is on a network share (served from Linux). (Usually I start the program by typing the file name in Everything as I have too many tools for putting them all in the start menu.)

I do not edit multiple files or drives at once, so for me it would be sufficient if it would restart with just the selected drive. It would save me a little time each time I forgot running it as an admin, but I also see it would take maybe too much of your time implementing it.

Maël
Site Admin
Posts: 1297
Joined: 12 Mar 2005 14:15

Re: Run as administrator

Post by Maël »

Bugmenot wrote:
01 Oct 2020 18:30
I tried your suggestion and enabled running as administrator by default, but it did not change anything. I see the setting is saved in the file properties, but it does not ask for elevation when starting the program and I cannot write to physical drives. I also tried using a link (.lnk), but had the same results. Maybe this is because the program is on a network share (served from Linux). (Usually I start the program by typing the file name in Everything as I have too many tools for putting them all in the start menu.)
I use Everything as well, and just tested it. When you search for HxD.exe then select properties and "run as admin" (approximately, different wording) in the compatibility settings, the next time you double-click the same HxD.exe from Everything it asks for elevation.
Bugmenot wrote:
01 Oct 2020 18:30
I do not edit multiple files or drives at once, so for me it would be sufficient if it would restart with just the selected drive. It would save me a little time each time I forgot running it as an admin, but I also see it would take maybe too much of your time implementing it.
Once it's partially there, people will complain that it is still not flexible enough.
The network share might well be the issue, it's possible that the admin setting is stored in NTFS alternative data streams, which is probably not a feature supported by network shares?

Post Reply