Admin.ini - [Paths]: Environment variables support

Features wanted...
highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Admin.ini - [Paths]: Environment variables support

Post by highend »

Can you please add environment variable support to the keys in [Paths] for the Admin.ini file?

So that e.g. this will work:

Code: Select all

[Paths]
FileTagDat="%USERPROFILE%\OneDrive\DB.dat"
Scripts="D:\XYusers\%USERNAME%\Scripts"
etc.
Thanks!
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Makes sense, next beta.

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

Thanks!
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

It seems the entry for Paper isn't working at all atm...

E.g.:
Paper="%USERPROFILE%\OneDrive\XYplorer\Paper"

If you invoke Help - Various Information
it shows that Paper still points to the standard path (in XY's data folder) and not to the path defined by Admin.ini
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Works here.
Is "%USERPROFILE%\OneDrive\XYplorer\Paper" an existing path?

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

It is.

Try this Admin.ini:

Code: Select all

[Paths]
FileTagDat="%USERPROFILE%\OneDrive\XYplorer\DB\SharedTags.dat"
Catalogs="%USERPROFILE%\OneDrive\XYplorer\Catalogs"
NewItems="%USERPROFILE%\OneDrive\XYplorer\NewItems"
Paper="%USERPROFILE%\OneDrive\XYplorer\Paper"
Scripts="%USERPROFILE%\OneDrive\XYplorer\Scripts"

[Tags]
TagDatSafeSave=1
TagDatOpenTryMsecs=5000
TagFlags=1
TagDatModCheckMsecs=2000
Paper is pointing to the wrong folder!

Now remove the [Tags] section and...
Paper will point to the correct folder!

oO
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Wow, interesting case. My super-optimized INI reader could fail to find a key if the user chose a certain sequence of keys. Fixed in next beta. :tup:

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

with 0602 all paths from the Admin.ini are now ignored regardless if the [Tags] section exists additionally or not...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Not here. :?

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

1.png
You do not have the required permissions to view the files attached to this post.
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Crazy. Has to wait till tomorrow.

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Tried with Win10: No problem. Can't explain what you get.

Anyway, I applied a different and better fix now to the original problem. Next beta.

Daniel0312
Posts: 238
Joined: 15 Feb 2016 10:48

Re: Admin.ini - [Paths]: Environment variables support

Post by Daniel0312 »

Hi,
I had the same behavior as highend.
I did some tests and messed my licence and... surprise it worked with expired license.
Hope it helps.
Daniel
XY32 latest stable / Windows11 23H2 / Scaling 100%

highend
Posts: 14924
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Admin.ini - [Paths]: Environment variables support

Post by highend »

It's back to the original behaviour with 0603

If the [Tags] section is in place, Paper points to the standard folder, if it's removed, it respects the setting from the Admin.ini
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66083
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Admin.ini - [Paths]: Environment variables support

Post by admin »

Try 0604.

Post Reply