@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

set COMPILER=%1

rem Determine CMake generator
if "%COMPILER%" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%COMPILER%" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%COMPILER%" == "vc8_x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%COMPILER%" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%COMPILER%" == "vc9_x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%COMPILER%" == "vc10" set GENERATOR="Visual Studio 10"
if "%COMPILER%" == "vc10_x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

rem check 7z and dot
7z > NUL
if errorlevel 1 goto 7zerror
dot -V > NUL
if errorlevel 1 goto doterror

set BUILD_DIR=%COMPILER%

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Read OGRE version
set /p OGREVERSION=<%BUILD_DIR%\version.txt

rem Detect whether we're using full version of VStudio or Express
devenv /? > NUL

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

rem build docs explicitly since INSTALL doesn't include it
%DEVENV% OGRE.sln /build "Release" /project "doc"

if errorlevel 1 goto msvcerror

rem Delete unnecessary doc files
pushd api\html
del /Q/F *.hhk *.hhc *.map *.md5 *.dot *.hhp *.plist
popd

rem Build main binaries
%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)
del /Q/F filestopatch.txt
popd

popd

rem Package up
set SDKNAME=OgreSDK_%COMPILER%_v%OGREVERSION%
rmdir /S/Q %SDKNAME%
move %BUILD_DIR%\sdk %SDKNAME%
del /Q/F %SDKNAME%.7z
rem create self-extracting 7zip archive
7z a -r -y -sfx %SDKNAME%.exe %SDKNAME%

echo Done! Test %SDKNAME%.exe and then release
goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
goto end

:7zerror
echo 7z.exe not found on your path, please add
goto end

:doterror
echo dot.exe not found on your path, please add
goto end

:msvcerror
popd
echo Neither devenv.exe nor VCExpress are on your path, use vcvars32.bat
goto end

:end

@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

set COMPILER=%1

rem Determine CMake generator
if "%COMPILER%" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%COMPILER%" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%COMPILER%" == "vc8_x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%COMPILER%" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%COMPILER%" == "vc9_x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%COMPILER%" == "vc10" set GENERATOR="Visual Studio 10"
if "%COMPILER%" == "vc10_x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

rem check 7z and dot
7z > NUL
if errorlevel 1 goto 7zerror
dot -V > NUL
if errorlevel 1 goto doterror

set BUILD_DIR=%COMPILER%

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Read OGRE version
set /p OGREVERSION=<version.txt

rem Detect whether we're using full version of VStudio or Express
devenv /? > NUL

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

rem build docs explicitly since INSTALL doesn't include it
%DEVENV% OGRE.sln /build "Release" /project "doc"

if errorlevel 1 goto msvcerror

rem Delete unnecessary doc files
pushd api\html
del /Q/F *.hhk *.hhc *.map *.md5 *.dot *.hhp *.plist
popd

rem Build main binaries
%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)
del /Q/F filestopatch.txt
popd

popd

rem Package up
set SDKNAME=OgreSDK_%COMPILER%_v%OGREVERSION%
rmdir /S/Q %SDKNAME%
move %BUILD_DIR%\sdk %SDKNAME%
del /Q/F %SDKNAME%.7z
rem create self-extracting 7zip archive
7z a -r -y -sfx %SDKNAME%.exe %SDKNAME%

echo Done! Test %SDKNAME%.exe and then release
goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
goto end

:7zerror
echo 7z.exe not found on your path, please add
goto end

:doterror
echo dot.exe not found on your path, please add
goto end

:msvcerror
popd
echo Neither devenv.exe nor VCExpress are on your path, use vcvars32.bat
goto end

:end

Read OGREVERSION correctly

Read OGREVERSION correctly


@echo off
:: Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
:: for details. All rights reserved. Use of this source code is governed by a
:: BSD-style license that can be found in the LICENSE file.

:: Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
:: structure.

set SCRIPTPATH=%~dp0

:: Does the string have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%

"%SCRIPTPATH%\dart.exe" --package-root="%SCRIPTPATH%\..\packages\" "%SCRIPTPATH%\..\util\pub\pub.dart" %*

@echo off
:: Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
:: for details. All rights reserved. Use of this source code is governed by a
:: BSD-style license that can be found in the LICENSE file.

:: Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
:: structure.

set SCRIPTPATH=%~dp0

:: Does the string have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%

:: The trailing forward slash in --package-root is required because of issue
:: 9499.
"%SCRIPTPATH%\dart.exe" --package-root="%SCRIPTPATH%\..\packages/" "%SCRIPTPATH%\..\util\pub\pub.dart" %*

Work around issue 9499.

Work around issue 9499.

Review URL: https://codereview.chromium.org//13236002

git-svn-id: a962b240025cf0577aa172e20f49ccb159ba6be1@20648 260f80e4-7a28-3924-810f-c04153c831b5


@echo off

:: hook `nodist use <version>`
if "%1"=="use" (
  %0 + %2
  if ERRORLEVEL 0 (
    :: get path to version and add it to PATH
    FOR /F "tokens=1 delims=" %%A in ('"%0" path %2') do @set "Path=%%A;%Path%"
  )
  goto end
)

:: hook `nodist update`
if "%1"=="update" (
  pushd .
  cd /D "%~dp0\.."
  npm update
  popd
)

:main
"%~dp0\..\node.exe" "%~dp0\..\cli" %*
goto end

:end

@echo off

:: hook `nodist use <version>`
if "%1"=="use" (
  call %0 + %2
  if ERRORLEVEL 0 (
    :: get path to version and add it to PATH
    FOR /F "tokens=1 delims=" %%A in ('"%0" path %2') do @set "Path=%%A;%Path%"
  )
  goto end
)

:: hook `nodist update`
if "%1"=="update" (
  pushd .
  cd /D "%~dp0\.."
  npm update
  popd
)

:main
"%~dp0\..\node.exe" "%~dp0\..\cli" %*
goto end

:end

Fix #12 `nodist use`

Fix #12 `nodist use`

Use `call nodist use <version>` in order to not exit after USING a version


xcopy /Y /F "../../dist/preview release/babylon.d.ts" .
xcopy /Y /F "../../dist/preview release/babylon.js" .
xcopy /Y /F "../../dist/preview release/babylon.max.js"  .
xcopy /Y /F "../../dist/preview release/babylon.noworker.js" .
xcopy /Y /F "../../dist/preview release/babylon.core.js" .
xcopy /Y /F "../../dist/preview release/oimo.js" .
pause

xcopy /Y /F "../../dist/preview release/babylon.d.ts" .
xcopy /Y /F "../../dist/preview release/babylon.js" .
xcopy /Y /F "../../dist/preview release/babylon.max.js"  .
xcopy /Y /F "../../dist/preview release/babylon.noworker.js" .
xcopy /Y /F "../../dist/preview release/babylon.core.js" .
xcopy /Y /F "../../dist/preview release/canvas2D/babylon.canvas2d.js" .
xcopy /Y /F "../../dist/preview release/oimo.js" .
pause

Add Canvas2D to the npm release script

