Downloaded the latest Commandbox (commandbox-jre-w...
# box-products
t
Downloaded the latest Commandbox (commandbox-jre-win64-5.4.2) but still have the older versioned directory (commandbox-jre-win64-5.2.1) in my Program Files dir. How does typing "box" in a terminal know which one to use? Or does it look for the highest versions folder and use that box exe inside? I don't see anything in the PATH env variable for box. When I do type box in vscode terminal, it now shows v5.3.1+00392 but that doesn't match the version in the downloaded filename.
b
How does typing "box" in a terminal know which one to use?
It doesn't
d
there is a environment variable called PATH. you must add the directory of the box.exe to that PATH
b
Not unless you've set the path
And if you've set the path, then you control that šŸ™‚
t
RIght but since I don't have it in my PATH, how is it working up till this point? In vscode term I type "box" and it fires up.
c
Do you really want two versions of CommandBox on the same machine? If not, close all CommandBox terminals, rename the box.exe and the JRE folder (as a backup), then unpack the new CommandBox zip file into the same folder where you previously installed CommandBox. First run of box.exe after that will upgrade the internals.
t
No but until I know the control mechanism (like the PATH var) I didn't want to delete it and then typing "box" in vscode not work and I now now where to change the "pointer".
c
As long as it's placed in the same folder it was running previously, then whatever you configured in VSCode to make it work should continue to work. It's possible you configured a custom terminal within VSCode that includes the file path to your box.exe file and that you don't currently have the CommandBox folder in your Windows system path.
t
Ok I found it. When I checked for the Path env variable settings, I only looked in the System Variable "Path", but in the my User Variable "Path" commandbox path is in there. Sorry for the miss on my end. Thanks @cfvonner and @bdw429s
šŸ‘ 1
@cfvonner I still notice starting box in vscode, the version says v5.3.1+00392 which is not 5.4.2 as indicated in the commandbox download filename. Are they not the same thing?
b
@teaman Honestly, I would avoid having two folders in the first place ā€¢ pick a place you want
box.exe
to live ā€¢ put it there ā€¢ put all future versions of box there ā€¢ stop putting box anywhere else And your life will be simpler šŸ™‚
ā˜ļø 1
šŸ’Æ 1
Start with those bullets above and see if that doesn't help you clear up your version differences
c
Like @bdw429s said, just overwrite the box.exe in the folder you know works with the new version.
t
When I have the right version loading, will it indeed show v5.4.2 in this?
b
If you start version
x
of box, and then start version
x+1
of box (which upgrades your box home) and then get confused and go back and run version
x
of box for some reason the best case scenario is your versions won't match and the worse case scenario is it will error.
t
OK thanks
b
The version you see in your screenshot doesn't come from the binary, it comes from the CFML code in your CommandBox home
Usually
~/.CommandBox
t
Ok I took your advice, made my Program Files folder name without a version appended to the name. I updated my Path in my User Variables Path. I deleted the previous terminal in vscode. Opened a new one. Ran "box" and it did some one-time type setup. Then it opened and now that banner shows v5.4.2+00453. šŸ™‚
And yes my .CommandBox folder is in my ~.
b
āœ…
You're a pro now
šŸ˜„ 1