upgrade build pipeline for x64 deployment

This commit is contained in:
Akash Mozumdar 2019-05-24 13:30:12 -04:00
parent aa3b9ee14f
commit c7edfef9ad
5 changed files with 74 additions and 44 deletions

View File

@ -20,9 +20,9 @@ else()
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86) set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
set(LIBDIR x86libs) set(LIBDIR x86libs)
endif() endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_CONFIGURATION_TYPES Debug Release) set(CMAKE_CONFIGURATION_TYPES Debug Release)
@ -33,6 +33,7 @@ include_directories(include)
link_directories(${LIBDIR}) link_directories(${LIBDIR})
add_library(text text.cpp) add_library(text text.cpp)
target_compile_definitions(text PRIVATE ${TEXT_LANGUAGE})
link_libraries(text) link_libraries(text)
add_subdirectory(GUI) add_subdirectory(GUI)

View File

@ -8,7 +8,7 @@
"inheritEnvironments": [ "msvc_x86" ] "inheritEnvironments": [ "msvc_x86" ]
}, },
{ {
"name": "x86-Release", "name": "x86-RelWithDebInfo",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "RelWithDebInfo", "configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x86" ] "inheritEnvironments": [ "msvc_x86" ]
@ -20,7 +20,7 @@
"inheritEnvironments": [ "msvc_x64" ] "inheritEnvironments": [ "msvc_x64" ]
}, },
{ {
"name": "x64-Release", "name": "x64-RelWithDebInfo",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "RelWithDebInfo", "configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64" ] "inheritEnvironments": [ "msvc_x64" ]

View File

@ -13,8 +13,10 @@ add_executable(${PROJECT_NAME} WIN32
Textractor.rc Textractor.rc
Textractor.ico Textractor.ico
) )
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RelWithDebInfo>:/GL>) target_link_libraries(${PROJECT_NAME} Qt5::Widgets shell32 winhttp)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets shell32 winhttp $<$<CONFIG:RelWithDebInfo>:-LTCG>)
if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Core.dll)
install_qt5_libs(${PROJECT_NAME}) # can be commented out for consecutive builds if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Cored.dll)
install_qt5_libs(${PROJECT_NAME})
endif()
endif()

View File

