Page 1 of 1
Environment vaiables in portable file and folder use
Posted: 09 Dec 2013 19:46
by Terry
I really like the "portable file associations" and "portable open with" abilities. There is one inconsistency that I would like for you to fix.
For a file I can use environment variables as shown here:
ini>%epPrgspc%
But for a folder I cannot use environment variables as shown here:
\>"%xnvPrgspc%
In either case I can enter exact paths or portable paths using "?".
I use environment variables extensively in both desktop and portable computers. It should be an easy thing for you to allow environment variables for both files and folders.
Re: Environment vaiables in portable file and folder use
Posted: 09 Dec 2013 21:42
by PeterH
I think you should show a bit more of your usage of the strings.
Especially in the second I see double quotes inside the string - but can't understand what it's about...
Re: Environment vaiables in portable file and folder use
Posted: 09 Dec 2013 22:10
by Terry
The correct example is:
\>%xnvPrgspc%
I tried the directory portable syntax both without double quotes and with double quotes:
\>%xnvPrgspc%
\>"%xnvPrgspc%"
When I posted to the forum I failed to delete the first double quote.
The problem is simple. Portable file associations work with actual file path specified and with an environment variable that holds the actual file path.
Directory associations work only with an actual folder path but NOT with an environment variable that holds the actual folder path.
I am using XYplorer 13.40.0100
I think that both file and folder associations should work with both actual path stings and environment variables that hold the actual path strings.
Re: Environment vaiables in portable file and folder use
Posted: 10 Dec 2013 09:40
by admin
Works fine here.
Here are my test definitions. Both work:
Code: Select all
"ACDC (Env Folders)" \>%ProgramFiles%\ACDSee32\ACDSee32.exe
"ACDC (Env)" jpg;png;gif>%ProgramFiles%\ACDSee32\ACDSee32.exe
Re: Environment vaiables in portable file and folder use
Posted: 10 Dec 2013 15:02
by Stefan
Terry wrote:The correct example is:
\>%xnvPrgspc%
How is the whole command line?
And maybe, to what points your %xnvPrgspc% ?
.
Re: Environment vaiables in portable file and folder use
Posted: 10 Dec 2013 19:07
by Terry
Responding to admin: "works fine here"
I have done some more fiddling. The environment variable "xnvPrgspc" is 58 characters long which does not work. Things seem to work okay if I use shorter strings in an environment variable.
Further, if I use an environment variable that holds about 25 characters of the full path and then add literal characters to complete the path, then it works.
My guess is that your program limits the length of an environment variable that may be used.
I have not done a lot of fiddling/testing to see what is the maximum length that an environment variable may be.
In my situation, I use environment variables extensively, and I hope that we can get this issue figured out and/or fixed.
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 10:33
by admin
There is no such limit. I have longer ones and they work fine.
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 11:43
by RalphM
Could there be a problem with quoting if the path contains blanks?
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 11:52
by admin
OP says there is a difference between files and folders in PFA. Why should length or blanks play a role here?
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 12:04
by RalphM
Was just my 0.02 cents since we had some trouble with blanks in path names before, but you're right about his statement in OP.
Just the later addition that it works up to a certain length made me think about blanks.
Didn't mean to confuse anybody.
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 12:25
by admin
No offense, I was just thinking aloud. It's a weird issue and "xnvPrgspc" is a weird variable.

Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 18:30
by Terry
Responding to admin (It's a weird issue and "xnvPrgspc" is a weird variable).
It is a custom variable. I use MANY such environment variables to coordinate various systems, users and so forth. I began programming in 1967 for the university system in my state in the U. S. Now to the current situation. Limiting discussion to a particular.
I define the the following two env variables (among many others):
portableappsDir=c:\portable\portableapps
xnvPrgspc=c:\portable\portableapps\xnviewPortable\xnviewPortable.exe
The attached image file ("Portable File Associations box") has 7 entries that show variations on using literals, environment variables, and combinations of the two. 4 of the 7 are recognized (that is work) and 3 of the 7 are NOT recognized (that is do NOT work).
Further information. Sometimes env variables work. I cannot find a reason for this strange behavior or find consistent behavior. That is why I suspect an elusive bug (problem) in the coding. I do not rule out that I am doing something dumb, but I cannot find out what. Perhaps with this specific information, you can determine if there is a screwy bug on prehaps alzeimers is setting in for an old man.
xy.png
Terry
Re: Environment vaiables in portable file and folder use
Posted: 11 Dec 2013 18:49
by admin
When you click menu Help / Environment Variables, is %xnvPrgspc% listed there?
Re: Environment vaiables in portable file and folder use
Posted: 13 Dec 2013 16:20
by Terry
Response to Admin "When you click menu Help / Environment Variables, is %xnvPrgspc% listed there?"
No it is not.
But when I run (in a DOS command window) the command line "set xnv" it is there as shown in the following three lines copied from a dos window. The command line and the two lines response are copied and pasted, not typed, below.
The command line and the two line response.
set xnv
xnvPrgdir=c:\portable\portableapps\xnviewPortable
xnvPrgspc=c:\portable\portableapps\xnviewPortable\xnviewPortable.exe
Further, I use the environment variable in other programs (such as, Winbatch) and it works just fine. That is the xnviewportable.exe program runs. I have been using this env variable for years with multiple programs. They all work just fine. Only xyPlorer is having problems.
Re: Environment vaiables in portable file and folder use
Posted: 13 Dec 2013 17:32
by admin
I might have fixed it. Please try the next beta version (upload soon).