Windows-driver-samples/wia/copywia.cmd

111 строки
3.8 KiB
Batchfile

@echo off
rem Copy all of the WIA WDK binaries to a directory named wiabins. An
rem The first optional parameter is a destination directory to prepend to wiabins.
rem The second optional param is the build directory users select in VS project.
rem For example, if users select "Windows 7 Release" as solution configuration, then
rem the build directory generated by VS project is "Windows7Release". There are several
rem types of build directories, such as Windows7Debug, Windows7Release, WindowsVistaDebug, etc.
set cpu_samples=NotRazzle
set cpu_tools=NotRazzle
set build_samples=obj%build_alt_dir%
set build_tools=%basedir%\tools\wia
set cpl_suffix=cpl
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/x86" set cpu_samples=i386
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/amd64" set cpu_samples=amd64
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/ia64" set cpu_samples=ia64
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/arm" set cpu_samples=arm
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/x86" set cpu_tools=x86
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/amd64" set cpu_tools=amd64
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/ia64" set cpu_tools=ia64
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/arm" set cpu_tools=arm
rem If cpu_samples is not the initial string, this is razzle environment and jump to :Common.
if NOT "%cpu_samples%" EQU "NotRazzle" goto Common
:VSDeveloper
rem Set x86 as default cpu type (for developer cmd prompt)
rem Platform is defined when it is a cross-platform cmd prompt (x64 or arm)
set cpu_samples=x86
set cpu_tools=x86
if defined Platform (
set cpu_samples=%Platform%
set cpu_tools=%Platform%
)
rem When selecting non-default configuration, users need to specify the first
rem parameter to rename wiabins and then input the build directory as the second
rem parameter, where the sample project generates output files.
set build_tools=%WindowsSdkDir%tools
set build_samples=WindowsDeveloperPreviewDebug
if NOT "%2" EQU "" set build_samples=%2
rem VS project outputs dll file for sampcpl. Its sources in razzle renames output to cpl file.
rem Copy sampcpl.dll by VS project to sampcpl.cpl.
set cpl_suffix=dll
:Common
md %1wiabins
md %1wiabins\drivers
if /I "%BUILD_DEFAULT_TARGETS%" EQU "/arm" (
goto wia20 )
rem
rem WIA 1.0
rem
copy microdrv\%build_samples%\%cpu_samples%\testmcro.dll %1wiabins\drivers
copy microdrv\testmcro.inf %1wiabins\drivers
copy "%build_tools%\%cpu_tools%\wiatest.exe" %1wiabins
if /I "%DDK_TARGET_OS%" EQU "WinXP" (
copy "%build_tools%\%cpu_tools%\wialogcfg.exe" %1wiabins
goto end )
if /I "%DDK_TARGET_OS%" EQU "WinNET" (
copy "%build_tools%\%cpu_tools%\wiadbgcfg.exe" %1wiabins
goto end )
:wia20
rem
rem WIA 2.0
rem
copy wiadriverex\usd\%build_samples%\%cpu_samples%\wiadriverex.dll %1wiabins\drivers
copy wiadriverex\segfilter\%build_samples%\%cpu_samples%\segfilter.dll %1wiabins\drivers
copy wiadriverex\imgfilter\%build_samples%\%cpu_samples%\imgfilter.dll %1wiabins\drivers
copy wiadriverex\errhandler\%build_samples%\%cpu_samples%\errhandler.dll %1wiabins\drivers
copy wiadriverex\uiext2\%build_samples%\%cpu_samples%\uiext2.dll %1wiabins\drivers
copy wiadriverex\wiadriver.inf %1wiabins\drivers
copy wiadriverex\sample.bmp %1wiabins\drivers
copy prodscan\%build_samples%\%cpu_samples%\prodscan.dll %1wiabins\drivers
copy prodscan\prodscan.inf %1wiabins\drivers
copy "%build_tools%\%cpu_tools%\wiainfo2.exe" %1wiabins
copy "%build_tools%\%cpu_tools%\wiatrcvw.exe" %1wiabins
copy "%build_tools%\%cpu_tools%\wiapreview.exe" %1wiabins
goto end
:Syntax
Echo %0 Drive\path\
:end