2021-01-11 23:13:22 +00:00
|
|
|
if(NOT GUI_ZIP_URL)
|
2021-06-02 19:15:17 +00:00
|
|
|
set(GUI_ZIP_URL "https://oxen.rocks/oxen-io/loki-network-control-panel/lokinet-gui-windows-32bit-v0.3.8.zip")
|
|
|
|
set(GUI_ZIP_HASH_OPTS EXPECTED_HASH SHA256=60c2b738cf997e5684f307e5222498fd09143d495a932924105a49bf59ded8bb)
|
2021-01-11 23:13:22 +00:00
|
|
|
endif()
|
|
|
|
|
2020-01-10 22:32:00 +00:00
|
|
|
set(TUNTAP_URL "https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe")
|
|
|
|
set(TUNTAP_EXE "${CMAKE_BINARY_DIR}/tuntap-install.exe")
|
2021-09-10 22:38:32 +00:00
|
|
|
set(BOOTSTRAP_FILE "${PROJECT_SOURCE_DIR}/contrib/bootstrap/mainnet.signed")
|
2020-10-22 21:16:42 +00:00
|
|
|
|
2020-01-10 22:32:00 +00:00
|
|
|
file(DOWNLOAD
|
|
|
|
${TUNTAP_URL}
|
|
|
|
${TUNTAP_EXE})
|
2020-10-22 21:16:42 +00:00
|
|
|
|
|
|
|
file(DOWNLOAD
|
|
|
|
${GUI_ZIP_URL}
|
2020-10-27 20:27:38 +00:00
|
|
|
${CMAKE_BINARY_DIR}/lokinet-gui.zip
|
2021-01-11 23:13:22 +00:00
|
|
|
${GUI_ZIP_HASH_OPTS})
|
2020-10-22 21:16:42 +00:00
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_DIR}/lokinet-gui.zip
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/gui DESTINATION share COMPONENT gui)
|
2021-05-01 14:16:57 +00:00
|
|
|
install(PROGRAMS ${TUNTAP_EXE} DESTINATION bin COMPONENT tuntap)
|
2021-09-10 22:38:32 +00:00
|
|
|
install(FILES ${BOOTSTRAP_FILE} DESTINATION share COMPONENT lokinet RENAME bootstrap.signed)
|
2020-10-22 21:16:42 +00:00
|
|
|
|
2020-10-30 00:05:41 +00:00
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Lokinet")
|
2020-10-27 20:27:38 +00:00
|
|
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/win32-setup/lokinet.ico")
|
2020-01-10 22:32:00 +00:00
|
|
|
set(CPACK_NSIS_DEFINES "RequestExecutionLevel admin")
|
2021-01-11 23:13:22 +00:00
|
|
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
2021-06-02 19:15:17 +00:00
|
|
|
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ifFileExists $INSTDIR\\\\bin\\\\tuntap-install.exe 0 +2\\nExecWait '$INSTDIR\\\\bin\\\\tuntap-install.exe /S'\\nExecWait '$INSTDIR\\\\bin\\\\lokinet.exe --install'\\nExecWait 'sc failure lokinet reset= 60 actions= restart/1000'\\nExecWait '$INSTDIR\\\\bin\\\\lokinet.exe -g C:\\\\ProgramData\\\\lokinet\\\\lokinet.ini'\\nCopyFiles '$INSTDIR\\\\share\\\\bootstrap.signed' C:\\\\ProgramData\\\\lokinet\\\\bootstrap.signed\\n")
|
2020-11-11 14:55:00 +00:00
|
|
|
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'net stop lokinet'\\nExecWait 'taskkill /f /t /im lokinet-gui.exe'\\nExecWait '$INSTDIR\\\\bin\\\\lokinet.exe --remove'\\nRMDir /r /REBOOTOK C:\\\\ProgramData\\\\lokinet")
|
2020-10-22 21:16:42 +00:00
|
|
|
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
2020-11-08 22:47:02 +00:00
|
|
|
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Lokinet.lnk' '$INSTDIR\\\\share\\\\gui\\\\lokinet-gui.exe'"
|
2020-10-22 21:16:42 +00:00
|
|
|
)
|
|
|
|
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
|
|
|
"Delete '$SMPROGRAMS\\\\$START_MENU\\\\Lokinet.lnk'"
|
|
|
|
)
|
2021-05-13 10:30:40 +00:00
|
|
|
|
|
|
|
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
|
|
|
|
list(REMOVE_ITEM CPACK_COMPONENTS_ALL "Unspecified")
|