Perl programmer for hire: download my resume (PDF).
John Bokma MexIT
freelance Perl programmer

Comments: IrfanView forgets settings: fix

21 comments

IrfanView has been annoyed me for some time: when it's installed with Administrator rights and used by a user with a limited account, which is a very good thing: limited, it doesn't keep its settings. Moreover, it seems to use the settings of the Administrator, which a limited user shouldn't be able to see, in my opinion.

Read the rest of IrfanView forgets settings: fix.

Comments

I am not a programmer so don't understand all that the writer has tried to convey; however, I think that since Irfan has been kind enough to give the world his Irfanview without any charge at all and has been willing to support it for a long long time, again without charge, it would seem that the writer is being a bit callous in his criticism of Irfan. After all, the writer is not required to use Irfanview, particularly since he finds so much about it to criticise. There are several other programs that are available for a $$price that are not nearly so good as Irfanview. I have tried some of them, but have always come back to Irfanview because it is heads and shoulders better than those. The writer might find that Picasa2 will supply his needs -- again without any charge.

Posted by jpritch at 04:41 GMT on 15 December 2005

I am indeed not required to use Irfanview, but does that mean that I can not criticize the program? Or does it being free software (for private use only) mean one can't complain about flaws?

Irfan seems to be on a private crusade against Microsoft, a crusade which partly is based on his experience with the registry as it was implemented in Windows 95. Times have changed, and even if they haven't, I don't think that users of software, no matter if it's free or not, should experience problems because a programmer disagrees with another programmer, or a group of programmers.

Like I wrote: most of his issues with the registry are that other people don't use it right. Hence his own program using a different system isn't going to change a thing, but it does mean that people who have set up their Windows environment properly are wasting time and have to fall back on a FAQ entry which doesn't even mention the right (in my opinion) set up.

Personally, I think that if you make software available to the public, no matter if it's free or not, you still are responsible for it.

Posted by John Bokma at 07:15 GMT on 15 December 2005

Thanks for your fix - it works great. Even if he doesn't want to use the registry, it would be trivial for the author to change the program so that it has an option to store the iview_32.ini file in the user profile not in its program folder. Other freeware apps have a facility like this.

Posted by Viking Man at 06:18 GMT on 9 January 2006

Firstly thanks for the fix. I have suffered from this bug for some time.

This is a bug, called LUA (Limited User Account) bug, which is clearly described in Aaron Margosis's blog.

In my opinion, being free software (as either in speech or beer) is not an excuse for bad coding and program behaviour. I know IrfanView is (probably) one of the best freeware image viewer, but this bug really frustrated me when running it as LUA. I think this kind of bug reporting is useful, healthy and constructive for creating well-behaved applications, and thus should be encouraged.

When Vista comes out, quite a lot of applications will need to support LUA, or they will not function well.

Posted by Small Potato at 03:25 GMT on 17 February 2006

Thanks, I looked up Aaron's blog entry: Fixing "LUA bugs", Part I.

Posted by John Bokma at 03:32 GMT on 17 February 2006

To the first comment, yes the software is free, however the attitude that the developer had is definitely a turn off for using the program. If he at least grew up and used a civil defense as to why he believed using a registry is a bad idea, then I would have no problem. His current response is childish at best.

And again, this has to do w/ LUA and the simple fix is easy enough, I don't see why he wouldn't include it.

Posted by Linh at 21:06 GMT on 10 March 2006

You write: "Irfan seems to be on a private crusade against Microsoft" It looks like you are on a private crusade for Microsoft. You asked a private question and Irfan answered. It is a bad manner to report a private conversation. As for your comments on registry etc. Irfanview is a selfcontained program that I can put on my memorystick together with my photos and take with me in my pocket for slide presentation anywhere. I wish all programs were like Irvanview. Instead, my registry is cluttered with useless or harmful entries and my Windows directory is a garbage can. It is Microsoft design.

Posted by crusader at 19:36 GMT on 4 June 2006

@crusader

"It looks like you are on a private crusade for Microsoft".