Add Canvas2D to the npm release script


curl -sSf https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe -o rust-nightly-%TARGET%.exe

rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"

set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%

set CARGO_TARGET_DIR=%APPVEYOR_BUILD_FOLDER%\target
rustc -V
cargo -V

git submodule update --init --recursive

curl -sSf https://static.rust-lang.org/dist/rust-nightly-%TARGET%.exe -o rust-nightly-%TARGET%.exe

rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"

set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%

set CARGO_TARGET_DIR=%APPVEYOR_BUILD_FOLDER%\target
rustc -V
cargo -V

git submodule update --init --recursive

[DRAFT] Change symbols to var resolve for windows builds


cd %~dp0
git pull origin master
php artisan migrate
php artisan optimize

cd %~dp0
git pull
php artisan migrate
php artisan optimize

修改代码更新 bat

修改代码更新 bat


@echo off

rem This script is in use by the Windows buildslaves to upload the package to openphdguiding.org

set exitcode=1

for /F "usebackq" %%f in (`dir phd2-*-win32.exe /O-D /B` ) do (
  if EXIST %%f (
   (
   echo cd upload
   echo put %%f
   echo quit
   ) | psftp phd2buildbot@openphdguiding.org
   set exitcode=%errorlevel%
  )
  goto :end
)

:end
exit /B %exitcode%

@echo off

rem This script is in use by the Windows buildslaves to upload the package to openphdguiding.org
rem
rem Before to run this script you need to install putty and add it to PATH.
rem As we cannot use pageant from the buildbot service we need to create
rem a saved session named phd2buildbot in putty using the same user as the service.
rem Set the hostname, auto-login user name and private key in the session.

set exitcode=1

for /F "usebackq" %%f in (`dir phd2-*-win32.exe /O-D /B` ) do (
  if EXIST %%f (
   (
   echo cd upload
   echo put %%f
   echo quit
   ) | psftp phd2buildbot
   set exitcode=%errorlevel%
  )
  goto :end
)

:end
exit /B %exitcode%

Use a putty saved session instead of pageant


@echo off
echo Press any key to publish
pause
".nuget\NuGet.exe" push Rssdp.3.5.0-beta.nupkg -Source https://www.nuget.org/api/v2/package
pause

@echo off
echo Press any key to publish
pause
".nuget\NuGet.exe" push Rssdp.3.5.3.nupkg -Source https://www.nuget.org/api/v2/package
pause

Update command file for publishing nuget.


setlocal

cl rbuildmode.c
rbuildmode.exe
if errorlevel 1 (set BUILDMODE=win32) else (set BUILDMODE=x64)

set DEVENV=devenv
for %%X in (vcexpress.exe) do (set VCEXP=%%~$PATH:X)
if defined VCEXP set DEVENV=%VCEXP%

cd racket
"%DEVENV%" racket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\gracket
"%DEVENV%" gracket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd gc2
..\..\..\racketcgc %SELF_RACKET_FLAGS% -cu make.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzstart
"%DEVENV%" mzstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\mrstart
"%DEVENV%" mrstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
..\..\..\racket %SELF_RACKET_FLAGS% -cu xform.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "3m|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../etc\") (void) (make-directory \"../../etc\"))"
if errorlevel 1 exit /B 1
..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../doc\") (void) (make-directory \"../../doc\"))"
if errorlevel 1 exit /B 1

copy COPYING-libscheme.txt ..\..\etc\
copy COPYING_LESSER.txt ..\..\etc\
copy COPYING.txt ..\..\etc\

..\..\racket -N "raco setup" %SELF_RACKET_FLAGS% -l- setup %PLT_SETUP_OPTIONS%
if errorlevel 1 exit /B 1

setlocal

cl rbuildmode.c
rbuildmode.exe
if errorlevel 1 (set BUILDMODE=win32) else (set BUILDMODE=x64)

set DEVENV=devenv
for %%X in (vcexpress.exe) do (set VCEXP=%%~$PATH:X)
if defined VCEXP set DEVENV=%VCEXP%

cd racket
"%DEVENV%" racket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\gracket
"%DEVENV%" gracket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd gc2
..\..\..\racketcgc %SELF_RACKET_FLAGS% -cu make.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzstart
"%DEVENV%" mzstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\mrstart
"%DEVENV%" mrstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
..\..\..\racket %SELF_RACKET_FLAGS% -cu xform.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "3m|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../etc\") (void) (make-directory \"../../etc\"))"
if errorlevel 1 exit /B 1
..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../doc\") (void) (make-directory \"../../doc\"))"
if errorlevel 1 exit /B 1

copy ..\COPYING-libscheme.txt ..\..\lib\
if errorlevel 1 exit /B 1
copy ..\COPYING_LESSER.txt ..\..\lib\
if errorlevel 1 exit /B 1
copy ..\COPYING.txt ..\..\lib\
if errorlevel 1 exit /B 1

..\..\racket -N "raco setup" %SELF_RACKET_FLAGS% -l- setup %PLT_SETUP_OPTIONS%
if errorlevel 1 exit /B 1

win32: fix destination of COPYING files in build


fix script (pffft i'm getting nervous)

fix script (pffft i'm getting nervous)


path "C:\Program Files (x86)\MSBuild\14.0\Bin\";%windir%\Microsoft.NET\Framework\v4.0.30319;%PATH%

@IF NOT EXIST MSBuild.exe @ECHO COULDN'T FIND MSBUILD (Is .NET 4 installed?)

msbuild n2.proj /maxcpucount /p:VisualStudioVersion=12.0 %*

path "C:\Program Files (x86)\MSBuild\14.0\Bin\";%windir%\Microsoft.NET\Framework\v4.0.30319;%PATH%

@IF NOT EXIST MSBuild.exe @ECHO COULDN'T FIND MSBUILD (Is .NET 4 installed?)

msbuild n2.proj /maxcpucount %*

Remove dependency on specific VS toolchain (fixes build when VS 2013 is not installed)


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/14.1.2/8497320/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

rd /Q "C:\Windows\Temp\vmware-tools.tar"
rd /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.2.16/VBoxGuestAdditions_5.2.16.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/14.1.2/8497320/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

rd /Q "C:\Windows\Temp\vmware-tools.tar"
rd /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.2.16/VBoxGuestAdditions_5.2.16.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

Remove non-existing cert

Remove non-existing cert


NuGet Pack ..\Source\Topshelf.SimpleInjector.QuickStart\Topshelf.SimpleInjector.QuickStart.csproj -OutputDirectory ..\PublishedNugetPackages\

build script

build script


rem @echo off
SET OSGEO4W_ROOT="C:\Program Files\QGIS Essen"

SET PYCHARM="C:\Program Files\JetBrains\PyCharm 2017.1.4\bin\pycharm.bat"

call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-7.0.4\etc\env.bat

rem @echo off

path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass-7.0.4\lib

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\qgis

start "PyCharm aware of QGIS" /B %PYCHARM% %*

rem @echo off
SET OSGEO4W_ROOT="C:\OSGeo4W64\"

SET PYCHARM="C:\Program Files\JetBrains\PyCharm 2017.1.4\bin\pycharm.bat"

call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-7.0.4\etc\env.bat

rem @echo off

path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass-7.0.4\lib

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\qgis

start "PyCharm aware of QGIS" /B %PYCHARM% %*

fix qgis path for windows

fix qgis path for windows


@echo off
setlocal enabledelayedexpansion
title Protector anti autorun.inf
echo Protector anti autorun.inf v1.0

if "%1"=="" (
	:init
	rem Si el usuario no ingresa la ruta
	echo Creando archivos
	set /a cont = 0

	rem Creamos primero los archivos
	if not exist autorun.inf (
		md autorun.inf
		set /a cont = !cont!+1
		echo Autorun.inf creado
	) else (
		echo No se pudo crear "autorun.inf" porque ya existe
	)

	if not exist autorun.ini (
		md autorun.ini
		set /a cont = !cont!+1
		echo Autorun.ini creado
	) else (
		echo No se pudo crear "autorun.ini" porque ya existe
	)

	if not exist system (
		@echo off > system.txt
		ren system.txt system
		set /a cont = !cont!+1
		echo Archivo "system" creado
	) else (
		echo No se pudo crear "system" porque ya existe
	)

	if not exist drive (
		@echo off > drive.txt
		ren drive.txt drive
		set /a cont = !cont!+1
		echo Archivo "drive" creado
	) else (
		echo No se pudo crear "drive" porque ya existe
	)

	if !cont! gtr 0 (
		if !cont! gtr 1 (
			echo Archivos creados

		) else (
			echo Archivo creado
		)

	) else (
		echo No se pudieron crear los archivos por alguna razon
		goto fin
	)

	echo Ocultando archivos

	set /a cont2 = 0
	if exist autorun.inf (
		attrib +r +h autorun.inf
		set /a cont2 = !cont2! + 1
	)
	if exist autorun.ini (
		attrib +r +h autorun.ini
		set /a cont2 = !cont2! + 1
	)
	if exist system (
		attrib +r +h system
		set /a cont2 = !cont2! + 1
	)
	if exist drive (
		attrib +r +h drive
		set /a cont2 = !cont2! + 1
	)

	if !cont2! gtr 0 (
		if !cont2! gtr 1 (
			echo Archivos ocultados

		) else (
			echo Archivo ocultado
		)

	) else (
		echo No se pudieron ocultar los archivos por alguna razon
	)

	goto fin

) else (
	if exist %1 (
		cd %1
		goto init

	) else (
		echo La ruta especificada no existe o no es correcta
		goto fin
	)
)

:fin
echo.
pause
exit

Create protector.bat

Create protector.bat

Programa que crea archivos que protegen del virus "autorun.inf".
Para usarlo solo da doble clic al archivo .bat y este creará y ocultará los archivos necesarios en la carpeta donde se encuentra el mismo archivo.
También se puede usar desde el prompt ingresando la ruta donde se quiere crear los archivos como argumento. Ejemplo:

protector f:

En ese caso el archivo .bat creará los archivos en la ruta especificada, en este caso sería la F:


### application.bat - 2015 - HURTAUD ###
echo "version 1.2.1";
pause;

update minor version

update minor version


makesfx.exe -mf -ft -we -di -un -c -h -o ..\Subtle.Setup\Release %TEMP%\Subtle.exe ..\Subtle.Setup\Release\setup.exe

makesfx.exe -mf -ft -we -di -un -c -h -o ..\Subtle.Setup\Release Subtle.exe ..\Subtle.Setup\Release\setup.exe

Update release script

Update release script


@echo off
:: Assume number of times field names occur in each log is stable and
:: reliable. Search log for each occurrence of field name, redirect to
:: temp file, then combine all together into single csv at end.
::
:: A zero line output file means that field was not found in the log.
::

if [%1]==[] goto :Usage
if not exist "%1" goto :Usage

set logfile=%1
if not exist scratch mkdir scratch

for /f "delims=;" %%a in (field_names.txt) do call :Get_Field_Values "%%a"

goto :eof

:: ------------- Sub-routines ----------------

:Get_Field_Values
    findstr /C:%1 %logfile% > scratch\%1.txt
    goto :eof

:Usage
    echo.
    echo.	Usage:	%~n0 [logfile]
    echo.
    goto :eof

@echo off
:: Assume number of times field names occur in each log is stable and
:: reliable. Search log for each occurrence of field name, redirect to
:: temp file, then combine all together into single csv at end.
::
:: A zero line output file means that field was not found in the log.
::

if [%1]==[] goto :Usage
if not exist "%1" goto :Usage

set logfile=%1
if not exist scratch mkdir scratch

for /f "delims=;" %%a in (field_names.txt) do call :Get_Field_Values "%%a"
start scratch

call :Build_CSV

goto :eof

:: ------------- Sub-routines ----------------

:Get_Field_Values
    findstr /C:%1 %logfile% > scratch\%1.txt
    :: TODO: change so only capture values (stuff to right of `=`)
    goto :eof

:Build_CSV
    echo.   +++ Build_CSV not yet implemented.
    goto :eof

:Usage
    echo.
    echo.	Usage:	%~n0 [logfile]
    echo.
    goto :eof


CD /D %~dp0
call npm install -g grunt-cli
call npm install
rem call grunt --level=WHITESPACE_ONLY --formatting=PRETTY_PRINT
call grunt --level=ADVANCED
copy ..\word\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\word\sdk-all.js
copy ..\word\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\word\sdk-all-min.js
copy ..\slide\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\slide\sdk-all.js
copy ..\slide\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\slide\sdk-all-min.js
copy ..\cell\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\cell\sdk-all.js
copy ..\cell\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\cell\sdk-all-min.js
copy ..\common\Native\native.js ..\..\core\build\jsbuilder\sdkjs\common\Native\native.js
pause

CD /D %~dp0
call npm install -g grunt-cli
call npm install

SET PRODUCT_VERSION=4.4.1
SET BUILD_NUMBER=1

rem call grunt --level=WHITESPACE_ONLY --formatting=PRETTY_PRINT
call grunt --level=ADVANCED

copy ..\word\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\word\sdk-all.js
copy ..\word\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\word\sdk-all-min.js
copy ..\slide\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\slide\sdk-all.js
copy ..\slide\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\slide\sdk-all-min.js
copy ..\cell\sdk-all.js ..\..\core\build\jsbuilder\sdkjs\cell\sdk-all.js
copy ..\cell\sdk-all-min.js ..\..\core\build\jsbuilder\sdkjs\cell\sdk-all-min.js
copy ..\common\Native\native.js ..\..\core\build\jsbuilder\sdkjs\common\Native\native.js
pause

add version variables

add version variables


:: Copyright (c) 2011 The Native Client Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

@echo off
setlocal
set HERMETIC_CYGWIN=hermetic_cygwin_1_7_15-0_1-with-20120817-cygwin
if exist "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed" goto :skip_cygwin_install
if exist "%~dp0..\tools\BUILD\.gcc-extras-version" del "%~dp0..\tools\BUILD\.gcc-extras-version"
if exist "%~dp0..\tools\BACKPORTS\binutils" rmdir /s /q "%~dp0..\tools\BACKPORTS\binutils"
if exist "%~dp0..\tools\BACKPORTS\gcc" rmdir /s /q "%~dp0..\tools\BACKPORTS\gcc"
if exist "%~dp0..\tools\BACKPORTS\gdb" rmdir /s /q "%~dp0..\tools\BACKPORTS\gdb"
if exist "%~dp0..\tools\BACKPORTS\glibc" rmdir /s /q "%~dp0..\tools\BACKPORTS\glibc"
if exist "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl" rmdir /s /q "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl"
if exist "%~dp0..\tools\BACKPORTS\newlib" rmdir /s /q "%~dp0..\tools\BACKPORTS\newlib"
if not exist "%~dp0..\cygwin" goto :dont_remove_cygwin
rmdir /s /q "%~dp0..\cygwin"
if errorlevel 1 goto :rmdir_fail
mkdir "%~dp0..\cygwin"
:dont_remove_cygwin
cscript //nologo //e:jscript "%~dp0get_file.js" https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :download_fail
:download_success
start /WAIT %~dp0%HERMETIC_CYGWIN%.exe /DEVEL /S /D=%~dp0..\cygwin
if errorlevel 1 goto :install_fail
set CYGWIN=nodosfilewarning
"%~dp0..\cygwin\bin\touch" "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed"
if errorlevel 1 goto :install_fail
del /f /q "%~dp0%HERMETIC_CYGWIN%.exe"
:skip_cygwin_install
endlocal
set "PATH=%~dp0..\cygwin\bin;%PATH%"
goto :end
:rmdir_fail
endlocal
echo Failed to remove old version of cygwin
set ERRORLEVEL=1
goto :end
:download_fail
:: TODO(bradnelson): Check certs when this issue is resolved.
::     http://code.google.com/p/nativeclient/issues/detail?id=2931
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :wget_fail
goto download_success
:wget_fail
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :cygwin_wget_fail
goto download_success
:cygwin_wget_fail
endlocal
echo Failed to download cygwin
set ERRORLEVEL=1
goto :end
:install_fail
endlocal
echo Failed to install cygwin
set ERRORLEVEL=1
goto :end
:end

:: Copyright (c) 2011 The Native Client Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

@echo off
setlocal
set HERMETIC_CYGWIN=hermetic_cygwin_1_7_15-0_1-with-20120827-cygwin
if exist "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed" goto :skip_cygwin_install
if exist "%~dp0..\tools\BUILD\.gcc-extras-version" del "%~dp0..\tools\BUILD\.gcc-extras-version"
if exist "%~dp0..\tools\BACKPORTS\binutils" rmdir /s /q "%~dp0..\tools\BACKPORTS\binutils"
if exist "%~dp0..\tools\BACKPORTS\gcc" rmdir /s /q "%~dp0..\tools\BACKPORTS\gcc"
if exist "%~dp0..\tools\BACKPORTS\gdb" rmdir /s /q "%~dp0..\tools\BACKPORTS\gdb"
if exist "%~dp0..\tools\BACKPORTS\glibc" rmdir /s /q "%~dp0..\tools\BACKPORTS\glibc"
if exist "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl" rmdir /s /q "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl"
if exist "%~dp0..\tools\BACKPORTS\newlib" rmdir /s /q "%~dp0..\tools\BACKPORTS\newlib"
if not exist "%~dp0..\cygwin" goto :dont_remove_cygwin
rmdir /s /q "%~dp0..\cygwin"
if errorlevel 1 goto :rmdir_fail
mkdir "%~dp0..\cygwin"
:dont_remove_cygwin
cscript //nologo //e:jscript "%~dp0get_file.js" https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :download_fail
:download_success
start /WAIT %~dp0%HERMETIC_CYGWIN%.exe /DEVEL /S /D=%~dp0..\cygwin
if errorlevel 1 goto :install_fail
set CYGWIN=nodosfilewarning
"%~dp0..\cygwin\bin\touch" "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed"
if errorlevel 1 goto :install_fail
del /f /q "%~dp0%HERMETIC_CYGWIN%.exe"
:skip_cygwin_install
endlocal
set "PATH=%~dp0..\cygwin\bin;%PATH%"
goto :end
:rmdir_fail
endlocal
echo Failed to remove old version of cygwin
set ERRORLEVEL=1
goto :end
:download_fail
:: TODO(bradnelson): Check certs when this issue is resolved.
::     http://code.google.com/p/nativeclient/issues/detail?id=2931
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :wget_fail
goto download_success
:wget_fail
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :cygwin_wget_fail
goto download_success
:cygwin_wget_fail
endlocal
echo Failed to download cygwin
set ERRORLEVEL=1
goto :end
:install_fail
endlocal
echo Failed to install cygwin
set ERRORLEVEL=1
goto :end
:end

Update to new cygwin version.

Update to new cygwin version.

Previously, I included wrong archive in the installer
which doesn't contain my fix.

BUG= none
TEST= toolchain bots
Review URL: https://chromiumcodereview.appspot.com/10912044

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@9623 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2


SET FLEXTRANS_VERSION=3.5
rem Delete everything in Install2.0
rd /s /q Install2.0

rem Delete everything in Install2.0
rd /s /q Install2.0

rem Now do steps to create a zip that has FLExTools FLExTrans and SenseLinker all in one file
rem mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Collections
rem mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Output
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\__icons
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Config
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Config\Collections
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Output

xcopy FlexTools2.0\* Install2.0\FlexTools2.0-FLExTrans
xcopy FlexTools2.0\FlexTools\* Install2.0\FlexTools2.0-FLExTrans\FlexTools
xcopy /s FlexTools2.0\FlexTools\__icons\* Install2.0\FlexTools2.0-FLExTrans\FlexTools\__icons
echo fuzzywuzzy >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo Levenshtein >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo PyQt5==5.14 >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo PyQtWebEngine==5.14 >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt

rem core models
copy CatalogTargetPrefixes.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ConvertTextToSTAMPformat.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractBilingualLexicon.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractSourceText.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractTargetLexicon.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy InsertTargetText.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy RunApertium.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy RunTreeTran.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans

rem libraries
copy readconfig.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
copy Utils.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
copy MyTableView.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib

rem other stuff
copy /Y subdirs.pth Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules
copy stamp32.exe Install2.0\FlexTools2.0-FLExTrans\FlexTools
copy Makefile Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build
copy FlexTools.vbs Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish
copy source_text.txt Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Output

rem Documentation
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Images"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Transfer Rules Tutorial"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Agreement"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Irregular Form"
copy Doc\*.htm "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation"
copy Doc\Images\* "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Images"
copy "Doc\Transfer Rules Tutorial\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Transfer Rules Tutorial"
copy "Doc\Agreement\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Agreement"
copy "Doc\Irregular Form\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Irregular Form"

rem SampleProjects
mkdir "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"
copy "Sample Projects\German-FLExTrans-Sample 2016-10-19 2109.fwbackup" "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"
copy "Sample Projects\Swedish-FLExTrans-Sample 2016-10-19 2110.fwbackup" "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"

rem Sense Linker pieces
copy LinkSenseTool.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy Linker.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem Live Rule Tester pieces
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build\LiveRuleTester
copy LiveRuleTesterTool.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy LiveRuleTester.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy UpArrow.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy DownArrow.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy MakefileForLiveRuleTester Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build\LiveRuleTester\Makefile

rem View Source-Target pieces
copy ViewSrcTgt.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy SrcTgtViewer.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem SetUp Gramm Categories pieces
copy SetUpTransferRuleGramCat.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans

rem Testbed pieces
copy TestbedValidator.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy StartTestbed.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy EndTestbed.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy OverWriteTestDlg.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy TestbedLogViewer.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy TestbedLog.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy Light_green_check.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy Red_x.png             Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy Yellow_triangle.png   Install2.0\FlexTools2.0-FLExTrans\FLExTools

rem Paratext Import/Export Tools
copy ImportFromParatext.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy ExportToParatext.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy ParatextChapSelectionDlg.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy ChapterSelection.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem Settings tool
copy Settings.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans\Lib
copy ComboBox.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans\lib
copy SettingsGUI.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans

rem Other Tools
copy CleanFiles.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy SetWorkingProject.py Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build

SET ADD_ON_ZIP_FILE=AddOnsForXMLmind%FLEXTRANS_VERSION%.zip
cd XXEaddon
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumDictionaryXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumInterchunkXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumPostchunkXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumTransferXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% FLExTransTestbedXMLmind

copy /Y %ADD_ON_ZIP_FILE% ..
copy /Y %ADD_ON_ZIP_FILE% ..\"previous versions"
del %ADD_ON_ZIP_FILE%
cd ..

SET ZIP_FILE=FLExTools20WithFLExTrans%FLEXTRANS_VERSION%.zip
cd Install2.0
"%SEVENZ_PATH%"\7z a %ZIP_FILE% FlexTools2.0-FLExTrans
copy /Y %ZIP_FILE% ..
copy /Y %ZIP_FILE% ..\"previous versions"
del %ZIP_FILE%
cd ..

pause

SET FLEXTRANS_VERSION=3.5
rem Delete everything in Install2.0
rd /s /q Install2.0

rem Delete everything in Install2.0
rd /s /q Install2.0

rem Now do steps to create a zip that has FLExTools FLExTrans and SenseLinker all in one file
rem mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Collections
rem mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Output
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\__icons
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
mkdir Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Config
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Config\Collections
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Output

xcopy FlexTools2.0\* Install2.0\FlexTools2.0-FLExTrans
xcopy FlexTools2.0\FlexTools\* Install2.0\FlexTools2.0-FLExTrans\FlexTools
xcopy /s FlexTools2.0\FlexTools\__icons\* Install2.0\FlexTools2.0-FLExTrans\FlexTools\__icons
echo fuzzywuzzy >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo Levenshtein >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo PyQt5==5.14 >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt
echo PyQtWebEngine==5.14 >> Install2.0\FlexTools2.0-FLExTrans\requirements.txt

rem core models
copy CatalogTargetPrefixes.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ConvertTextToSTAMPformat.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractBilingualLexicon.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractSourceText.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy ExtractTargetLexicon.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy InsertTargetText.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy RunApertium.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans
copy RunTreeTran.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans

rem libraries
copy readconfig.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
copy Utils.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib
copy MyTableView.py Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules\FLExTrans\Lib

rem other stuff
copy /Y subdirs.pth Install2.0\FlexTools2.0-FLExTrans\FlexTools\Modules
copy stamp32.exe Install2.0\FlexTools2.0-FLExTrans\FlexTools
copy Makefile Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build
copy FlexTools.vbs Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish
copy source_text.txt Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Output

rem Documentation
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Images"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Transfer Rules Tutorial"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Agreement"
mkdir "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Irregular Form"
copy Doc\*.htm "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation"
copy Doc\Images\* "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Images"
copy "Doc\Transfer Rules Tutorial\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Transfer Rules Tutorial"
copy "Doc\Agreement\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Agreement"
copy "Doc\Irregular Form\*" "Install2.0\FlexTools2.0-FLExTrans\FLExTrans Documentation\Irregular Form"

rem SampleProjects
mkdir "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"
copy "Sample Projects\German-FLExTrans-Sample 2016-10-19 2109.fwbackup" "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"
copy "Sample Projects\Swedish-FLExTrans-Sample 2016-10-19 2110.fwbackup" "Install2.0\FlexTools2.0-FLExTrans\SampleProjects"

rem Sense Linker pieces
copy LinkSenseTool.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy Linker.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem Live Rule Tester pieces
mkdir Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build\LiveRuleTester
copy LiveRuleTesterTool.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy LiveRuleTester.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy UpArrow.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy DownArrow.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy MakefileForLiveRuleTester Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build\LiveRuleTester\Makefile

rem View Source-Target pieces
copy ViewSrcTgt.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy SrcTgtViewer.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem SetUp Gramm Categories pieces
copy SetUpTransferRuleGramCat.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans

rem Testbed pieces
copy TestbedValidator.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy StartTestbed.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy EndTestbed.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy OverWriteTestDlg.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy TestbedLogViewer.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy TestbedLog.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy Light_green_check.png Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy Red_x.png             Install2.0\FlexTools2.0-FLExTrans\FLExTools
copy Yellow_triangle.png   Install2.0\FlexTools2.0-FLExTrans\FLExTools

rem Paratext Import/Export Tools
copy ImportFromParatext.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy ExportToParatext.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy ParatextChapSelectionDlg.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib
copy ChapterSelection.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans\Lib

rem Settings tool
copy Settings.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans\Lib
copy ComboBox.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans\lib
copy SettingsGUI.py Install2.0\FlexTools2.0\FLExTools\Moduels\FLExTrans

rem Apertium files
copy Apertium4Windows\* Install2.0\FlexTools2.0\FLExTools

rem Make for Windows files
copy Make4Windows\* Install2.0\FlexTools2.0\FLExTools

rem Other Tools
copy CleanFiles.py Install2.0\FlexTools2.0-FLExTrans\FLExTools\Modules\FLExTrans
copy SetWorkingProject.py Install2.0\FlexTools2.0-FLExTrans\WorkProjects\German-Swedish\Build

SET ADD_ON_ZIP_FILE=AddOnsForXMLmind%FLEXTRANS_VERSION%.zip
cd XXEaddon
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumDictionaryXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumInterchunkXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumPostchunkXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% ApertiumTransferXMLmind
"%SEVENZ_PATH%"\7z a %ADD_ON_ZIP_FILE% FLExTransTestbedXMLmind

copy /Y %ADD_ON_ZIP_FILE% ..
copy /Y %ADD_ON_ZIP_FILE% ..\"previous versions"
del %ADD_ON_ZIP_FILE%
cd ..

SET ZIP_FILE=FLExTools20WithFLExTrans%FLEXTRANS_VERSION%.zip
cd Install2.0
"%SEVENZ_PATH%"\7z a %ZIP_FILE% FlexTools2.0-FLExTrans
copy /Y %ZIP_FILE% ..
copy /Y %ZIP_FILE% ..\"previous versions"
del %ZIP_FILE%
cd ..

pause

copy Apertium and Make programs

copy Apertium and Make programs


REM @echo off

for /D %%i in (zeronet-*) do (cd "%%i"&& npm i&& cd ..)

npm i

goto :eof

REM @echo off

for /D %%i in (zeronet-*) do (cd "%%i"&& npm i&& cd ..)&& npm i

goto :eof

Fix again

Fix again


@setlocal
@echo off

REM TODO: unblock files

:run
%~dp0bin\Agent.Listener.exe %*

@setlocal
@echo off

REM TODO: unblock files

:run
"%~dp0bin\Agent.Listener.exe" %*

Add double quotes.

Add double quotes.


set FILENOTFOUND=0

if not exist dxcompiler.dll (
   echo No dxcompiler.dll found!
   set FILENOTFOUND=1
)

if not exist d3d12.dll (
   echo No d3d12.dll found!
   set FILENOTFOUND=1
)

if not exist d3d12sdklayers.dll (
   echo No d3d12sdklayers.dll found!
   set FILENOTFOUND=1
)

if not exist dxgidebug.dll (
   echo No dxgidebug.dll found!
   set FILENOTFOUND=1
)

if not exist dxc.exe (
   echo No dxc.exe found!
   set FILENOTFOUND=1
)
echo Renaming dxc->fxc so that Visual Studio can natively work with HLSL files and still compile them to SM 6.1
copy dxc.exe fxc.exe

if %FILENOTFOUND% NEQ 0 (
	echo Please go to https://github.com/Microsoft/DirectX-Graphics-Samples/releases and download "DirectX Raytracing Binary Release v1.0".
	echo Copy all the binaries to Samples\Desktop\D3D12Raytracing\tools\x64"
	exit /b 1
)

if not exist version.txt (
   goto :mismatch
)

set /p version=< version.txt
if not "%version%"=="1.1-dxr" (
	goto :mismatch
)

exit

:mismatch
	echo Stale binaries detected, please grab the v1.1-dxr binaries from https://github.com/Microsoft/DirectX-Graphics-Samples/releases
	echo Copy all the binaries to Samples\Desktop\D3D12Raytracing\tools\x64"
	exit /b 1
)

set FILENOTFOUND=0

if not exist dxcompiler.dll (
   echo No dxcompiler.dll found!
   set FILENOTFOUND=1
)

if not exist d3d12.dll (
   echo No d3d12.dll found!
   set FILENOTFOUND=1
)

if not exist d3d12sdklayers.dll (
   echo No d3d12sdklayers.dll found!
   set FILENOTFOUND=1
)

if not exist dxgidebug.dll (
   echo No dxgidebug.dll found!
   set FILENOTFOUND=1
)

if not exist dxc.exe (
   echo No dxc.exe found!
   set FILENOTFOUND=1
)
echo Renaming dxc->fxc so that Visual Studio can natively work with HLSL files and still compile them to SM 6.1
copy dxc.exe fxc.exe

if %FILENOTFOUND% NEQ 0 (
	echo Please go to https://github.com/Microsoft/DirectX-Graphics-Samples/releases and download latest "DirectX Raytracing Binary Release v1.1".
	echo Copy all the binaries to Samples\Desktop\D3D12Raytracing\tools\x64"
	exit /b 1
)

if not exist version.txt (
   goto :mismatch
)

set /p version=< version.txt
if not "%version%"=="1.1-dxr" (
	goto :mismatch
)

exit

:mismatch
	echo Stale binaries detected, please grab the v1.1-dxr binaries from https://github.com/Microsoft/DirectX-Graphics-Samples/releases
	echo Copy all the binaries to Samples\Desktop\D3D12Raytracing\tools\x64"
	exit /b 1
)

