Author Topic: run zip command failed inside C::B, but works OK under command line  (Read 4273 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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.


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: run zip command failed inside C::B, but works OK under command line
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: run zip command failed inside C::B, but works OK under command line
« Reply #2 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.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: run zip command failed inside C::B, but works OK under command line
« Reply #3 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