No, you're mistaken. I complain about a program because it doesn't work as I, and probably quite some other people, expect it to work. And in my not so humble opinion, it should be fixed in the program, not (badly) in a FAQ.

I call it also a crusade because Irfan seems to be quite misinformed about the registry, and in my opinion, bothers his users with his issues with Microsoft.

"It is a bad manner to report a private conversation." It's a bad manner to write an article about a flaw without contacting the author. And if one contacts the author it seems to be logical to write about the outcome.

"It is Microsoft design."

No. Microsoft didn't "design" the registry to be cluttered. Its the software developer who decides not to clean up.

As of your Windows directory being a garbage can, when you use the setting I recommend, %APPDATA%, IrfanView creates an INI for each user. Guess what happens when you uninstall IrfanView.

On the other hand, it's quite a tough question: should the uninstall process delete per user configuration files, should it ask the user, and what default should it use in the latter case? People who uninstall files probably ignore "uninstall couldn't delete all entries" and don't manually clean up.

As of the USB stick: nothing prevents Irfan do make IrfanView multi user aware by either using the registry or the %APPDATA% setting I recommend. Sadly, after installing IrfanView and noticing that it doesn't work as expected, the user first has to find the FAQ, and then understand that most of the examples, given at almost the bottom of the FAQ page, are extremely bad. I mean: using a temp directory for storing settings? That's abusing the temp directory, unless IrfanView automatically deletes the INI file when it closes, since temp stands for temporary. Not for "store your program settings here".

Posted by John Bokma at 19:17 GMT on 5 June 2006

Getting a snake to eat its own stomach is easier than getting a programmer to change his ways. :-\

I would like to add that John is probably a great admirer of Irfanview, or he would not have taken so much trouble to find out what's wrong. Users that do not like your software typically do not bother to write you about it.

Posted by Branko Collin at 13:26 GMT on 19 June 2006

I have wound up with IrfanView without having personally downloaded it. I don't like that there is no uninstall program listed under "Add/Remove Programs," nor can I find it listed in my programs list. I do find it when I do a search, but there is no unistall program there. When I delete all the files listed there, I can no longer view files, even though I have other viewers installed.

Posted by Julz at 16:01 GMT on 9 July 2006

Julz - this really doesn't sound like a real version of IrfanView. IrfanView does show up here in "Add/Remove programs". It might be very well that you have a piece of malware on your computer that either looks like IrfanView or a version of IrfanView that has been changed by someone.

You might want to check your computer first for malware, viruses, etc. If that doesn't help, download IrfanView from the official site and install it.

If you prefer to use other viewer software: double click on an image file. Windows shows a dialogue window stating "Windows cannot open this file". Select the option "Select the program from a list". Next the "Open With" dialogue window is shown. Select the viewer program you want to use from this list. Make sure that "Always use the selected program to open this kind of file" has a check mark and press OK. Next time you open a file of this type, the viewer software you selected should open the file.

Posted by John Bokma at 19:11 GMT on 16 July 2006

Registry is not so convenient as INI files, IMHO.

Consider several situations:

1. Not all people like to use installers/uninstallers to install/uninstall.

2. Some one may want to transfer his/her configurations to another computer.

...

Posted by koala at 06:28 GMT on 9 August 2006

Both points are certainly valid. The dislike for installers/uninstallers is largely based on the fact that a lot don't do their work correctly. Uninstall often means that you have to track down several files that are not removed. On the other hand, I only uninstall software I don't like.

This first point can be solved by Irfan to allow for just running IrfanView locally without installing it. A good example of a program that can do this is mu-Torrent: a very small but good bittorrent client.

Regarding your second point, nothing stops Irfan to add an "Export Settings" and "Import Settings" to a IrfanView, or like I already wrote, to add an option to an installer that asks the user if he / she wants to use the registry or INI files.

The issue I explained above is something Irfan can fix with very little programming work, but I am afraid Irfan is someone who has problems admitting that there are better ways to fix issues, just because he didn't think about them first.