Update version in DXR binaries check. (#361)


python -c "print(r'%PREFIX%'.replace('\\','/'))" > temp.txt
set /p BASH_PREFIX=<temp.txt
del temp.txt

REM Install boost with vcpkg
git clone --branch 2019.11 https://github.com/microsoft/vcpkg.git --single-branch
cd vcpkg
echo set(VCPKG_BUILD_TYPE release)>> triplets/x64-windows-static.cmake
powershell -Command "bootstrap-vcpkg.bat -disableMetrics"
if errorlevel 1 exit 1
vcpkg install boost-filesystem:x64-windows-static boost-program-options:x64-windows-static boost-thread:x64-windows-static boost-python:x64-windows-static boost-dll:x64-windows-static eigen3:x64-windows-static
if errorlevel 1 exit 1

cd ..

cmake -DBUILD_GUI=OFF -DARCH=ice40 -DICEBOX_ROOT="%BASH_PREFIX%/share/icebox" -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -A "x64" -DBUILD_SHARED=OFF -DSTATIC_BUILD=ON "-DCMAKE_INSTALL_PREFIX=%BASH_PREFIX%" .
if errorlevel 1 exit 1
cmake --build . --target install --config Release
if errorlevel 1 exit 1

python -c "print(r'%PREFIX%'.replace('\\','/'))" > temp.txt
set /p BASH_PREFIX=<temp.txt
del temp.txt

REM Install boost with vcpkg
git clone --branch 2019.11 https://github.com/microsoft/vcpkg.git --single-branch
cd vcpkg
echo set(VCPKG_BUILD_TYPE release)>> triplets/x64-windows-static.cmake
powershell -Command "bootstrap-vcpkg.bat -disableMetrics"
if errorlevel 1 exit 1
vcpkg install boost-filesystem:x64-windows-static boost-program-options:x64-windows-static boost-thread:x64-windows-static boost-python:x64-windows-static boost-dll:x64-windows-static eigen3:x64-windows-static
if errorlevel 1 exit 1

cd ..

cmake -DBUILD_GUI=OFF -DARCH=ice40 -DICEBOX_ROOT="%BASH_PREFIX%/share/icebox" -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED=OFF -DSTATIC_BUILD=ON "-DCMAKE_INSTALL_PREFIX=%BASH_PREFIX%" .
if errorlevel 1 exit 1
cmake --build . --target install --config Release
if errorlevel 1 exit 1

fix Windows bld.bat script

pnr/nextpnr/ice40: fix Windows bld.bat script


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set CONTACTS_PLUGIN=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-contact-src"   goto contactsTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -vc ............... Generate Visual Studio make files
    echo -contact-src (backend) ...
    echo                     Compile the specified contacts API backend. Not selecting any backend
    echo                     will result in default selection for build platform
    echo                     options: symbian, wince, memory, maemo

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:contactsTag
shift
set CONTACTS_PLUGIN=%CONTACTS_PLUGIN% %1
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:startProcessing

copy %PROJECT_CONFIG% %BUILD_PATH%\config.pri
del %PROJECT_CONFIG%

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
echo CONTACTS_BACKENDS = %CONTACTS_PLUGIN% >> %PROJECT_CONFIG%

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2 "Cannot find 'qmake' in your PATH."
) else (
    else echo >&2 "Cannot find 'qmake' in %QT_PATH%."
)
echo >&2 "Aborting."
exit 1

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set MAKETYPE=%%i

    if %MAKETYPE% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %MAKETYPE% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %MAKETYPE% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %MAKETYPE% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %MAKETYPE%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%MAKETYPE%&goto :EOF

:checkMake
echo Checking make
call :makeTest MAKE MAKETYPE
if not "%MAKE%" == "" goto compileTests

echo >&2 "Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH"
echo >&2 "Aborting."
exit 1

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MAKE% clean >> %PROJECT_LOG%
    %MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MAKETYPE% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MAKETYPE% == symbian-abld (
        for /f "tokens=2" %%i in ('%MAKE% ABLD^="@ABLD.BAT -c"') do set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests

if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo "Generating Mobility Headers..."
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
exit 1

:exitTag

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set CONTACTS_PLUGIN=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-contact-src"   goto contactsTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -vc ............... Generate Visual Studio make files
    echo -contact-src (backend) ...
    echo                     Compile the specified contacts API backend. Not selecting any backend
    echo                     will result in default selection for build platform
    echo                     options: symbian, wince, memory, maemo

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:contactsTag
shift
set CONTACTS_PLUGIN=%CONTACTS_PLUGIN% %1
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:startProcessing

copy %PROJECT_CONFIG% %BUILD_PATH%\config.pri
del %PROJECT_CONFIG%

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
echo CONTACTS_BACKENDS = %CONTACTS_PLUGIN% >> %PROJECT_CONFIG%

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2Cannot find 'qmake' in your PATH.
    echo >&2Your PATH is: %PATH%
) else (
    echo >&2Cannot find 'qmake' in %QT_PATH%.
)
echo >&2 "Aborting."
exit 1

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set MAKETYPE=%%i

    if %MAKETYPE% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %MAKETYPE% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %MAKETYPE% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %MAKETYPE% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %MAKETYPE%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%MAKETYPE%&goto :EOF

