Author Topic: Need to support Vista with UAC enabled  (Read 1659 times)

Offline Scott Bilas

  • Jr. Member
  • **
  • Posts: 51
  • Karma: +2/-0
    • View Profile
    • New Fun Blog
Need to support Vista with UAC enabled
« on: April 28, 2009, 09:58:22 pm »
One one of my machines I use Vista with UAC enabled. HippoEdit does work in this configuration, but it's not UAC-compliant. I noticed this because HE tries to write to the Program Files, but those modified files end up in the VirtualStore under my local settings in my profile.

For example, crash dumps, the license file, .config, workspaces, and changes to edited syntax files all end up here.

Some problems with this:

  • Microsoft recommends not relying on the Virtual Store because they may take it out in the future or modify its behavior. It's purely meant for pre-Vista apps to be forward-compatible.
  • If the user disables UAC, then suddenly the VS is no longer used and all of their customized settings are apparently "lost", because it now uses the original files from Program Files.
  • It's confusing to users who are editing syntax or user specs in HE from the options menu. They think they're editing files in Program Files yet when they save them, they're really saving to the VS.
  • Upgrade installs are supposed to rename customized versions of syntax etc. to '.old' right? As a safety feature? I thought I read that on these boards somewhere. Well when the VS is used, this rename does not happen.
  • The first time I run HE after an upgrade, it appears to have lost all of my settings, and is unlicensed. This is super disconcerting! However, if I exit and reload HE then everything is back the way it was before. I suspect that Virtual Store is causing this weird behavior. This will be confusing to users. (It sure was to me!)
  • HE does not keep per-user configurations, but per-machine instead. Not good on a shared machine.

The settings path is configurable, though it defaults to c:\program files\hippoedit\data. But changing this would only change the data folder. All those other files that HE writes would not change their locations.

I suggest the following changes:

  • Use a subfolder of the user's profile. Perhaps under Documents, or in appdata\local, or maybe even a .hippoedit directly under the profile. I'd check with current Microsoft guidance on this to see what the standard is. Now that I think about it, Microsoft recommends not using Documents, so probably under appdata.
  • Store all modified files to this subfolder instead of Program Files.
  • Will need some kind of upgrader for all the users that have customized files in their Program Files. Either so it migrates their changes over to the new folder or tells them how to do it.
  • The installer needs to tell the user when it renames their customized syntaxes to .old etc. and where to find these files so they can merge in their customizations to the new files.

Lots of comments, I know! I'm sorry but I feel very strongly about UAC-compliance. :)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #1 on: April 28, 2009, 11:55:06 pm »
Uhh... :)

I agree, this is a bug. I have this in todo (at least using appdata directory as MS recommends), but was doing other things, because nobody was complaining :))
Thanks for deep analysis ;)

I think I would not change this for 1.4x branch, but probably for 1.50.

Quote
The installer needs to tell the user when it renames their customized syntaxes to .old etc. and where to find these files so they can merge in their customizations to the new files.
... installer does not know, that user has modified files, it only knows that they exist. It does not parse xmls, and there is also no version inside of the xml...

What I can do (Arthur has suggested some when) is flag in installer, which can disable overwrite of defaults.
Another thing, is to find out all settings that user wants to have different from defaults and move them to user_xxx.xml files (as file extensions for example).

Best regards,
Alex.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #2 on: April 29, 2009, 03:04:22 am »
I have just taken an update on my Vista machine and the setup file downloaded shows up as not having a valid signature. Is this a big deal to add one?

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #3 on: April 29, 2009, 03:40:07 am »
Update: as of the last beta, the error below is no longer the case, good!

In addition (strange thing): I updated my HE on Vista SP2 and was working with it, but after I closed all windows I got a message below. I have not seen it after installing anything else.
« Last Edit: May 05, 2009, 03:10:42 pm by Arthur »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #4 on: April 29, 2009, 09:52:58 am »
Hi Arthur,

about signature do not know. I think this can be a problem, because executable probably should be signed by some Microsoft service...

The second popup probably related to UAC as Scott written. Maybe because of user files placed in Program Files folder. Maybe you can check what is written under link What Settings are Applied? bottom of the dialog.

Regards,
Alex.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #5 on: April 29, 2009, 02:57:19 pm »
I have checked for
Quote
Alex: What Settings are Applied?
But no specific info was available, just a standard Windows Help.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #6 on: April 29, 2009, 03:34:18 pm »
I would suggest to revise your installer package. Seems to me you are using one of the freeware/open source tools. Why not to switch to MSI?
I think you are missing a proper manifest for Vista, pl see: http://www.innosetup.com/files/is5-whatsnew.htm (not sure if this is your install tool, search for this error). I can also recommend WItem's http://www.witemsoft.com/togo/faq/ installer that looked to me very good and it is based on MSI (although I used it only several times, but you can ask the creator paul@witemsoft.com who was very glad to help me).

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #7 on: April 29, 2009, 04:07:30 pm »
Arthur, why not to revise complete HippoEDIT then ? ;)
This is HUGE work.

