Skip to content

Commit

Permalink
using fold instead of exe file
Browse files Browse the repository at this point in the history
  • Loading branch information
M3351AN committed Oct 2, 2024
1 parent 87bee1b commit ad1a34e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions SPT Fuyu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>

#pragma comment(lib, "shlwapi.lib")

Expand All @@ -21,6 +22,7 @@ void CreateRegistryKeyAndFiles(const std::string& installLocation) {

// 创建目录和文件
CreateDirectoryA(installLocation.c_str(), NULL);
CreateDirectoryA((installLocation+ "\\BattlEye").c_str(), NULL);
std::ofstream(installLocation + "\\BattlEye\\BEClient_x64.dll").close();
//std::ofstream(installLocation + "\\BattlEye\\BEService_x64.dll").close();
std::ofstream(installLocation + "\\ConsistencyInfo").close();
Expand All @@ -31,21 +33,20 @@ void CreateRegistryKeyAndFiles(const std::string& installLocation) {

int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "请拖入EscapeFromTarkov.exe文件。" << std::endl;
std::cerr << "请拖入验证文件存放文件夹" << std::endl;
system("pause");
return 1;
}

std::string filePath = argv[1];
std::string fileName = PathFindFileNameA(filePath.c_str());

if (fileName != "EscapeFromTarkov.exe") {
std::cerr << "错误:拖入的文件不是EscapeFromTarkov.exe" << std::endl;
if (!std::filesystem::is_directory(filePath)) {
std::cerr << "错误:拖入的不是文件夹" << std::endl;
system("pause");
return 1;
}

std::string installLocation = filePath.substr(0, filePath.find_last_of("\\/"));
std::string installLocation = filePath;
CreateRegistryKeyAndFiles(installLocation);

std::cout << "验证执行成功." << std::endl;
Expand Down
1 change: 1 addition & 0 deletions SPT Fuyu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down

0 comments on commit ad1a34e

Please sign in to comment.