User forums > Help

Post-build steps fail

(1/2) > >>

Ehtyar:
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: ---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

--- End code ---
After a successful build i get:

--- Code: ---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.

--- End code ---
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: ---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.

--- End code ---
If anyone can suggest what I might be doing wrong I'd really appreciate it.

Thanks, Ehtyar.

mariocup:
Hi Ehtyar,

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


--- Code: ---cmd /c copy /Y ...

--- End code ---

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:
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.

Cool Javelin:
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.

sodev:
11 years later and the OP is a guest user... new record?

Navigation

[0] Message Index

[#] Next page

Go to full version