Need to change the location of settings

*** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: helmut, XnTriq, xnview, Dreamer

User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Need to change the location of settings

Post by B.Douille »

I'm using Xnview with Windows Seven and the various options for the location of the ini file seems not working as expected. See below, it's always in the user's profile.
I want to have a single setup for all users in my family. Mainly I want the file modified dates to be preserved if a changes are made in the public picture library.

Setting: .ini in directory User
About says "C:\Users\[username]\AppData\Roaming\XnView\xnview.ini"
Actual location "c:\Users\[username]\AppData\Roaming\XnView" :)

Setting: .ini in directory Windows
About says "C:\windows\xnview.ini"
Actual location "c:\Users\[username]\AppData\Local\VirtualStore\Windows" :( not sharable

Setting: .ini in directory XnView
About says "C:\Program Files\XnView\xnview.ini"
Actual location "c:\Users\[username]\AppData\Local\VirtualStore\Program Files\XnView" :( not sharable

Best regards
Last edited by B.Douille on Sat Apr 18, 2015 11:39 pm, edited 2 times in total.
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
cday
XnThusiast
Posts: 4394
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Info about XnView's settings (store & load)

Post by cday »

Is this a UAC issue?

In Windows 7 writing to the Program or Windows folders requires Admin rights, but when XnView is run from a User account the usual UAC request for the Admin password doesn't appear, the expected write operation doesn't occur but there is no indication that it hasn't been performed...
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Info about XnView's settings (store & load)

Post by B.Douille »

cday wrote:Is this a UAC issue?
I think so. In the case I did the test with an administrative account so the password was not required. At least should I have seen the popup to confirm the access. This does not happen.

If the Windows directory is protected, why not use the C:\ProgramData (equiv. to "All Users\Application Data") ?
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Info about XnView's settings (store & load)

Post by B.Douille »

B.Douille wrote:If the Windows directory is protected, why not use the C:\ProgramData (equiv. to "All Users\Application Data") ?
Same with XnView MP - only workaround is to deploy via the ZIP package in a non-protected, public directory. Annoying.

DB
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Info about XnView's settings (store & load)

Post by B.Douille »

I'm back with the question of the actual path used by the system (Windows 7 as an example). I put a message some time ago but apparently it didn't triggered that much attention. Further comments were posted with information not verified, assuming that nothing have changed in the Windows world 8)
Unless you have an administrator account (Superuser in Unix world) , the current choice, where to store the XnView configuration file is virtual and drive to the same result: It's always in the user profile folder :x

This is because from Windows Vista all write tentative to System and Program folders is refused, limited to read only for normal users (as Unix always did). To preserve compatibility with old programs it creates virtual links to specific folders that emulates these now restricted folders, keeping r/w access. These new folders are in the individual user profile. See below:
Setting: .ini in directory User
About says "C:\Users\[username]\AppData\Roaming\XnView\xnview.ini"
Actual location "c:\Users\[username]\AppData\Roaming\XnView" that's correct :)

Setting: .ini in directory Windows
About says "C:\windows\xnview.ini" Have a look, you'll never find the .ini file here
Actual location "c:\Users\[username]\AppData\Local\VirtualStore\Windows" :( emulation not sharable

Setting: .ini in directory XnView
About says "C:\Program Files\XnView\xnview.ini" Have a look, you'll never find the .ini file here
Actual location "c:\Users\[username]\AppData\Local\VirtualStore\Program Files\XnView" :( emulation not sharable
Currently, the 3 options available are all equivalent and finally doesn't allow to share settings between users. I suggest that we keep 2 options only:
XnView.ini in the User directory for individual preferences (actual path = %APPDATA%\XnView as for now)
XnView.ini in All users directory to share preferences between users (actual path = %ALLUSERSPROFILE%\XnView)
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

Hello,

Can we have a change implemented in a future version?

Unless I'm wrong, the options are made to switch from "Single user mode" aka each user of a machine have is own settings to "Multiple users mode" aka all users shares a same set of settings. Since my original post there are now 2 options only, where to store the .ini file but still this is of no help as it's 100% equivalent as explained in my previous posts.

For the time being, the only way to have a true "Multi-user mode" is to use the ZIP'd package and copy the files in a folder with r/w access for all (personally I use C:\ProgramData). Some anti-virus may dislike this.
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Need to change the location of settings

Post by xnview »

B.Douille wrote: For the time being, the only way to have a true "Multi-user mode" is to use the ZIP'd package and copy the files in a folder with r/w access for all (personally I use C:\ProgramData). Some anti-virus may dislike this.
by default, settings are in user data
Pierre.
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

Yes, with the default option "User", settings are stored in the user profile. Each user of the machine sets his own preferences, independently:


The original idea of the 2nd option "Program (XnView)" was to have a single .ini file so all users have the same settings for consistency (for exemple "Keep original date" or "Export rating in XMP"). The issue is currently it is not possible, unless you are Administrator of the machine:
Location of Settings - Option Program (XnView).jpg
Location of Settings - Option Program (XnView).jpg (26.13 KiB) Viewed 6750 times
This is a security enforcement since Windows Vista where a normal user cannot affect the \Program folder and is similar to the restrictions in the Unix world.
The solution is to store the .ini file in a folder made for purpose: C:\ProgramData (system variable %ProgramData=%) - equivalent to /etc in Unix world
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

Back to this proposal, I see there is a "Custom" option available for the catalog and for other files. Why not adding this option for the .ini files as well ?
This would allow anyone to select \ProgramData\XnViewMP (example for Windows) which is the right location to store the .ini file in case one would ensure the settings are consistent for all users of the machine.

Reminder the current option "Program (XnView)" doesn't work (Windows, Mac, Linux) as the program folder is always protected against tampering the system. To me this option is useless - only use could be for "Portable version" on USB key.

The best would be to replace the Program option by a customisable option (set by default to \ProgramData\XnViewMP vor Windows and equivalent for Mac and Linux)
Attachments
Location of settings - Why not personalise.png
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
user0
XnThusiast
Posts: 2411
Joined: Sat May 09, 2015 9:37 am

Re: Need to change the location of settings

Post by user0 »

B.Douille wrote: Sun Feb 18, 2024 9:25 pm Reminder the current option "Program (XnView)" doesn't work (Windows, Mac, Linux) as the program folder is always protected against tampering the system. To me this option is useless - only use could be for "Portable version" on USB key.

The best would be to replace the Program option by a customisable option (set by default to \ProgramData\XnViewMP vor Windows and equivalent for Mac and Linux)
"Program (XnView)" = "Application directory", this option should remain as is, precisely because of portability (I would rename it though).
If you put app in a folder where user does not have write permissions, it's not the app's problem.

B.Douille wrote: Sun Feb 18, 2024 9:25 pm Back to this proposal, I see there is a "Custom" option available for the catalog and for other files. Why not adding this option for the .ini files as well ?
This would allow anyone to select \ProgramData\XnViewMP (example for Windows) which is the right location to store the .ini file in case one would ensure the settings are consistent for all users of the machine.
that may be handy
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

that may be handy
I'm happy you received my proposal positively :)

I just spent some more time to compare fresh installs of MP and Classic and the way they scan some folders if configuration file(s) already exist (if not, the program offers a selection of 2-3 options). This analysis leads to a more detailed proposal as below :

- The current default option is right, no need to change : Config per user, stored in %APPDATA%\... ($XDG_CONFIG_HOME/... or $home\.config... for Linux)

- The second option, config shared all users targets the %Program Files% folder. I agree that in some situations this should remain (see next). But, in most cases XnView is deployed via a standard setup.exe (or .deb on Linux) and the target folder is protected, cannot store the config files.
What I suggest is rather than just warn the user, the location should be transparently directed to %ProgramData% ($XDG_STATE_HOME for Linux?). This folder is made for purpose, with r/w access by all users of the machine.

- For portable distribution (and ZIP)?) a .ini file should be included. Doing so the program do not ask and will use the file provided in the program folder (with r/w access, no pb on USB key). Once the .ini file is found the information on Settings > Integration > Paths should reflect the actual location where is the .ini file in use (one of the 2 options above). Doing so prevents use/alterations of existing configuration files on the host machine and unexpected behavior when a USB key is/has been inserted.

Bellow is a screenshot of the current behavior of the option "Program (XnView)" when it was installed via normal setup. The warning doesn't mean anything for an average user, may lead to unsecured change on the system and do not deliver the expected feature of sharing a consistent layout, shortcuts, toolbars, labels,... across all users of the machine. My proposal solves this.
Location of Settings (Win) Option Program - Warning.jpg
Location of Settings (Win) Option Program - Warning.jpg (26.13 KiB) Viewed 5176 times
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

One year later we still have the same limitation if you would like to have all users of the machine working with the same setup .

Can we have the storage options updated?

I just reinstalled a new machine, new OS and I'm stuck to the same workaround for years: Download the ZIPpe'd version of XnViewMP and copy all the binaries into "C:\ProgramData\...". This folder (and equivalent for macOs and Linux) are made to store parameters and files that should be shared between users of the machine. But installing a full application there is a non-sens nowadays. I don't know any other application having an .ini file in "C:\Programs" (or it's an .ini file that do not change overtime)

This workaround works only because the system allows r/w access to all users of the machine, whatever has got administrative rights or not. Butit's a pain in term of maintenance, having to save the .ini file each time you update the binaries and then move it back.
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Need to change the location of settings

Post by xnview »

B.Douille wrote: Mon Apr 14, 2025 6:57 pm One year later we still have the same limitation if you would like to have all users of the machine working with the same setup .

Can we have the storage options updated?

I just reinstalled a new machine, new OS and I'm stuck to the same workaround for years: Download the ZIPpe'd version of XnViewMP and copy all the binaries into "C:\ProgramData\...". This folder (and equivalent for macOs and Linux) are made to store parameters and files that should be shared between users of the machine. But installing a full application there is a non-sens nowadays. I don't know any other application having an .ini file in "C:\Programs" (or it's an .ini file that do not change overtime)

