Windows Program Packaging script [bat]

Source: Internet
Author: User

The process of packaging scripts is basically the same as automatic packaging:

1. Compiling the Software

2. Copy the required content

3. Code Signing

4. Package as installation files

5. Re-sign and change the installation file name to the desired format

------------------------------------------------------------------

Compiling the software requires an initialization of the VS operating environment, such as

" D:\Program Files (x86) \microsoft Visual Studio 12.0\vc\bin\vcvars32.bat "

and then compile.

Compile, copy files, and use SignTool to sign the software.

SignTool sign/f Codesign.cer. \bin\app\joywok.exe

Finally, modify it to the desired naming style, where Git rev-list HEAD--count is used to get the Git commit count as build version

rem Modify software name for/F"delims="%%iinch('git rev-list HEAD--count') Do(Set"buildversion=%%i")Echo%buildversion%CD Setupset year=%Date:~0,4%Set Month=%Date:~5,2%Set Day=%Date:~8,2%Set YMD=%year%%month%%day%-b%buildversion%ren setup.exe joywok-aws-setup-%ymd%.exe

---------------------------------------------------------------------------

A complete example:

@echo Offcall"D:\Program Files (x86) \microsoft Visual Studio 12.0\vc\bin\vcvars32.bat"rmdir/s/Q.. \src\buildlibmkdir .. \src\buildlibcd. \src\buildlibqmake. \jwlib_qt\jwlib_qt.pro-spec win32-msvc2013"Config-=debug" "config+=release Force_debug_info" "Defines+=jw_aws"D:\Qt\qtcreator-4.2.1\bin\jom Qmake_allnmake-F makefile.releasermdir/s/Q.. \buildjoymkdir .. \BUILDJOYCD. \buildjoyqmake. \joywok_qt\joywok_qt.pro-spec win32-msvc2013"Config-=debug" "config+=release Force_debug_info" "Defines+=jw_aws"D:\Qt\qtcreator-4.2.1\bin\jom Qmake_allnmake-f makefile.releaserem Copy the file and pack the CD. \.. \setupdel. \bin\app\ywdatabase.dbrmdir/s/Q.. \bin\app\cachermdir/s/Q.. \bin\app\logrmdir/s/Q.. \bin\app\skinrmdir/s/Q.. \BIN\APP\QMLmkdir .. \bin\app\skinmkdir .. \bin\app\qmlxcopy. \bin\qdebug\skin\* .. \bin\app\skin/excopy. \bin\qdebug\qml\* .. \BIN\APP\QML/ecopy. \lib\release\jwlib_qt.dll. \bin\appcopy. \bin\release\joywok.exe. \bin\apprmdir/s/Q.. \bin\app\crashesset Year=%Date:~0,4%Set Month=%Date:~5,2%Set Day=%Date:~8,2%Set Hour=% Time:~0,2%Set Minute=% Time:~3,2%Set Second=% Time:~6,2%Set YMD=%year%%month%%day%_%hour%%minute%%second%CD.. \CRASHLOGMD"%ymd%"Copy/y. \lib\release\jwlib_qt.pdb"%ymd%"Copy/y. \bin\release\joywok.pdb"%ymd%"Copy/y. \lib\release\jwlib_qt.dll"%ymd%"Copy/y. \bin\release\joywok.exe"%ymd%"CD.. \setuprem Signature SignTool Sign/F Codesign.cer. \bin\app\jwlib_qt.dllsigntool Sign/F Codesign.cer. \bin\app\joywok.exerem package del App.7zdel setup.exe. \software\7-zip\7z.exe a-t7z app.7z. \bin\app\*.. \software\nsis\makensis.exe Setup.nsisigntool Sign/F codesign.cer setup.exerem Modify the software name CD. for/F"delims="%%iinch('git rev-list HEAD--count') Do(Set"buildversion=%%i")Echo%buildversion%CD Setupset year=%Date:~0,4%Set Month=%Date:~5,2%Set Day=%Date:~8,2%Set YMD=%year%%month%%day%-b%buildversion%ren setup.exe joywok-aws-setup-%ymd%. Exepause

Windows Program Packaging script [bat]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.