Make nano_wallet for Windows console (#1653)
* Make nano_wallet for Windows console * Formatting * Link to latest supported VC++ Redistributable 2017 https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads * Add .com file to AppVeyor zip archive * Proper 7z command
This commit is contained in:
parent
00dd12a9f9
commit
7cb42965e8
3 changed files with 57 additions and 2 deletions
|
@ -350,6 +350,12 @@ if (NANO_GUI OR RAIBLOCKS_GUI)
|
|||
|
||||
if (WIN32)
|
||||
target_link_libraries (nano_wallet Qt5::WinExtras)
|
||||
# nano_wallet.com executable for Windows console
|
||||
add_executable(nano_wallet_com
|
||||
nano/nano_wallet/entry_com.cpp)
|
||||
target_link_libraries (nano_wallet_com
|
||||
node)
|
||||
set_target_properties (nano_wallet_com PROPERTIES COMPILE_FLAGS "-DBOOST_ASIO_HAS_STD_ARRAY=1" OUTPUT_NAME "nano_wallet" SUFFIX ".com")
|
||||
endif()
|
||||
|
||||
add_executable (qt_system
|
||||
|
@ -399,6 +405,7 @@ if (NANO_GUI OR RAIBLOCKS_GUI)
|
|||
get_target_property (Qt5WindowsPlugin Qt5::QWindowsIntegrationPlugin LOCATION)
|
||||
get_filename_component (Qt5_bin_DIR ${Qt5_DIR}/../../../bin ABSOLUTE)
|
||||
install (TARGETS nano_wallet DESTINATION .)
|
||||
install (TARGETS nano_wallet_com DESTINATION .)
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${WIN_REDIST} DESTINATION .)
|
||||
install (FILES ${Qt5_bin_DIR}/libGLESv2.dll DESTINATION .)
|
||||
install (FILES ${Qt5_bin_DIR}/Qt5Core.dll DESTINATION .)
|
||||
|
|
|
@ -19,7 +19,7 @@ install:
|
|||
|
||||
|
||||
|
||||
- ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/5/7/b/57b2947c-7221-4f33-b35e-2fc78cb10df4/vc_redist.x64.exe -OutFile .\vc_redist.x64.exe
|
||||
- ps: Invoke-WebRequest -Uri https://aka.ms/vs/15/release/vc_redist.x64.exe -OutFile .\vc_redist.x64.exe
|
||||
build:
|
||||
project: INSTALL.vcxproj
|
||||
parallel: true
|
||||
|
@ -28,7 +28,7 @@ after_build:
|
|||
- cmd: >-
|
||||
cpack -NSIS --verbose
|
||||
|
||||
7z a nano.zip %APPVEYOR_BUILD_FOLDER%\Release\*.exe
|
||||
7z a nano.zip %APPVEYOR_BUILD_FOLDER%\Release\*.exe %APPVEYOR_BUILD_FOLDER%\Release\*.com
|
||||
artifacts:
|
||||
- path: nano.zip
|
||||
name: nano_release_%network%
|
||||
|
|
48
nano/nano_wallet/entry_com.cpp
Normal file
48
nano/nano_wallet/entry_com.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include <nano/lib/errors.hpp>
|
||||
#include <nano/lib/utility.hpp>
|
||||
#include <nano/node/cli.hpp>
|
||||
#include <nano/node/rpc.hpp>
|
||||
#include <nano/node/working.hpp>
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
int main (int argc, char * const * argv)
|
||||
{
|
||||
nano::set_umask ();
|
||||
try
|
||||
{
|
||||
boost::program_options::options_description description ("Command line options");
|
||||
description.add_options () ("help", "Print out options");
|
||||
nano::add_node_options (description);
|
||||
boost::program_options::variables_map vm;
|
||||
boost::program_options::store (boost::program_options::command_line_parser (argc, argv).options (description).allow_unregistered ().run (), vm);
|
||||
boost::program_options::notify (vm);
|
||||
int result (0);
|
||||
|
||||
if (!vm.count ("data_path"))
|
||||
{
|
||||
std::string error_string;
|
||||
if (!nano::migrate_working_path (error_string))
|
||||
{
|
||||
throw std::runtime_error (error_string);
|
||||
}
|
||||
}
|
||||
|
||||
auto ec = nano::handle_node_options (vm);
|
||||
if (ec == nano::error_cli::unknown_command && vm.count ("help") != 0)
|
||||
{
|
||||
std::cout << description << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (std::exception const & e)
|
||||
{
|
||||
std::cerr << boost::str (boost::format ("Exception while initializing %1%") % e.what ());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << boost::str (boost::format ("Unknown exception while initializing"));
|
||||
}
|
||||
return 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue