Corrected .bat script...
I was deleting manually some files while running the batch files, so if
sys.ji exists in the lib/julia dir then prepare-julia-env.bat wouldn't run.
The change/correction consists in moving del %sysjlori% to outside of the
if block (in red below).
So use this version:
@echo off
REM -- Script SHALL be located in julia /bin dir, near julia.exe
REM -- JULIA_DIR MUST be julia 0.3.0-rc1 base/install dir
set JULIA_DIR=..
REM -- Define variables for the various files involved
REM -- sys files... original ... and backup copy
set sysjlori=%JULIA_DIR%\lib\julia\sys.ji
set sysjlcopy=%JULIA_DIR%\lib\julia\sys.bak.ji
REM -- userimg.jl shouldn't exist in the original distribution! It's created
set userimjl=%JULIA_DIR%\share\julia\base\userimg.jl
REM -- Build batch
set buildBatch=%JULIA_DIR%\bin\prepare-julia-env.bat
REM -- Only backups the first time it runs so it really preserves...
REM the original sys.jl from julia's binary distribution
if not exist %sysjlcopy% copy %sysjlori% %sysjlcopy%
del %sysjlori%
REM -- Echoes packages to be "compiled" for userimg.jl
REM -- The packages should already have been added to julia's system...
REM by running 'Pkg.add()' in julia's REPL, e.g. like
'Pkg.add("Winston")'
REM ####### USER DEFINITIONS #######
REM echo Base.require("Distributions.jl") > %userimjl%
REM echo Base.require("Optim.jl") >> %userimjl%
REM echo Base.require("DataFrames.jl") >> %userimjl%
REM echo Base.require("Gadfly.jl") >> %userimjl%
REM echo Base.require("Winston.jl") >> %userimjl%
REM ####### END USER DEFINITIONS #######
call %buildBatch%