Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First run config fails with exclamation in path #1049

Closed
ethanpil opened this issue Jul 22, 2016 · 11 comments
Closed

First run config fails with exclamation in path #1049

ethanpil opened this issue Jul 22, 2016 · 11 comments

Comments

@ethanpil
Copy link

Please see issue #1039

I just downloaded a new copy of the latest dev build (cmdr.7z) and I am having the same / similar issue as that thread. I didn't touch any files, just extracted to a folder and ran cmdr.exe

Creating intial user-aliases store in "C:\Dropbox\PORTABLEAPPS\cmdr\config\user-aliases.cmd"...
The system cannot find the path specified.
'"C:\Dropbox\!PORTABLEAPPS\cmdr\config\user-aliases.cmd"' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Ethan Piliavin
λ user-aliases.cmd

Reading the #1039 thread, I downloaded https://github.com/cmderdev/cmder/blob/master/vendor/user-aliases.cmd.example into my local \cmdr\vendor and now everything works as expected. This file is definitely missing in the dev current build.

@Stanzilla
Copy link
Member

Just downloaded it and it is there: http://i.imgur.com/BMTvRmO.png

@ethanpil
Copy link
Author

ethanpil commented Jul 22, 2016

I tried 3 times. I don't think you should be so quick to close this ticket. Try running cmdr.exe after download. Something is definitely not right.

@ethanpil
Copy link
Author

ethanpil commented Jul 22, 2016

The truth is I downloaded it and during first run I got the error messages, read the thread and saw it wasnt there. I think you should try looking after first run. Something is definitely wrong.

@ethanpil
Copy link
Author

ethanpil commented Jul 22, 2016

On the second run, after i downloaded the file, there were no errors. On the third run, this error:

Creating intial user-aliases store in "C:\Dropbox\PORTABLEAPPS\cmdr\config\user-aliases.cmd"...
The system cannot find the path specified.

C:\Users\Ethan Piliavin
λ

That path exists. I even copied and renamed user-aliases.cmd.example to user-aliases.cmd in that location and I still have the error.

@daxgames
Copy link
Member

@ethanpil,

I wrote the alias code you seem to have issues with. I just downloaded cmder full from the web site, extracted it to a new folder and ran cmder.exe. It works perfectly see the output of the first run:

Generating clink initial settings in "C:\Users\dgames\Downloads\cmdernew\config\settings"
Additional *.lua files in "C:\Users\dgames\Downloads\cmdernew\config" are loaded on startup.
Creating intial user-aliases store in "C:\Users\dgames\Downloads\cmdernew\config\user-aliases.cmd"...
        1 file(s) copied.
Creating user startup file: "C:\Users\dgames\Downloads\cmdernew\config\user-profile.cmd"

C:\Users\dgames
λ

The example file is copied to 'C:\Users\dgames\Downloads\cmdernew\config\user-profile.cmd' if the destination does not exist. the result of that copy, '1 file(s) copied.' is evident in the output above in a fresh newly extracted and otherwise unmodified directory structure.

I then closed it and relaunched 'cmder.exe' again with no issues. See output of the second run after issuing the 'alias' command to list all default aliases that ultimately came from the file you say is not there:


C:\Users\dgames
λ alias
Use /? for help

clear=cls
clink="C:\Users\dgames~1\DOWNLO~1\cmdernew\vendor\clink/clink_x64.exe" --cfgdir "C:\Users\dgames\DOWNLO~1\cmdernew\config" $*
cmderr=cd /d "%CMDER_ROOT%"
e.=explorer .
gl=git log --oneline --all --graph --decorate  $*
history=cat %CMDER_ROOT%\config\.history
ls=ls --show-control-chars -F --color $*
pwd=cd
unalias=alias /d $1
vi=vim $*

C:\Users\dgames
λ

I then did EXACTLY the same as above with this development archive, https://ci.appveyor.com/api/buildjobs/n15ep9jijgcunjes/artifacts/build/cmder.7z, with EXACTLY the same results.

I cannot duplicate your issues with the limited information provided.

@ethanpil
Copy link
Author

ethanpil commented Jul 22, 2016 via email

@daxgames
Copy link
Member

Decompressed Cmder Full zip with Windows built in and Cmder Full Dev 7z with unzip 7zip portable.

Smartscreen is off.

Windows 10

The only time that the user-aliases.cmd.example file is referenced/used is on an initial fresh run when '%cmder_root/config/user-aliases.cmd' does not exist. It the example file does not exist after initial extract the issue is most likely in your system because it is definitely in the archive. Are there spaces in %cmder_root% path?

@ethanpil
Copy link
Author

ethanpil commented Jul 25, 2016

Your comment about spaces in the path got me thinking and I think have figured out the problem. The first run initialization does not complete correctly with an exclamation mark ! in the path.

I keep my portable apps in C:\Dropbox\!PORTABLEAPPS

Looking at the log I posted above, it seems that it was detected as C:\Dropbox\PORTABLEAPPS (Missing the !

I tried once more on my desktop under a folder called !cmder and the error appeared again, you can see that Creating initial user-aliases store shows the path missing the exclamation mark.

Generating clink initial settings in "C:\Users\Ethan Piliavin\Desktop\!cmder\config\settings"
Additional *.lua files in "C:\Users\Ethan Piliavin\Desktop\!cmder\config" are loaded on startup.
Creating intial user-aliases store in "C:\Users\Ethan Piliavin\Desktop\cmder\config\user-aliases.cmd"...
The system cannot find the path specified.
'"C:\Users\Ethan Piliavin\Desktop\!cmder\config\user-aliases.cmd"' is not recognized as an internal or external command,

operable program or batch file.
Creating user startup file: "C:\Users\Ethan Piliavin\Desktop\!cmder\config\user-profile.cmd"

C:\Users\Ethan Piliavin
λ

I am still unsure how user-aliases.cmd.example could have disappeared but it certainly was there with or without the error, unlike my initial report. So this bug might aptly be renamed to First run config fails with exclamation in path

Obviously, best case is to find a way to prevent this from happening. Alternatively, may I suggest some guidance in the documentation about preventing first-run errors?

@ethanpil ethanpil changed the title aliases.cmd.example missing from cmdr\vendor in latest builds First run config fails with exclamation in path Jul 25, 2016
@daxgames
Copy link
Member

daxgames commented Jul 25, 2016

! is a reserved character in cmd that wraps a delayed expansion variable name. It is not a good practice to use ! in a file path.

@ethanpil
Copy link
Author

OK, I will know for the future, but certainly this should be documented...

@MartiUK
Copy link
Member

MartiUK commented Jul 25, 2016

@ethanpil Yeah, it's in most documentation regarding batch scripting since Windows 2000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants