From 03bdb179364303b174ae4ce42355c305f3943fd0 Mon Sep 17 00:00:00 2001 From: MiranDMC Date: Tue, 19 Sep 2023 20:55:18 +0200 Subject: [PATCH] Update project configuration (#102) Fixed SDK includes. Configured post build events and debug settings. Added setup_env.bat and SETUP.md --- CLEO4.sln | 12 +++++----- CLEO4.vcxproj | 62 +++++++++++++++++++++++++++++---------------------- SETUP.md | 7 ++++++ setup_env.bat | 55 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 33 deletions(-) create mode 100644 SETUP.md create mode 100644 setup_env.bat diff --git a/CLEO4.sln b/CLEO4.sln index 7b85ecbb..fc5c5f87 100644 --- a/CLEO4.sln +++ b/CLEO4.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2002 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLEO4", "CLEO4.vcxproj", "{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}" EndProject @@ -11,10 +11,10 @@ Global Release|GTASA = Release|GTASA EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.ActiveCfg = Debug GTASA|Win32 - {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.Build.0 = Debug GTASA|Win32 - {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.ActiveCfg = Release GTASA|Win32 - {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.Build.0 = Release GTASA|Win32 + {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.ActiveCfg = Debug|Win32 + {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.Build.0 = Debug|Win32 + {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.ActiveCfg = Release|Win32 + {B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CLEO4.vcxproj b/CLEO4.vcxproj index 343d34f5..22cae2d4 100644 --- a/CLEO4.vcxproj +++ b/CLEO4.vcxproj @@ -1,12 +1,12 @@  - - Release GTASA + + Release Win32 - - Debug GTASA + + Debug Win32 @@ -26,8 +26,8 @@ - Create - Create + Create + Create @@ -62,46 +62,47 @@ true Win32Proj CLEO4 - 10.0.18362.0 + 10.0 - + DynamicLibrary false MultiByte - v142 + v143 true - + DynamicLibrary true MultiByte - v142 + v143 - + - + - - $(SolutionDir)output\Release\ - $(SolutionDir)output\.obj\Release\ + + $(SolutionDir)output\$(Configuration)\ + $(SolutionDir)output\.obj\$(Configuration)\ CLEO .asi + $(PLUGIN_SDK_DIR)\shared\;$(PLUGIN_SDK_DIR)\shared\game\;$(IncludePath) - - $(SolutionDir)output\Debug\ - $(SolutionDir)output\.obj\Debug\ + + $(SolutionDir)output\$(Configuration)\ + $(SolutionDir)output\.obj\$(Configuration)\ CLEO .asi - $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);E:\Documents\Para GTA\plugin-sdk-master\shared + $(PLUGIN_SDK_DIR)\shared\;$(PLUGIN_SDK_DIR)\shared\game\;$(IncludePath) - + Level3 MaxSpeed @@ -113,11 +114,12 @@ _NDEBUG;_USING_V110_SDK71_;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;GTASA;GTAGAME_NAME="San Andreas";GTAGAME_ABBR="SA";GTAGAME_ABBRLOW="sa";GTAGAME_PROTAGONISTNAME="CJ";GTAGAME_CITYNAME="San Andreas";CLEO4_EXPORTS;%(PreprocessorDefinitions) /Zc:threadSafeInit- %(AdditionalOptions) Create + stdcpp17 true true - No + true UseLinkTimeCodeGeneration $(SolutionDir)\third-party\bass;%(AdditionalLibraryDirectories) bass.lib;%(AdditionalDependencies) @@ -126,10 +128,13 @@ false - xcopy /Y "$(SolutionDir)output\Release\CLEO.lib" "$(SolutionDir)cleo_sdk\" + xcopy /Y "$(OutDir)$(TargetName).lib" "$(SolutionDir)cleo_sdk\" +taskkill /IM gta_sa.exe /F /FI "STATUS eq RUNNING" +xcopy /Y "$(OutDir)$(TargetName).asi" "$(GTA_SA_DIR)\" +xcopy /Y "$(OutDir)$(TargetName).pdb" "$(GTA_SA_DIR)\" - + Level3 Disabled @@ -139,9 +144,10 @@ _DEBUG;_USING_V110_SDK71_;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_SCL_SECURE_NO_WARNINGS;GTASA;GTAGAME_NAME="San Andreas";GTAGAME_ABBR="SA";GTAGAME_ABBRLOW="sa";GTAGAME_PROTAGONISTNAME="CJ";GTAGAME_CITYNAME="San Andreas";CLEO4_EXPORTS;%(PreprocessorDefinitions); /Zc:threadSafeInit- %(AdditionalOptions) Create + stdcpp17 - Debug + true Default $(SolutionDir)\third-party\bass;%(AdditionalLibraryDirectories) bass.lib;%(AdditionalDependencies) @@ -150,8 +156,10 @@ false - - + xcopy /Y "$(OutDir)$(TargetName).lib" "$(SolutionDir)cleo_sdk\" +taskkill /IM gta_sa.exe /F /FI "STATUS eq RUNNING" +xcopy /Y "$(OutDir)$(TargetName).asi" "$(GTA_SA_DIR)\" +xcopy /Y "$(OutDir)$(TargetName).pdb" "$(GTA_SA_DIR)\" diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 00000000..f03cd252 --- /dev/null +++ b/SETUP.md @@ -0,0 +1,7 @@ +# CLEO project configuration + +This project depends on Plugin SDK (https://github.com/DK22Pac/plugin-sdk). Using SDK's installer results in creation of PLUGIN_SDK_DIR envinroment variable in operating system. If installer is not used then please manually enter path to the sdk directory in setup_env.bat. +If GTA SA is installed in different than default location please open setup_env.bat file and configure correct path. +Run setup_env.bat to setup required envinroment variables. + +After opening project solution in Visual Studio it should be possible to build as well as debug CLEO in game. diff --git a/setup_env.bat b/setup_env.bat new file mode 100644 index 00000000..9730238c --- /dev/null +++ b/setup_env.bat @@ -0,0 +1,55 @@ +@ECHO OFF + +@SET GAME_DIR=C:\Program Files (x86)\Rockstar Games\GTA San Andreas +@SET PLUGIN_DIR=C:\plugin-sdk-master + + + + + + + + + + + +@IF DEFINED GTA_SA_DIR ( + ECHO GTA_SA_DIR already set to: + ECHO "%GTA_SA_DIR%" + ECHO: + ECHO New value: + ECHO "%GAME_DIR%" + ECHO: + CHOICE /C YN /M "Do you want to update?" + If ERRORLEVEL 2 GOTO SET_GAME_END +) + +@SETX GTA_SA_DIR "%GAME_DIR%" +ECHO GTA_SA_DIR configured as: +ECHO "%GAME_DIR%" +:SET_GAME_END + +ECHO: +ECHO: + +@IF DEFINED PLUGIN_SDK_DIR ( + ECHO PLUGIN_SDK_DIR already set to: + ECHO "%PLUGIN_SDK_DIR%" + ECHO . + ECHO New value: + ECHO "%PLUGIN_DIR%" + ECHO . + CHOICE /C YN /M "Do you want to update?" + If ERRORLEVEL 2 GOTO SET_PLUGIN_END +) + +@SETX PLUGIN_SDK_DIR "%PLUGIN_DIR%" +ECHO PLUGIN_SDK_DIR configured as: +ECHO "%PLUGIN_DIR%" +:SET_PLUGIN_END + +ECHO: +ECHO: + +pause +exit