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]