Skip to content

Commit d9246bd

Browse files
#25 -- Merge branch 'win_installer' into master
2 parents c8d3c18 + a0a3ccf commit d9246bd

38 files changed

+2237
-1
lines changed

keychain_cmd_app/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ else()
102102
PUBLIC "${CMAKE_SOURCE_DIR}/keychain_win/keychain_agent/include"
103103
)
104104
target_link_libraries(keychain keychain_common secmodlib keychain_agent fc_light eth-crypto ${LIB_OPENSSL} ${Boost_LIBRARIES} Crypt32.lib Userenv.lib Wtsapi32.lib)
105+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
106+
set(BUILD_TYPE_PATH Debug )
107+
else(CMAKE_BUILD_TYPE STREQUAL "Debug")
108+
set(BUILD_TYPE_PATH Release )
109+
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
110+
add_custom_command(TARGET keychain
111+
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
112+
${CMAKE_CURRENT_BINARY_DIR}/${BUILD_TYPE_PATH}/keychain.exe
113+
../keychain_win/keychain_service/service_installer/wsserverinstaller/wsservice/keychain.exe)
105114
else()
106115
target_link_libraries(keychain keychain_common fc_light eth-crypto ${LIB_OPENSSL} ${Boost_LIBRARIES})
107116
if(APPLE)

keychain_lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include( GetGitRevisionDescription )
77
get_git_head_revision( GIT_REFSPEC KEYCHAIN_COMMON_GIT_REVISION )
88
get_git_unix_timestamp(KEYCHAIN_COMMON_GIT_REVISION_UNIX_TIMESTAMP)
99
git_describe(KEYCHAIN_COMMON_GIT_REVISION_DESCRIPTION --tags)
10+
1011
configure_file("${CMAKE_SOURCE_DIR}/keychain_lib/src/git_revision.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp" @ONLY)
1112

1213
set(CMAKE_CXX_FLAGS "-std=c++14")

