Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on February 26, 2017, 04:03:56 pm

Title: run zip command failed inside C::B, but works OK under command line
Post by: ollydbg on February 26, 2017, 04:03:56 pm
I have a new PC(that's Win7 64bit)
Now, when I build C::B inside C::B(opening codeblocks_w30.cbp), I get an error:

Quote
[ 33.3%] Running target post-build steps
[ 66.7%] cmd /c if not exist devel30\share\CodeBlocks mkdir devel30\share\CodeBlocks
[100.0%] zip -jq9 devel30\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc
Execution of 'zip -jq9 devel30\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc' in 'D:\code\cb\cb_sf_git\clean-trunk-for-commit\src' failed.

There is a message box jump out, see in attachment. The Chinese words means "could not find specified file".


While I manually run the command
Code
zip -jq9 devel30\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc
in the command line window from the directory "D:\code\cb\cb_sf_git\clean-trunk-for-commit\src".
It works OK without any issue.

Also, double click on the batch file such as "codeblocks_w30.bat" also works OK.

Any ideas?

BTW: I have zip.exe in the PATH.


Title: Re: run zip command failed inside C::B, but works OK under command line
Post by: stahta01 on February 26, 2017, 04:08:14 pm
Do you have more than one zip.exe on your system?
If the zip.exe being found is one that does NOT like "\" backslashes in the path you might get this error.

The other thing to suggest is add the path to zip to the compiler being used in global compiler settings.

Tim S.
Title: Re: run zip command failed inside C::B, but works OK under command line
Post by: ollydbg on February 28, 2017, 12:03:38 am
Do you have more than one zip.exe on your system?
If the zip.exe being found is one that does NOT like "\" backslashes in the path you might get this error.

The other thing to suggest is add the path to zip to the compiler being used in global compiler settings.

Tim S.

Hi, Tim, thanks for the reply. I finally found that this issue is caused by a wrong PATH environment setting in my "portable C::B launcher batch script".
I use a batch script like below:
Code
@set PATH=XXX;YYY;ZZZ
start cblauncher.exe --debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen --verbose

But the XXX are the paths in my old computer, and they do not exits in the new computer.

Sorry about the noise.

By the way, I use such method of find the wrong PATH variable:
1, in the Menu->Tools, click to add a new "User defined tools"
2, Then set the command contents as "cmd.exe", and give it a name "cmd".
3, run this user defined tool by click the "cmd" in the Menu->Tools->cmd, this will show a windows command line shell.
4, type "PATH" in the command line see what the PATH value is.

Title: Re: run zip command failed inside C::B, but works OK under command line
Post by: Bat on March 23, 2017, 08:59:36 pm
I have quite a similar issue. I have a program that start at windows startup (Power Pro), for un unknown reason it didn't get the full system PATH string. Then I launch C::B from this program, it inherit the truncated path. And I got the 'zip' issue, and also the 'svn' issue - for tagging version on splashscreen