@@ -8,6 +8,10 @@ set VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\VC
88echo VCINSTALLDIR: %VCINSTALLDIR%
99call " %VCINSTALLDIR% \Auxiliary\Build\vcvars64.bat"
1010
11+ @ REM projects
12+ set COO_PROJECT = dde-cooperation
13+ set DT_PROJECT = data-transfer
14+
1115REM defaults - override them by creating a build_env.bat file
1216set B_BUILD_TYPE = Release
1317set B_QT_ROOT = C:\Qt
@@ -41,8 +45,6 @@ set B_QT_FULLPATH=%B_QT_ROOT%\%B_QT_VER%\%B_QT_MSVC%
4145
4246echo Qt: %B_QT_FULLPATH%
4347
44- git submodule update --init --recursive
45-
4648rmdir /q /s build
4749mkdir build
4850if ERRORLEVEL 1 goto failed
@@ -55,28 +57,53 @@ cmake -G "%cmake_gen%" -A x64 -D CMAKE_BUILD_TYPE=%B_BUILD_TYPE% -D CMAKE_PREFIX
5557if ERRORLEVEL 1 goto failed
5658cmake --build . --config %B_BUILD_TYPE%
5759if ERRORLEVEL 1 goto failed
58- if exist output\Debug (
59- copy output\Debug\QtZeroConf.dll output\dde-cooperation\Debug\ > NUL
60- copy " %OPENSSL_ROOT_DIR% \libcrypto-1_1-x64.dll" output\dde-cooperation\Debug\ > NUL
61- copy " %OPENSSL_ROOT_DIR% \libssl-1_1-x64.dll" output\dde-cooperation\Debug\ > NUL
62- ) else if exist output\Release (
63- copy output\Release\QtZeroConf.dll output\dde-cooperation\Release\ > NUL
64- copy " %OPENSSL_ROOT_DIR% \libcrypto-1_1-x64.dll" output\dde-cooperation\Release\ > NUL
65- copy " %OPENSSL_ROOT_DIR% \libssl-1_1-x64.dll" output\dde-cooperation\Release\ > NUL
66- copy " %B_BONJOUR% \Bonjour64.msi" installer-inno\ > NUL
67- move output\dde-cooperation\Release\vc_redist.x64.exe installer-inno\ > NUL
60+ if exist output\%B_BUILD_TYPE% (
61+ copy output\%B_BUILD_TYPE% \QtZeroConf.* output\%COO_PROJECT% \%B_BUILD_TYPE% \ > NUL
62+ copy " %OPENSSL_ROOT_DIR% \libcrypto-1_1-x64.dll" output\%COO_PROJECT% \%B_BUILD_TYPE% \ > NUL
63+ copy " %OPENSSL_ROOT_DIR% \libssl-1_1-x64.dll" output\%COO_PROJECT% \%B_BUILD_TYPE% \ > NUL
64+
65+ mkdir installer-inno\%COO_PROJECT%
66+ copy " %B_BONJOUR% \Bonjour64.msi" installer-inno\%COO_PROJECT% \ > NUL
67+ if exist output\%COO_PROJECT% \%B_BUILD_TYPE% \vc_redist.x64.exe (
68+ move output\%COO_PROJECT% \%B_BUILD_TYPE% \vc_redist.x64.exe installer-inno\%COO_PROJECT% \ > NUL
69+ )
70+
71+
72+ copy output\%B_BUILD_TYPE% \quazip* output\%DT_PROJECT% \%B_BUILD_TYPE% \ > NUL
73+ copy " %OPENSSL_ROOT_DIR% \libcrypto-1_1-x64.dll" output\%DT_PROJECT% \%B_BUILD_TYPE% \ > NUL
74+ copy " %OPENSSL_ROOT_DIR% \libssl-1_1-x64.dll" output\%DT_PROJECT% \%B_BUILD_TYPE% \ > NUL
75+ mkdir installer-inno\%DT_PROJECT%
76+ if exist output\%DT_PROJECT% \%B_BUILD_TYPE% \vc_redist.x64.exe (
77+ move output\%DT_PROJECT% \%B_BUILD_TYPE% \vc_redist.x64.exe installer-inno\%DT_PROJECT% \ > NUL
78+ )
6879) else (
6980 echo Remember to copy supporting binaries and configuration files!
7081)
7182
7283echo Build completed successfully
7384
85+ set INNO_ROOT = C:\Program Files (x86)\Inno Setup 6
86+
87+ echo Building 64-bit Windows installer...
88+
89+ " %INNO_ROOT% \ISCC.exe" /Qp %COO_PROJECT% -setup.iss
90+ move %cd% \installer-inno\deepin-cooperation-* %cd% \installer-inno\%COO_PROJECT% \ > NUL
91+ if ERRORLEVEL 1 goto issfailed
92+ " %INNO_ROOT% \ISCC.exe" /Qp deepin-%DT_PROJECT% -setup.iss
93+ move %cd% \installer-inno\deepin-datatransfer-* %cd% \installer-inno\%DT_PROJECT% \ > NUL
94+ if ERRORLEVEL 1 goto issfailed
95+
96+ echo Build all Windows installer successfully!!!
97+
7498@ REM echo ------------cmake again forgenerate sources------------
7599@ REM cmake -G "%cmake_gen%" -A x64 -D CMAKE_BUILD_TYPE=%B_BUILD_TYPE% -D CMAKE_PREFIX_PATH="%B_QT_FULLPATH%" -D QT_VERSION=%B_QT_VER% ..
76100
77101set BUILD_FAILED = 0
78102goto done
79103
104+ :issfailed
105+ echo Make Windows installer failed
106+
80107:failed
81108set BUILD_FAILED = %ERRORLEVEL%
82109echo Build failed
@@ -93,4 +120,6 @@ set B_QT_FULLPATH=
93120set savedir =
94121set cmake_gen =
95122
123+ set INNO_ROOT =
124+
96125EXIT /B %BUILD_FAILED%
0 commit comments