Author Topic: Post-build steps fail  (Read 2494 times)

Ehtyar

  • Guest
Post-build steps fail
« on: May 03, 2008, 12:43:43 am »
Hi all.
I recently decided to give Code::Blocks a try by attempting to compile Notepad++ for windows with it. I've been very impressed! After getting to know how to operate it, it didn't take me long to build it successfully. I have just one small problem; the post build steps for it look like this:
Code: [Select]
copy /Y ..\src\config.model.xml ..\bin\config.model.xml
copy /Y ..\src\langs.model.xml ..\bin\langs.model.xml
copy /Y ..\src\stylers.model.xml ..\bin\stylers.model.xml
copy /Y ..\src\font\LINEDRAW.TTF ..\bin\LINEDRAW.TTF
copy /Y ..\src\shortcuts.xml ..\bin\shortcuts.xml
copy /Y ..\src\contextMenu.xml ..\bin\contextMenu.xml
After a successful build i get:
Code: [Select]
Execution of 'copy /Y ..\src\config.model.xml ..\bin\config.model.xml' in 'K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net' failed.
However, if i put all these commands in K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net\post.bat and replace them in post-build steps with simply "post.bat" the console output looks like:
Code: [Select]
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\config.model.xml ..\bin\config.model.xml
        1 file(s) copied.
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\langs.model.xml ..\bin\langs.model.xml
        1 file(s) copied.
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\stylers.model.xml ..\bin\stylers.model.xml
        1 file(s) copied.
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\font\LINEDRAW.TTF ..\bin\LINEDRAW.TTF
        1 file(s) copied.
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\shortcuts.xml ..\bin\shortcuts.xml
        1 file(s) copied.
K:\DEVENV\Projects\npp.4.8.5.src\PowerEditor\visual.net>copy /Y ..\src\contextMenu.xml ..\bin\contextMenu.xml
        1 file(s) copied.
If anyone can suggest what I might be doing wrong I'd really appreciate it.

Thanks, Ehtyar.

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Post-build steps fail
« Reply #1 on: May 03, 2008, 02:15:22 am »
Hi Ehtyar,

if you want to use such commands in pre or postbuilt steps then use

Code: [Select]
cmd /c copy /Y ...

In the user manual (http://www.codeblocks.org/en-docs-wrapper)  of codeblocks in the section 1.6.  Pre- and Postbuild steps you will find an example.

Bye,

Mario

Ehtyar

  • Guest
Re: Post-build steps fail
« Reply #2 on: May 03, 2008, 03:57:34 am »
Thank you mariocup. If you wouldn't mind humoring me just once more, but why does Code::Blocks require that you manually launch the command interpreter instead of spawning it itself?

Ehtyar.

Offline Cool Javelin

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Post-build steps fail
« Reply #3 on: June 09, 2019, 07:46:18 pm »
Ehtyar:

You did not mention the OS you are using, but you do mention Notepad++, so I assume Windows.

I think the requirement for the extra cmd is because some commands are actually built directly into the command processor.

In older Windozs, (before Vista) this was called "command.com." Newer versions call it "cmd.exe"

In either case, commands like copy, cd, dir, and several others are part of the command processor. This made running these very common commands faster on floppy based system. If you search your hard disk you will not find these.

Other commands like "notepad.exe" or "xcopy.exe" are not "built-ins".

If you type a command at the DOS prompt, the command processor first searches it's internal list and if found, executes what you typed. If not found, it begins to search through the path.

That is why you have to specifically ask for the cmd to be launched. Copy is in cmd.

In the olden days, XP had a program called xcopy.exe. It was the same as copy with a few more features, and I see it exists in Win7, you might try that.

reference: https://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/

Good luck, Mark.
My 1st computer was an IBM System 360. We used punch cards. God help us when the runner dropped the boxes on the way to the computer room.

Offline sodev

  • Regular
  • ***
  • Posts: 295
Re: Post-build steps fail
« Reply #4 on: June 09, 2019, 08:54:04 pm »
11 years later and the OP is a guest user... new record?

Offline Cool Javelin

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Post-build steps fail
« Reply #5 on: June 10, 2019, 05:40:29 pm »
Well, some of us are slow in the uptake.   :P
My 1st computer was an IBM System 360. We used punch cards. God help us when the runner dropped the boxes on the way to the computer room.