Revision 1442

trunk/scripts/admb/admb.bat (revision 1442)
16 16
)
17 17

  
18 18
if not defined ADMB_HOME (
19
  for %%a in (%0) do (
20
    set HAS_PATH=%%~$PATH:a
21
    if defined HAS_PATH (
22
      set ADMB_PATH="%%~dp$PATH:a"
23
    ) else (
24
      set ADMB_PATH="%%~dpa"
25
    )
26
    pushd !ADMB_PATH!
19
  set SCRIPT_PATH=%~dp0
20
  if defined SCRIPT_PATH (
21
    pushd !SCRIPT_PATH!
27 22
    pushd ..
28 23
    set ADMB_HOME=!CD!
29 24
    popd
30 25
    popd
26
  ) else (
27
    for %%a in (admb.cmd) do (
28
      set HAS_PATH=%%~dp$PATH:a
29
      if defined HAS_PATH (
30
        pushd !HAS_PATH!
31
        pushd ..
32
        set ADMB_HOME=!CD!
33
        popd
34
        popd
35
      )
36
    )
31 37
  )
32 38
) else (
33 39
  pushd !ADMB_HOME!
......
336 342
echo.&echo Error: Unable to build.
337 343
echo.&echo COMSPEC=%COMSPEC%.
338 344
echo.&echo PATH=%PATH%.
345
echo.&echo ADMB_HOME: !ADMB_HOME!
339 346
goto EOF
340 347
:HELP
341 348
echo Builds AD Model Builder executable or library.
trunk/scripts/admb/root-admb.bat (revision 1442)
12 12
  ) else (
13 13
    set ADMB_PATH=%%~dpa
14 14
  )
15
  if exist !ADMB_PATH!\bin\admb.cmd (
16
    set ADMB_HOME=!ADMB_PATH!
15
  if exist !ADMB_PATH!bin\admb.cmd (
16
    set ADMB_HOME=!ADMB_PATH:~0,-1!
17 17
    call "!ADMB_HOME!\bin\admb" %*
18 18
  ) else (
19 19
    if exist !ADMB_PATH!build\dist\bin\admb.cmd (
20 20
      set ADMB_HOME=!ADMB_PATH!build\dist
21 21
      call "!ADMB_HOME!\bin\admb" %*
22
    ) else (
23
      echo "Error: Unable to find ADMB_HOME\bin\admb.cmd."
24
      goto EOF
22 25
    )
23 26
  )
24 27
  goto EOF

Also available in: Unified diff