keychain_win/keychain_gui/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ add_executable(keychain_win_gui ${KEYCHAIN_GUI_SOURCES} ${KEYCHAIN_GUI_INCLUDES}
6565

6666
target_link_libraries(keychain_win_gui Crypt32.lib Qt5::Widgets Qt5::Core Qt5::Qml Qt5::Svg keychain_common secmodlib kaitai_struct_cpp_stl_runtime fc_light ${Boost_LIBRARIES} ${LIB_OPENSSL})
6767

68+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
69+
set(BUILD_TYPE_PATH Debug )
70+
set(CMAKE_CXX_FLAGS "/EHsc")
71+
else(CMAKE_BUILD_TYPE STREQUAL "Debug")
72+
set(BUILD_TYPE_PATH Release )
73+
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
74+
75+
add_custom_command(TARGET keychain_win_gui
76+
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
77+
${CMAKE_CURRENT_BINARY_DIR}/${BUILD_TYPE_PATH}/keychain_win_gui.exe
78+
../keychain_service/service_installer/wsserverinstaller/wsservice/keychain_win_gui.exe)
79+

keychain_win/keychain_service/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
project( KeychainWinService )
22

3+
4+
add_subdirectory(./service_installer)
5+
add_subdirectory(./service_installer/wsserverinstaller)
6+
37
cmake_minimum_required( VERSION 3.0.2 )
48

59
set(CMAKE_CXX_FLAGS "-std=c++11 /EHsc")
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
project( service_installer )
2+
3+
if(WIN32)
4+
5+
add_custom_target(deploy)
6+
find_path(WIX_PATH candle.exe)
7+
8+
if(NOT WIX_PATH)
9+
message(FATAL_ERROR "Unable to find WiX in the PATH. The WiX installer will be disabled.")
10+
else(WIX_PATH)
11+
12+
set(wixsrcpath "${CMAKE_CURRENT_SOURCE_DIR}")
13+
set(wixoutputpath "installer")
14+
message(STATUS "wixsrcpath: ${wixsrcpath}")
15+
16+
#find libcrypto.dll file inside openssl installed folder
17+
if("$ENV{OPENSSL_ROOT_DIR}" OR "${OPENSSL_ROOT_DIR}" STREQUAL "")
18+
message(FATAL_ERROR "CANNOT FIND OPENSSL LIBRARY")
19+
else()
20+
set(openssl_path "${OPENSSL_ROOT_DIR}")
21+
message(STATUS "OPENSSL PATH: ${openssl_path}")
22+
file(GLOB_RECURSE globalcrypto FOLLOW_SYMLINKS ${OPENSSL_ROOT_DIR}/bin/libcrypto*.dll)
23+
list(GET globalcrypto 0 cryptolib)
24+
message(STATUS "FOUND LIBCRYPTO: ${cryptolib}")
25+
endif()
26+
27+
#set copy files to alias
28+
set( PREBUILD_FILES
29+
"${wixsrcpath}/wix_app_entry.wxs"
30+
"${wixsrcpath}/service_manager.bat"
31+
"${wixsrcpath}/delete_service.bat"
32+
"${wixsrcpath}/license.rtf"
33+
"${wixsrcpath}/keychain_banner.jpg"
34+
"${wixsrcpath}/keychain_logo_maximal.ico"
35+
"${wixsrcpath}/keychain_logo_minimal.ico"
36+
"${wixsrcpath}/keychain_dialog_banner.jpg"
37+
${cryptolib}
38+
)
39+
40+
message(STATUS "PREBUILD FILES: ${PREBUILD_FILES}")
41+
42+
#copy files in build folder
43+
foreach( file_to_copy ${PREBUILD_FILES})
44+
add_custom_command(TARGET deploy PRE_BUILD COMMAND ${CMAKE_COMMAND}
45+
ARGS -E copy_if_different ${file_to_copy} "${wixoutputpath}")
46+
endforeach( file_to_copy )
47+
48+
#TODO
49+
#if keychain_common target will correctly build with clang-cl compiler
50+
#after that all chain of target builds will work properly
51+
#and next commands can be placed here target binary copy files
52+
#add_dependencies(deploy keychain_service_win keychain_pass_entry_app)
53+
#add_custom_command(TARGET keychain_pass_entry_app POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/debug/keychain_pass_entry_app.exe ../service_installer/installer/keychain_pass_entry_app.exe)
54+
#add_custom_command(TARGET keychain_service_win POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/debug/keychain_service_win.exe ${CMAKE_CURRENT_BINARY_DIR}/service_installer/installer/keychain_service_win.exe)
55+
56+
set(installerpath "${CMAKE_CURRENT_BINARY_DIR}/installer")
57+
58+
message(STATUS "Deploy Path: ${CMAKE_CURRENT_BINARY_DIR}")
59+
message(STATUS "Deploy installer Path: ")
60+
message(STATUS "WIX Path: ${WIX_PATH}")
61+
62+
#-bf - flag causes all of the files to be bound int the resulting .wixout/.* file.
63+
#-out - flag tells the linker where to output the .wixout/.* file
64+
#-xo - this flag tells the linker to output an XML representation of the MSI, instead of the actual MSI, required to use the -bf switch
65+
66+
add_custom_command(TARGET deploy
67+
POST_BUILD
68+
COMMAND ${WIX_PATH}/candle.exe ${installerpath}/wix_app_entry.wxs -bf -xo -out ${installerpath}/wix_app_entry.wixobj
69+
COMMAND ${WIX_PATH}/light.exe -ext WixUIExtension ${installerpath}/wix_app_entry.wixobj -out ${installerpath}/${PROJECT_NAME}.msi
70+
VERBATIM)
71+
72+
endif()
73+
endif()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sc stop keychainservice
2+
sc delete keychainservice
6.41 KB
Loading
14 KB
Loading
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)