His FAQ still suggests to use a folder for temporary files to store INI files, which is plain stupid to say the least, since temporary means just that: temporary. Also, the folder is readable and writeable by all users which is a security issue if you store INI files there.

The only answer that comes close to the right solution is the final one given in the FAQ:

INI_Folder=%YOUR_ENVIRONMENT_VARIABLE%\folder

Replacing %YOUR_ENVIRONMENT_VARIABLE% with %APPDIR% and folder with IrfanView is what I recommend in my article.

Don't expect the FAQ entry to change soon to reflect this though, or better, to be removed because the installer takes care of it.

Posted by John Bokma at 01:35 GMT on 20 August 2006

Thought I would chip in as to why the Registry isn't all that great ...

The problem with the registry is that it gets very messy. It is fine for Operating System only things however when everyone can add their own bits too it it starts to get big which in turn makes it slow. It is also a single point of failure, it is a big database that stores everything about your whole system in just a few files, if one of those files gets corrupt you are in trouble. This isn't such a big problem in Windows 2000 and later because Microsoft have started to move away from the registry for a lot of things. Apparently (and I don't really believe this) Microsoft now only uses the registry for legacy reasons. How true that is I do not know though.

Two other flaws in the registry are* :

Cannot contain comments (like an ini file)

Requires use of the Win32 API to manipulate it (unlike an ini file which is just a text file)

Now to discuss the problem of using %APPDATA%, this is a great place to store application data, it is the whole reason it is there. The problem is the application has no standard way of knowing which user has run the application. If you are in Joes account and you uninstall IrfanView it can delete *your* IrfanView settings but not Sallys as you don't have permission to her %APPDATA% (which is how it should be). A simple fix is to store the settings file in the program directory, this causes problems for those running in a limited account as they cannot edit the settings files in %PROGRAMFILES%. This is a flaw in Microsoft's design of Windows. In a perfect world there would be a standard way of removing settings files for all users %APPDATA% when it is uninstalled. The Registry isn't really the way to go IMHO and most others feel the same which is why the registry is on its way out (although it will still be with us for many more versions of Windows for legacy reasons).

* See Criticisms of the Registry concept for full list

Posted by Morgan at 10:55 GMT on 6 September 2006

@Morgan - Can you explain how a program has no problem when its ini file gets corrupted, but does have a problem if its registry entries get corrupted?

Regarding the other two flaws: of course the registry can contain comments, you just create a key to hold them. Yes, this is not going to win a beauty contest, but people who read ini files to modify them probably can handle comments in a key as well.

The use of Win32 API argument, which I read it in the Wikipedia as well (so much for the Wikipedia), is of course an extremely weak one. When one develops cross platform solutions one runs in more issues then just the registry file. A smart programmer just creates a wrapper that provides an API to read and write settings, and inside the wrapper the per platform issues are handled. In short, if every OS used ini files, this is not going to solve all other issues.

Regarding the uninstalling, if I am in Joes account I can't uninstall IrfanView, because Joe, like all other users, have a limited user account. Which is how it should be.

Moreover, your simple fix is the wrong one, as the use of limited accounts is not the issue, but normal users running with Administrator rights.

However, if a program is uninstalled with Administrator rights, it should be able to access each %APPDATA%. The question is however, should it delete all files without asking?

Finally the Wikipedia entry on the disclaimer Microsoft gives: "Use Registry Editor at your own risk." is in my opinion clearly a straw man, and has no place in the Wikipedia, again in my opinion.

Posted by John Bokma at 18:39 GMT on 6 September 2006

Hi John I read your comment at Aaron Margosis LUA blog: http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx#533834

about Irfanview and the ini-file.

There is a small problem with your fix. When running a session with another users credentials, ( which one often do for convenience in LUA mode ) the %APPDATA% environment variable is not set for that secondary login-shell.

Try it your self.

Run on your Limited user account and start a cmd shell up.

C:\>set APPDATA

correctly should return:

APPDATA=C:\Documents and Settings\John\Application Data

Now start a admin login with RunAs and enter your Admin password:

