From 6efef81635bf85fe1ec4e1af9b88b8bb67f4d876 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 19 Dec 2024 17:46:16 +0000 Subject: [PATCH] Delete redist installer once it's installed Also make the redist installation code filename-agnostic so it's easier to test with a dummy redist or eventually support Windows on Arm64 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2de61ae75..bb401d38e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1029,7 +1029,11 @@ elseif(NOT APPLE) SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe" CACHE FILEPATH "Path to vcredist_x64.exe") if(EXISTS ${VCREDIST64}) INSTALL(FILES ${VCREDIST64} DESTINATION "redist") - SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q /norestart'" ) + get_filename_component(REDIST_FILENAME "${VCREDIST64}" NAME) + SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " + ExecWait '\\\"$INSTDIR\\\\redist\\\\${REDIST_FILENAME}\\\" /q /norestart' + RMDir /r \\\"$INSTDIR\\\\redist\\\" + ") endif(EXISTS ${VCREDIST64}) if(CMAKE_CL_64)