@ -1,8 +1,24 @@
param([string]$arch = "86", [string]$folder = "Textractor$($arch)") param([string]$version)
Set-Location $PSScriptRoot; cd $PSScriptRoot;
mkdir -Force -Verbose Builds;
cd Builds;
mkdir -Force -Verbose x86;
mkdir -Force -Verbose x64;
$targets = @( foreach ($language in @{
ENGLISH="";
SPANISH="Español";
SIMPLIFIED_CHINESE="简体中文";
RUSSIAN="Русский";
TURKISH="Türkçe";
}.GetEnumerator())
{
$folder = "Textractor-$($language.Value)-$($version)";
mkdir -Force -Verbose $folder;
rm -Force -Recurse -Verbose "$($folder)/*";
$files = @(
"Textractor.exe", "Textractor.exe",
"TextractorCLI.exe", "TextractorCLI.exe",
"texthook.dll", "texthook.dll",
@ -23,7 +39,22 @@ $targets = @(
"Thread Linker.dll", "Thread Linker.dll",
"platforms", "platforms",
"styles" "styles"
) | ForEach-Object { "builds/RelWithDebInfo_x$($arch)/$($_)" }; );
mkdir -Force -Verbose $folder; cd "x86";
Remove-Item -Force -Recurse -Verbose "$($folder)/*"; cmake -G "Visual Studio 15 2017" -DTEXT_LANGUAGE="$($language.Key)" -DCMAKE_BUILD_TYPE="Release" ../..;
Copy-Item -Force -Recurse -Verbose -Destination $folder -Path $targets; &"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv" Textractor.sln /build "Release|Win32";
cd ..;
foreach ($file in $files)
{
copy -Force -Recurse -Verbose -Destination $folder -Path "Release_x86/$($file)";
}
cd "x64";
cmake -G "Visual Studio 15 2017 Win64" -DTEXT_LANGUAGE="$($language.Key)" -DCMAKE_BUILD_TYPE="Release" ../..;
&"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv" Textractor.sln /build "Release|x64";
cd ..;
mkdir -Force -Verbose "$($folder)/x64";
foreach ($file in $files)
{
copy -Force -Recurse -Verbose -Destination "$($folder)/x64" -Path "Release_x64/$($file)";
}
}

View File

@ -1,10 +1,5 @@
#include "defs.h" #include "defs.h"
//#define TURKISH
//#define SPANISH
//#define SIMPLIFIED_CHINESE
//#define RUSSIAN
const char* ATTACH = u8"Attach to game"; const char* ATTACH = u8"Attach to game";
const char* LAUNCH = u8"Launch game"; const char* LAUNCH = u8"Launch game";
const char* DETACH = u8"Detach from game"; const char* DETACH = u8"Detach from game";
@ -12,7 +7,7 @@ const char* ADD_HOOK = u8"Add hook";
const char* SAVE_HOOKS = u8"Save hook(s)"; const char* SAVE_HOOKS = u8"Save hook(s)";
const char* SETTINGS = u8"Settings"; const char* SETTINGS = u8"Settings";
const char* EXTENSIONS = u8"Extensions"; const char* EXTENSIONS = u8"Extensions";
const char* SELECT_PROCESS = u8"Select Process"; const char* SELECT_PROCESS = u8"Select process";
const char* ATTACH_INFO = u8R"(If you don't see the process you want to attach, try running with admin rights const char* ATTACH_INFO = u8R"(If you don't see the process you want to attach, try running with admin rights
You can also type in the process id)"; You can also type in the process id)";
const char* SEARCH_GAME = u8"Select from computer"; const char* SEARCH_GAME = u8"Select from computer";
@ -33,6 +28,7 @@ S/Q/V: codepage/UTF-16/UTF-8 string
null_length: length of null terminator used for string null_length: length of null terminator used for string
Negatives for data/split offset refer to registers Negatives for data/split offset refer to registers
-4 for EAX, -8 for ECX, -C for EDX, -10 for EBX, -14 for ESP, -18 for EBP, -1C for ESI, -20 for EDI -4 for EAX, -8 for ECX, -C for EDX, -10 for EBX, -14 for ESP, -18 for EBP, -1C for ESI, -20 for EDI
-4 for RAX, -C for RBX, -14 for RCX, -1C for RDX, and so on for RSP, RBP, RSI, RDI, R8-R15
* means dereference pointer+deref_offset)"; * means dereference pointer+deref_offset)";
const char* SAVE_SETTINGS = u8"Save settings"; const char* SAVE_SETTINGS = u8"Save settings";
const char* EXTEN_WINDOW_INSTRUCTIONS = u8R"(Drag and drop extension (.dll) files here from your computer to add them const char* EXTEN_WINDOW_INSTRUCTIONS = u8R"(Drag and drop extension (.dll) files here from your computer to add them
@ -57,8 +53,8 @@ If you like this project, please tell everyone about it :))";
const wchar_t* CL_OPTIONS = LR"(usage: Textractor [-p{process id|"process name"}]...)"; const wchar_t* CL_OPTIONS = LR"(usage: Textractor [-p{process id|"process name"}]...)";
const wchar_t* UPDATE_AVAILABLE = L"Update available: download it from https://github.com/Artikash/Textractor/releases"; const wchar_t* UPDATE_AVAILABLE = L"Update available: download it from https://github.com/Artikash/Textractor/releases";
const wchar_t* ALREADY_INJECTED = L"Textractor: already injected"; const wchar_t* ALREADY_INJECTED = L"Textractor: already injected";
const wchar_t* NEED_32_BIT = L"Textractor: architecture mismatch: try 32 bit Textractor instead"; const wchar_t* NEED_32_BIT = L"Textractor: architecture mismatch: try x86 Textractor instead";
const wchar_t* NEED_64_BIT = L"Textractor: architecture mismatch: try 64 bit Textractor instead (contact Artikash for the download location)"; const wchar_t* NEED_64_BIT = L"Textractor: architecture mismatch: try x64 Textractor instead";
const wchar_t* INJECT_FAILED = L"Textractor: couldn't inject"; const wchar_t* INJECT_FAILED = L"Textractor: couldn't inject";
const wchar_t* LAUNCH_FAILED = L"Textractor: couldn't launch"; const wchar_t* LAUNCH_FAILED = L"Textractor: couldn't launch";
const wchar_t* INVALID_CODE = L"Textractor: invalid code"; const wchar_t* INVALID_CODE = L"Textractor: invalid code";