runas.exe /user:%COMPUTERNAME%\YouAdminAccountName
  %SystemRoot%\system32\cmd.exe

Now

C:\>set APPDATA

returns

Environment variable APPDATA not defined

So to be shure also to have access to the ini file in RunAs logins one could for example use

INI_Folder=%USERPROFILE%\Application Data\IrfanView

because %USERPROFILE% is always available in RunAs processes.

Just my suggestion

bye bye

Henrik

Posted by Henrik Jensen at 05:56 GMT on 23 September 2006

Hi Again John I forgot to mention that using INI_Folder=%USERPROFILE%\Application Data\IrfanView might cause problems on Non English XP's if the "Application Data" is written in the local language. But a had a Danish XP (my native tongue) installed some years ago and IIRC that version used the English "Application Data".

bye Henrik

Posted by Henrik Jensen at 06:25 GMT on 23 September 2006

Hi Henrik,

Thanks for your explanation. I wasn't aware of this issue.

Yesterday, after reading your first comment I was wondering what would happen on a Non English XP version of XP, for example Esme uses a Spanish version of XP and the Application Data folder is named "Datos de programa". She has also an "Application Data" folder with a sub folder for Blender, and a sub folder for, surprise, Microsoft.

%APPDATA% related information

Posted by John Bokma at 18:42 GMT on 23 September 2006

Hi John

I don't know for sure but I guess that a program (or its install procedure), due to bad programming practice, has hard coded the path to "Datos de programa" or "Application Data" instead of using the environment variable or a win32 API function to get the path. I remember from my Danish XP that it both contained a "Programmer" ( Danish for "Program Files"), which was the path defined in %PROGRAMFILES% and a "Program Files" with only a single program in it (Can't remember the name of the sinner though,- some kind of graphics program that was included with my scanner, I think)

Bye Henrik

Posted by Henrik Jensen at 21:17 GMT on 23 September 2006

Hi again John

Actually just found out that on a secondary RunAs shell if IrfanView can't find the %APPDATA% path as indicated by

[Others] 
INI_Folder=%APPDATA%\IrfanView

it just makes a folder in "C:\IrfanView" with a new "i_view32.ini" without touching the "C:\Program Files\IrfanView\i_view32.ini"

In a LUA scenario where you just have one LUA account and one ADMIN account the LUA account will just use the "%APPDATA%\IrfanView\i_view32.ini" and the RunAs-ADMIN the "C:\IrfanView\i_view32.ini" so both can individually change there settings. Of course this is a bit of a inconvinience that the ADMIN account will create 2 ini-files. One when it is run as a primary-login and one for the secondary RunAs login.

The problems arises if you have 2 or more LUA accounts ( e.g. an extra account to access the internet - a technique I use to separate my normal work account from my surfing/email/ftp etc. use ) and you login from your normal LUA account to the secondary LUA account to, lets say, review and delete some pictures you have downloaded from the internet. Then this instance of IrfanView will load the "C:\IrfanView\i_view32.ini" which can't be changed (OTH In my 3 account scenario that could actually be an advantage ;) ) Anyway in this 2 LUA account scenario I had a long LUA-debugging fight with the text editor UltraEdit that I first solved after I discovered the %APPDATA% quirk.

Bye

Henrik

Posted by Henrik Jensen at 01:29 GMT on 24 September 2006

Since I can only congratulate Irfan for the use of an INI file instead of the registry (thanks man! ;-), I concur that the default behaviour should be to put it into %APPDATA%\IrfanView. I hope he'll change that. And the way to make it happen is probably by submiting as many feature requests as possible. Go ahead!

Posted by cluster at 05:28 GMT on 12 June 2007

Post a comment

Note that your comment doesn't show up immediately. I review each comment before I add it to this site.

Check the Follow this page option if you want to receive an email each time a comment is posted to this page, including yours. A link to turn this option off will be included with each email.

Internet adresses will be converted automatically. You can use the following notation to specify anchor text for a link: [url=http://example.com/]example text[/url].