:checkMake
echo Checking make
call :makeTest MAKE MAKETYPE
if not "%MAKE%" == "" goto compileTests

echo >&2 "Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH"
echo >&2 "Aborting."
exit 1

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MAKE% clean >> %PROJECT_LOG%
    %MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MAKETYPE% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MAKETYPE% == symbian-abld (
        for /f "tokens=2" %%i in ('%MAKE% ABLD^="@ABLD.BAT -c"') do set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests

if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo "Generating Mobility Headers..."
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
exit 1

:exitTag

Add additional details on "qmake not in PATH" error.


@echo off
@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT"  setlocal

set ENV_PATH=.\
if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0%

set conf_dir=%ENV_PATH%\..\conf
set logback_configurationFile=%conf_dir%\logback.xml
set client_mode=Simple
if "%1" != "" set client_mode=%1

set CLASSPATH=%conf_dir%
set CLASSPATH=%conf_dir%\..\lib\*;%CLASSPATH%

set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m
set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8
set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9199,server=y,suspend=n
set CANAL_OPTS= -DappName=otter-canal-example -Dlogback.configurationFile="%logback_configurationFile%"

set JAVA_OPTS= %JAVA_MEM_OPTS% %JAVA_OPTS_EXT% %JAVA_DEBUG_OPT% %CANAL_OPTS%

if "%client_mode%" == "Cluster" （
	java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.canal.example.ClusterCanalClientTest
） else （
	java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.canal.example.SimpleCanalClientTest
）

@echo off
@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT"  setlocal

set ENV_PATH=.\
if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0%

set conf_dir=%ENV_PATH%\..\conf
set logback_configurationFile=%conf_dir%\logback.xml
set client_mode=Simple
if "%1" NEQ "" set client_mode=%1

set CLASSPATH=%conf_dir%
set CLASSPATH=%conf_dir%\..\lib\*;%CLASSPATH%

set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m
set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8
set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9199,server=y,suspend=n
set CANAL_OPTS= -DappName=otter-canal-example -Dlogback.configurationFile="%logback_configurationFile%"

set JAVA_OPTS= %JAVA_MEM_OPTS% %JAVA_OPTS_EXT% %JAVA_DEBUG_OPT% %CANAL_OPTS%

if "%client_mode%" == "Cluster" （
	java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.canal.example.ClusterCanalClientTest
） else （
	java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.canal.example.SimpleCanalClientTest
）

修改批处理中的!=为NEQ

修改批处理中的!=为NEQ


if .%1. EQU .. (
    set $PackagePath=bin\Release\
    set $Configuration=--configuration Release
    set $VersionSuffix=
    set $DebugIncludes=
) else (
    set $PackagePath=bin\Debug\
    set $Configuration=--configuration Debug
    set $VersionSuffix=--version-suffix %1
    set $DebugIncludes=--include-symbols --include-source
    )

rem ------- Clean -------
dotnet clean %$Configuration%
del /q %$PackagePath%*.nupkg

rem ------- Build -------
dotnet build %$Configuration% %$VersionSuffix%
if errorlevel 1 pause & goto exit

rem ------- Package -------
dotnet pack %$DebugIncludes% %$Configuration% %$VersionSuffix%
if errorlevel 1 pause & goto exit

rem ------- Publish locally -------
if not exist c:\NuGet md c:\NuGet
copy /y %$PackagePath%*.nupkg c:\NuGet

rem ------- Publish to NuGet.org -------
if .%2. EQU .. (
@echo Press any key to push the packages to NuGet.org or Ctrl-Break to exit... > con:
@pause > nul:
)

dotnet nuget push %$PackagePath% --source https://www.nuget.org/ --symbol-source https://nuget.smbsrc.net/
rem nuget push %$PackagePath% -Source https://www.nuget.org/  -SymbolSource https://nuget.smbsrc.net/ -verbosity detailed
if errorlevel 1 pause & goto exit

if .%$VersionSuffix%. EQU .. (
    git tag vm.Aspects.Security.Cryptography.Ciphers.ProtectedData-%VersionPrefix%
) else (
    git tag vm.Aspects.Security.Cryptography.Ciphers.ProtectedData-%VersionPrefix%-%$VersionSuffix%
)

:exit
if not errorlevel 1 if .%2. EQU .. pause

Add buildProject.cmd

Add buildProject.cmd


@rem Copyright 2016, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

mkdir artifacts

setlocal
cd third_party/protobuf

powershell -Command "Invoke-WebRequest https://googlemock.googlecode.com/files/gmock-1.7.0.zip -OutFile gmock.zip"
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('gmock.zip', '.');"
rename gmock-1.7.0 gmock

cd cmake
cmake -G "%generator%" || goto :error
endlocal

call vsprojects/build_plugins.bat || goto :error

xcopy /Y third_party\protobuf\cmake\Release\protoc.exe artifacts\ || goto :error
xcopy /Y vsprojects\Release\*_plugin.exe artifacts\ || xcopy /Y vsprojects\x64\Release\*_plugin.exe artifacts\ || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2016, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

mkdir artifacts

setlocal
cd third_party/protobuf

cd cmake
cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF || goto :error
endlocal

call vsprojects/build_plugins.bat || goto :error

xcopy /Y third_party\protobuf\cmake\Release\protoc.exe artifacts\ || goto :error
xcopy /Y vsprojects\Release\*_plugin.exe artifacts\ || xcopy /Y vsprojects\x64\Release\*_plugin.exe artifacts\ || goto :error

goto :EOF

:error
exit /b 1

remove dead gmock link in protoc artifact build


@echo off
echo Building setup ...
echo.

del GitMindSetup.exe >nul 2>&1
del version.txt >nul 2>&1

if exist GitMindSetup.exe (
  echo.
  echo Error: Failed to clean GitMindSetup.exe
  pause
  exit
)

if exist version.txt (
  echo.
  echo Error: Failed to clean version.txt
  pause
  exit
)

if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
)

