tools/installer/iwmake.bat
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
       
     2 ::
       
     3 :: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 :: All rights reserved.
       
     5 :: Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 ::
       
     7 :: This file is part of the tools applications of the Qt Toolkit.
       
     8 ::
       
     9 :: $QT_BEGIN_LICENSE:LGPL$
       
    10 :: No Commercial Usage
       
    11 :: This file contains pre-release code and may not be distributed.
       
    12 :: You may use this file in accordance with the terms and conditions
       
    13 :: contained in the Technology Preview License Agreement accompanying
       
    14 :: this package.
       
    15 ::
       
    16 :: GNU Lesser General Public License Usage
       
    17 :: Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 :: General Public License version 2.1 as published by the Free Software
       
    19 :: Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 :: packaging of this file.  Please review the following information to
       
    21 :: ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 :: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 ::
       
    24 :: In addition, as a special exception, Nokia gives you certain additional
       
    25 :: rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 :: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 ::
       
    28 :: If you have questions regarding the use of this file, please contact
       
    29 :: Nokia at qt-info@nokia.com.
       
    30 ::
       
    31 ::
       
    32 ::
       
    33 ::
       
    34 ::
       
    35 ::
       
    36 ::
       
    37 ::
       
    38 :: $QT_END_LICENSE$
       
    39 ::
       
    40 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
       
    41 rem @echo off
       
    42 call :init
       
    43 if "%IWMAKE_STATUS%"=="failed" goto FAILED
       
    44 if not exist "%IWMAKE_SCRIPTDIR%\config\%1.conf" goto FAILED
       
    45 if not "%~2"=="" set IWMAKE_SECTION=%~2
       
    46 for /F "eol=# tokens=1,2*" %%i in (%IWMAKE_SCRIPTDIR%\config\config.default) do set IWMAKE_TMP=%%k& call :func_delegate %%i %%j
       
    47 if "%IWMAKE_STATUS%"=="failed" goto FAILED
       
    48 if exist "%IWMAKE_SCRIPTDIR%\config\config.%COMPUTERNAME%" for /F "eol=# tokens=1,2*" %%i in (%IWMAKE_SCRIPTDIR%\config\config.%COMPUTERNAME%) do set IWMAKE_TMP=%%k& call :func_delegate %%i %%j
       
    49 if "%IWMAKE_STATUS%"=="failed" goto FAILED
       
    50 call :checkrequirements
       
    51 if "%IWMAKE_STATUS%"=="failed" goto FAILED
       
    52 for /F "eol=# tokens=1,2*" %%i in (%IWMAKE_SCRIPTDIR%\config\%1.conf) do set IWMAKE_TMP=%%k& call :func_delegate %%i %%j
       
    53 if "%IWMAKE_STATUS%"=="failed" goto FAILED
       
    54 goto DONE
       
    55 
       
    56 :func_delegate
       
    57 if "%IWMAKE_STATUS%"=="failed" goto :eof
       
    58 set IWMAKE_TMP="%IWMAKE_TMP:"=%"
       
    59 
       
    60 if /i "%1"=="sectionend" echo Leaving Section& set IWMAKE_PARSESECTION=1& goto :eof
       
    61 if /i not "%1"=="section" goto callScript
       
    62 echo Entering Section %~2
       
    63 for %%m in (%IWMAKE_SECTION%) do call :checkSection %%m %~2
       
    64 goto :eof
       
    65 
       
    66 :callScript
       
    67 if "%IWMAKE_PARSESECTION%"=="0" goto :eof
       
    68 
       
    69 call "%IWMAKE_SCRIPTDIR%\batch\%1.bat" %2 %IWMAKE_TMP%
       
    70 if not "%errorlevel%"=="0" echo %1 %2 failed! >> %IWMAKE_LOGFILE%& set IWMAKE_STATUS=failed
       
    71 goto :eof
       
    72 
       
    73 :checkSection
       
    74   if /i "%1"=="%2" echo   Skipping Section& set IWMAKE_PARSESECTION=0
       
    75 goto :eof
       
    76 
       
    77 :checkrequirements
       
    78   if not exist %IWMAKE_ROOT% mkdir %IWMAKE_ROOT%
       
    79   if not "%IWMAKE_SIGNPATH%"=="" goto CheckSIGNOK
       
    80   call "%IWMAKE_SCRIPTDIR%\batch\copy.bat" extsync sign
       
    81   call "%IWMAKE_SCRIPTDIR%\batch\env.bat" signPath "%IWMAKE_ROOT%\sign"
       
    82 :CheckSIGNOK
       
    83   if not "%IWMAKE_WGET%"=="" goto CheckWGETOK
       
    84   call "%IWMAKE_SCRIPTDIR%\batch\copy.bat" extsync wget
       
    85   call "%IWMAKE_SCRIPTDIR%\batch\env.bat" wgetDir wget
       
    86 :CheckWGETOK
       
    87   if exist "%IWMAKE_PERLPATH%\perl.exe" goto CheckPerlOK
       
    88   set IWMAKE_STATUS=failed
       
    89   echo Perl not found in %IWMAKE_PERLPATH%! (check your config file)
       
    90 :CheckPerlOK
       
    91   if not "%IWMAKE_UNZIPAPP%"=="" goto CheckUNZIPOK
       
    92   call "%IWMAKE_SCRIPTDIR%\batch\copy.bat" extsync unzip
       
    93   call "%IWMAKE_SCRIPTDIR%\batch\env.bat" unzipApp "%IWMAKE_ROOT%\unzip\unzip.exe"
       
    94 :CheckUNZIPOK
       
    95   if exist "%IWMAKE_NSISPATH%\makensis.exe" goto CheckNSISOK
       
    96   set IWMAKE_STATUS=failed
       
    97   echo NSIS not found! (check your config file)
       
    98 :CheckNSISOK
       
    99   call "%IWMAKE_SCRIPTDIR%\batch\installer.bat" updateplugins
       
   100 goto :eof
       
   101 
       
   102 :init
       
   103   set IWMAKE_SCRIPTDIR=%~dp0
       
   104   set IWMAKE_SCRIPTDIR=%IWMAKE_SCRIPTDIR:~0,-1%
       
   105   call "%IWMAKE_SCRIPTDIR%\batch\env.bat" setglobals
       
   106 goto :eof
       
   107 
       
   108 :cleanup
       
   109   pushd "%IWMAKE_STARTDIR%"
       
   110   call "%IWMAKE_SCRIPTDIR%\batch\env.bat" removeglobals
       
   111   popd
       
   112 goto :eof
       
   113 
       
   114 :FAILED
       
   115   call :cleanup
       
   116   echo Failed!
       
   117 goto END
       
   118 
       
   119 :DONE
       
   120   call :cleanup
       
   121   echo Done!
       
   122 goto END
       
   123 
       
   124 :END