topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 7:49 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Dealing with UAC in portable tools  (Read 11377 times)

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • View Profile
    • Donate to Member
Dealing with UAC in portable tools
« on: February 27, 2012, 06:54 AM »
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,649
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #1 on: February 27, 2012, 07:10 AM »
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
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #2 on: February 27, 2012, 12:36 PM »
Thanks for writing that and pointing us to it.
I utterly detest UAC!

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,939
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #3 on: February 27, 2012, 12:57 PM »
UAC = Universal Acclaimed Cruelty?

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #4 on: February 27, 2012, 01:15 PM »
Ubiquitous Anguish Creator


(Actually I rather like it from an administrative standpoint)

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #5 on: February 27, 2012, 01: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.

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #6 on: February 27, 2012, 02: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

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #7 on: February 27, 2012, 02: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.

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #8 on: February 27, 2012, 02: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
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #9 on: February 27, 2012, 05:17 PM »
UAC = Universal Acclaimed Cruelty?
Round here it's viewed as an Unnecessarily Annoying Complication.

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 588
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: Dealing with UAC in portable tools
« Reply #10 on: March 02, 2012, 01: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.