NSIS was selected not by missing of knowledge, I have checked MSI (it was somewhen used in HE before) and InnoSetup and Ghost Installer and Install Shield.
The NSIS for me a best choice.
MSI is heavy, slow and have a lot of limitations.

I think missing manifest is not a big problem.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #8 on: April 29, 2009, 04:59:34 pm »
Arthur, why not to revise complete HippoEDIT then ? ;)
This is HUGE work.
...
I think missing manifest is not a big problem.

Did you mean reverse engineer HE? Why?
Re "missing manifest" - I am not completely sure yet if this is the case, perhaps digitally signing your exe is the step one that has to occur.

PS: I can dig deeper into that if you see value in me doing this. Let me know.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #9 on: April 29, 2009, 05:17:12 pm »
I was talking about changing of installer.
If you can tell me what exactly is missing (why message is produced) and what should be done to have this working this would help :) For example how I can digitally sign installer. Was never investigating this...

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #10 on: April 29, 2009, 06:41:32 pm »
Based on what I have found you need to turn the UAC off, install HE then turn the UAC back on.
Backup your reg and please try the following (in your installer it must be a script I guess):
To turn UAC off:
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
To turn it back on:
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

I think you got the idea. The above it taken from a blog http://shrinkify.com/p5t

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Need to support Vista with UAC enabled
« Reply #11 on: April 29, 2009, 06:43:46 pm »
And to digitally sign anything [DLLs, EXEx, etc.] the most comprehensive article I could find is: http://shrinkify.com/p5u

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #12 on: April 29, 2009, 07:31:43 pm »
Thanks for help Arthur,
would check when would fix latest bugs ;)

Offline Scott Bilas

  • Jr. Member
  • **
  • Posts: 51
  • Karma: +2/-0
    • View Profile
    • New Fun Blog
Re: Need to support Vista with UAC enabled
« Reply #13 on: May 03, 2009, 03:00:24 am »
There's no reason to switch away from NSIS. It works fine, plenty of Vista-compliant apps use it as their installer.

Signing the installer can be a bit of a pain to automate due to how the certificates install locally and needing passwords and so on. We ran into some exciting times with this at my previous job. But once you get the process down it's no big deal to maintain.

The only trick is to buy that certificate. A "real" one costs in the several-hundred-dollars range and has to be renewed annually or every few years depending on what you buy. This may not be worth it for you.

Signed installers are nice but not a critical component. They are fairly common and people just ignore the warnings that come up anyway. The only place it may be an issue is for people using your editor in a corporate environment with strict rules. But then they probably won't permit their end users to install to Program Files anyway.

One thing that may be a good compromise (plus a good thing on its own) is a portable installation. Many apps do this in their installers with a radio button choice between "install in program files for all users" and "install portable to directory of your choice..." Then users in environments requiring expensive certificates or limiting access to writing in Program Files will still be able to use HippoEDIT.

Of course...mostly programmers are using HE. And programmers always find creative ways around overly restrictive corporate environments anyway, hehe. :)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Need to support Vista with UAC enabled
« Reply #14 on: May 03, 2009, 04:04:42 pm »
Hello Scott,

thanks a lot for detailed and argued responce ;)

Yes, I do not think, that HE currently in such stage, when I would buy certificate.
About the portability of Hippoedit. There is no special, portable version of editor, but generally HE does not require to be installed into Programm Files and can be stared from any directory (or just copied). See these threads for details:
http://forum.hippoedit.com/index.php/topic,21.0.html
http://forum.hippoedit.com/index.php/topic,159.0.html
http://forum.hippoedit.com/index.php/topic,144.0.html
Only some problem is buffer/prefetch files created in %TEMP% dir, used for speed up loading and store local machine related file preferences. Creating of these files can be disabled by command line flag --portable.

But in any case I need to have single user or multi user installation.

Best regards,
Alex.

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
522 Views
Last post February 23, 2009, 03:13:21 pm
by alex
4 Replies
546 Views
Last post March 04, 2009, 08:23:47 pm
by Arthur
5 Replies
510 Views
Last post April 03, 2009, 03:42:16 pm
by alex
4 Replies
2065 Views
Last post April 18, 2009, 12:14:34 pm
by Stefan
3 Replies
975 Views
Last post May 05, 2009, 08:26:41 pm
by Stefan