Android Question Two problems with #CustomBuildAction

agraham

Expert
Licensed User
Longtime User
Probably stupidity and/or ignorance but ...
1)
Works
#CustomBuildAction: 1, c:\temp\v4.exe,

Doesn't work with a read-only copy of v4.exe in the Objects folder where the Attributes tutorial
says 'The running folder is set to the program objects folder.'
#CustomBuildAction: 1, v4.exe,

Also should it accept a relative path? This would locate v4.exe in the project folder if supported.
#CustomBuildAction: 1, ..\v4.exe,

2)
Doesn't work, does nothing with no error. Does CustomBuildAction not accept a batch file?
#CustomBuildAction: 1, c:\temp\AfterCompile.bat,
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The process "base folder" is set to the objects folder.

You can use the %PROJECT% symbol:
B4X:
#CustomBuildAction: folders ready, %PROJECT%\test.bat,

I've tested it with a batch file and it does work. If for some reason it doesn't work, then run it with:
B4X:
#CustomBuildAction: folders ready, %WINDIR%\system32\cmd.exe, /c ..\test.bat
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Still utter failure, perhaps there is something wrong with my system. If I add this and do a normal F5 compile I see "Running custom action" and the compile hangs. It is finding xcopy.exe as if I put an invalid name there it complains that it can't find it. The same if I try to run cmd.exe.
B4X:
 #CustomBuildAction: 1, c:\windows\system32\xcopy.exe,  c:\temp\AfterCompile.bat c:\temp\AfterCompile2.bat
 
Upvote 0

Similar Threads

Top