if exist %MSBUILD% (
  rem echo Using MSBuild: %MSBUILD%
  rem echo.

  echo Restore nuget packets ...
  rem call %MSBUILD% /nologo /t:restore /v:m GitMind.sln
  .\Binaries\nuget.exe restore -Verbosity quiet GitMind.sln
  echo.

  echo Building ...
  %MSBUILD% /t:rebuild /v:m /nologo /p:Configuration=Release GitMind.sln
  echo.

  echo Copy Setup file ...
  copy GitMind\bin\Debug\GitMind.exe GitMindSetup.exe /Y >NUL

  PowerShell -Command "& {(Get-Item GitMindSetup.exe).VersionInfo.FILEVERSION }" > version.txt
  echo.

  echo GitMindSetup.exe version:
  type version.txt

) else (
  echo.
  echo Error: Failed to locate compatible msbuild.exe
)

echo.
echo.
pause

@echo off
echo Building setup ...
echo.

del GitMindSetup.exe >nul 2>&1
del version.txt >nul 2>&1

if exist GitMindSetup.exe (
  echo.
  echo Error: Failed to clean GitMindSetup.exe
  pause
  exit
)

if exist version.txt (
  echo.
  echo Error: Failed to clean version.txt
  pause
  exit
)

if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" (
  set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
)

