How to build a product with InstallShield

来源:互联网 发布:c语言求素数的算法 编辑:程序博客网 时间:2024/06/05 02:21
How to build a product with InstallShield:

put all build script in same folder. Example: "buildscript". 

1   use a script runmeToBuild.bat as top script:     

@echo offREM set RUNDIR=D:\AutoBuild\buildscriptset RUNDIR=%cd%call %RUNDIR%\compile_product.batcall %RUNDIR%\copyfiles.batcall %RUNDIR%\callbuild.batpause 

2   other scripts:     

compile_product.bat

@echo offecho "***  date 2012-7-19     ***"echo "***  author Zhen Zhang  ***"echo "***  version 2012.1.0   ***"REM make sure cmake.exe is available. By default you can find it under "C:\Program Files\CMake 2.8\bin\cmake.exe"REM make sure msbuild.exe is available. By default you can find it under "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" REM get current director pathset CUR_DIR=%cd%del %CUR_DIR%\build_install.log /Qecho "   ***  compile for product   ***  " echo "   ***  build for product   ***  "                                                                   >> %CUR_DIR%\build_install.log    echo "run CMake for product"    echo "run CMake for product"                                                                           >> %CUR_DIR%\build_install.log        pushd %CUR_DIR%\build\product                                                                      >> %CUR_DIR%\build_install.log        svn update                                                                                        >> %CUR_DIR%\build_install.log        rd  %CUR_DIR%\binaries\product    /S /Q        mkdir %CUR_DIR%\binaries\product        pushd %CUR_DIR%\binaries\product               cmake.exe   -G    "Visual Studio 10"   %CUR_DIR%\build\product                                     >> %CUR_DIR%\build_install.log                echo "run msbuild for product"        echo "run msbuild for product"                                                                      >> %CUR_DIR%\build_install.log        msbuild.exe  %CUR_DIR%\binaries\product\INSTALL.vcxproj /p:configuration=release /p:Platform=Win32  >> %CUR_DIR%\build_install.logecho "   ***  finish compile for product   ***  "echo "   ***  finish compile for product   ***  "                                                             >> %CUR_DIR%\build_install.logREM if you have many products, compile them one by onepushd %CUR_DIR%  


copyfiles.bat           

@echo offset CURRENTDIR=%cd%set DES_PATH=D:\AutoBuild\Sourcedel %CURRENTDIR%\copyfiles.log /Qecho "   ***  start copy PRODUCT files   ***  " echo "   ***  start copy PRODUCT files   ***  "                                                                   >> %CUR_DIR%\copyfiles.log    rd %DES_PATH%\PRO_NAME_V2012    /S /Qmd %DES_PATH%\PRO_NAME_V2012xcopy  %CURRENTDIR%\binaries\product   %DES_PATH%\PRO_NAME_V2012\      /E                   <span style="white-space:pre"></span>>> %CUR_DIR%\copyfiles.logecho "   ***  finish copy PRODUCT files   ***  "echo "   ***  finish copy PRODUCT files   ***  "                                                                 >> %CUR_DIR%\copyfiles.logREM if you have many products, copy source files/folders one by one 


callbuild.bat 

@echo offset BUILD_PATH=D:\AutoBuildset AutoBuildPath=%BUILD_PATH%del  %BUILD_PATH%\build.log         call %RUNDIR%\callInstallShield.bat                     call %RUNDIR%\copyProductToShare.bat     


callInstallShield.bat

@echo onecho begin to build Product...  >> %AutoBuildPath%\build.logISCmdBld.exe -p %AutoBuildPath%\projectForIS\Prod\Prod.ism -r "PRODNAME" -c COMP  -e Y  >>%AutoBuildPath%\build.logecho finish build Product.         >> %AutoBuildPath%\build.log


copyProductToShare.bat

@echo on echo begin to copy PROD.exe to \\share_machine\share_path\ ...        >> %AutoBuildPath%\build.logcopy %AutoBuildPath%\releaseVersion\PROD.exe "\\share_machine\share_path\PROD.exe" /Y     >> %AutoBuildPath%\build.logecho finish copy PROD.exe to \\share_machine\share_path\.      >> %AutoBuildPath%\build.log


0 0
原创粉丝点击