DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Dealing with UAC in portable tools  (Read 16,097 times)

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • Participated in NANY Challenge Three Times
Dealing with UAC in portable tools
« on: February 27, 2012, 12:54 PM »
Hi all,

I am not sure if addressing UAC issues in Vista and Win7 interests many of you, but I have finally bitten the bullet and implemented saving to UAC-protected folders in my tools. In the end it was not so hard, but it was not trivial either and it is easy to get stray away while looking for the easiest solution. If you decide you want your software to save to UAC-protected locations (after the user confirms that dreaded dialog box) instead of displaying an error message, you may find my latest blog entry with code snippets useful: http://www.rw-designer.com/entry/531

V.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: Dealing with UAC in portable tools
« Reply #1 on: February 27, 2012, 01:10 PM »
Now that is interesting...I didn't know MS had its own rabbit hole in UAC, thanks for sharing.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Dealing with UAC in portable tools
« Reply #2 on: February 27, 2012, 06:36 PM »
Thanks for writing that and pointing us to it.
I utterly detest UAC!
Chris

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,954
Re: Dealing with UAC in portable tools
« Reply #3 on: February 27, 2012, 06:57 PM »
UAC = Universal Acclaimed Cruelty?
The easy path is usually downhill...

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: Dealing with UAC in portable tools
« Reply #4 on: February 27, 2012, 07:15 PM »
Ubiquitous Anguish Creator


(Actually I rather like it from an administrative standpoint)

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
Re: Dealing with UAC in portable tools
« Reply #5 on: February 27, 2012, 07:18 PM »
Anyone who hates UAC obviously never used Linux or OS X. Neither of those systems have the concept of a "protected desktop" so instead of a simple Yes/No prompt, they have to get you to type in a password every single time you do anything that needs elevation. OS X in particular is the worst, when installing large software such as Xcode you'll be asked to type in your password multiple times, I'm talking 5+ times, during the install process.
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • Participated in NANY Challenge Three Times
Re: Dealing with UAC in portable tools
« Reply #6 on: February 27, 2012, 08:29 PM »
UAC in Vista was annoying, but at least it offered some additional protection. I agree that just pressing "OK" button is better than typing a password in Linux.
UAC in Win7 is a joke. In the default mode, Microsoft's application are white-listed and do not show prompts. But it is trivial to manipulate Microsoft's executables into running any code. Hence: Win7 UAC in default mode offers virtually no protection from malware and non-Microsoft tools must show annoying prompts or fail (or exploit the security holes)... You get the worst of both worlds.

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
Re: Dealing with UAC in portable tools
« Reply #7 on: February 27, 2012, 08:35 PM »
I agree the default is plain silly. Personally I always bump the setting up to maximum on my own machine as well as I any I install for others.
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • Participated in NANY Challenge Three Times
Re: Dealing with UAC in portable tools
« Reply #8 on: February 27, 2012, 08:45 PM »
That makes sense for everyone, who cares about security. The other sensible setting suitable for more adventurous people is enabling silent elevation for every process - just as secure as the default setting and no prompts.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Dealing with UAC in portable tools
« Reply #9 on: February 27, 2012, 11:17 PM »
UAC = Universal Acclaimed Cruelty?
Round here it's viewed as an Unnecessarily Annoying Complication.
Chris

worstje

  • The Gent with the White Hat
  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 589
    • Coding Snacks
    • Participated in NANY Challenge Three Times
Re: Dealing with UAC in portable tools
« Reply #10 on: March 02, 2012, 07:03 AM »
Thanks for sharing this with us, vlastimil!

Save for the Explorer object, which is a very interesting find I must say, I already figured out these things back when I wrote JottiQ for NANY 2011. My solution is basically the 'spawn myself as an elevated process', where commandline switches describe the actions to be taken. As JottiQ never saves stuff, it is only for certain changes in the registry, so I escaped most of the hell you had to go through.

Original address: https://www.donationcoder.com/forum/index.php?topic=30106.0