if exist %MSBUILD% (
  rem echo Using MSBuild: %MSBUILD%
  rem echo.

  echo Restore nuget packets ...
  rem call %MSBUILD% /nologo /t:restore /v:m GitMind.sln
  .\Binaries\nuget.exe restore -Verbosity quiet GitMind.sln
  echo.

  echo Building ...
  %MSBUILD% /t:rebuild /v:m /nologo /p:Configuration=Release GitMind.sln
  echo.

  echo Copy Setup file ...
  copy GitMind\bin\Release\GitMind.exe GitMindSetup.exe /Y >NUL

  PowerShell -Command "& {(Get-Item GitMindSetup.exe).VersionInfo.FILEVERSION }" > version.txt
  echo.

  echo GitMindSetup.exe version:
  type version.txt

) else (
  echo.
  echo Error: Failed to locate compatible msbuild.exe
)

echo.
echo.
pause

Fix build script

Fix build script


@ECHO OFF
SETLOCAL
rem SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
rem IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't found; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
rem "..\..\distrib\tools\md5sum.exe" *.7z *.zip *.exe >md5hashes
rem "..\..\distrib\tools\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY /Y /V "..\License.txt" "temp_zip\"
COPY /Y /V "..\%1\Notepad2.exe" "temp_zip\"
COPY /Y /V "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini"
COPY /Y /V "..\Notepad2.txt" "temp_zip\"
COPY /Y /V "..\Readme.txt" "temp_zip\"
COPY /Y /V "..\Readme-mod.txt" "temp_zip\"

PUSHD "temp_zip"
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt

rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" "%NP2_VER%.%VerRev%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

rem get the size and put it in the inf file
PUSHD temp\%BINDIR%
FOR /F "tokens=*" %%a IN ('"DIR /-C | FIND "bytes" | FIND /V "free""') DO SET summaryout=%%a
FOR /F "tokens=1,2 delims=)" %%a IN ("%summaryout%") DO SET filesout=%%a&set sizeout=%%b
SET /A sizeout=%sizeout:bytes=%/1024
POPD

CALL tools\BatchSubstitute.bat "1111" "%sizeout%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
rem devenv setup.sln /Rebuild "Lite|%ARCH%"
rem IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

rem IF EXIST "%PERL_PATH%" (
rem   PUSHD tools
rem   "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
rem   POPD
rem )

MD ..\wdkbuild\packages >NUL 2>&1
rem IF EXIST "%PERL_PATH%" (
rem   MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
rem )
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup.exe >NUL
rem MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup_Silent.exe >NUL

rem Cleanup
RD /Q setup.%BINDIR% temp >NUL 2>&1
RD /Q /S tools\addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
SETLOCAL
rem SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
rem IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't found; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
rem "..\..\distrib\tools\md5sum.exe" *.7z *.zip *.exe >md5hashes
rem "..\..\distrib\tools\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY /Y /V "..\License.txt" "temp_zip\"
COPY /Y /V "..\%1\Notepad2.exe" "temp_zip\"
COPY /Y /V "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini"
COPY /Y /V "..\Notepad2.txt" "temp_zip\"
COPY /Y /V "..\Readme.txt" "temp_zip\"
COPY /Y /V "..\Readme-mod.txt" "temp_zip\"

PUSHD "temp_zip"
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt

rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" "%NP2_VER%.%VerRev%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

rem get the size and put it in the inf file
PUSHD temp\%BINDIR%
FOR /F "tokens=*" %%a IN ('"DIR /-C | FIND "bytes" | FIND /V "free""') DO SET summaryout=%%a
FOR /F "tokens=1,2 delims=)" %%a IN ("%summaryout%") DO SET filesout=%%a&set sizeout=%%b
SET /A sizeout=%sizeout:bytes=%/1024
POPD

CALL tools\BatchSubstitute.bat "1111" "%sizeout%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
rem devenv setup.sln /Rebuild "Lite|%ARCH%"
rem IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

rem IF EXIST "%PERL_PATH%" (
rem   PUSHD tools
rem   "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
rem   POPD
rem )

MD ..\wdkbuild\packages >NUL 2>&1
rem IF EXIST "%PERL_PATH%" (
rem   MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Addon.7z >NUL
rem )
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup.exe >NUL
rem MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup_Silent.exe >NUL

rem Cleanup
RD /Q setup.%BINDIR% temp >NUL 2>&1
RD /Q /S tools\addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

update svn ignore

update svn ignore