This workaround works only because the system allows r/w access to all users of the machine, whatever has got administrative rights or not. Butit's a pain in term of maintenance, having to save the .ini file each time you update the binaries and then move it back.
this topic is in Classic, you talk about adding \ProgramData\ support in XnViewMP, right?
Pierre.
User avatar
B.Douille
Posts: 288
Joined: Sat Sep 09, 2006 9:25 pm
Location: Hte Savoie - France

Re: Need to change the location of settings

Post by B.Douille »

You are right, sorry*. I don't use the Classic version for years but maybe it was still the case when I openned this topic.
Upgrading from Windows XP to Windows 7 I found limitations set my M$ in writing in the \Program\... folder for valid security reasons.
Still with Windows 11 and still for XnView MP so if we can progress on this it would ease installation on machines used by families, shared by multiple users.

At time of installation, some applications offers a Choice like Single user / Multiple users on the machine. This doesn't show as a technical dilemna for an average user and behind the scene it drive the application to store configuration files at the best place (private user profile or shared program data). This is the idea.

*Can an administrator move this topic to MP ?
Daniel, happy user since 2004 to manage photo and videos albums, make diaporamas (Windows, Linux Ubuntu desktops and Android apps)
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Need to change the location of settings

Post by xnview »

See issue for current status and some details.
Pierre.
Post Reply