@@ -201,6 +201,28 @@ def project_version_increase(increase_type):
201201 return set_project_version (new_version , new_project_version )
202202
203203
204+ @lru_cache ()
205+ def require_engine_version (major : int , minor : int ) -> bool :
206+ engine_association = get_engine_association ()
207+ if engine_association .startswith (uev_prefix ):
208+ version = pbconfig .get ("engine_base_version" )
209+ else :
210+ version = engine_association
211+ if version is None :
212+ return False
213+ version_split = version .split ("." )
214+ if len (version_split ) != 2 :
215+ pblog .error ("Incorrect engine base version detected" )
216+ return False
217+ cur_major = int (version_split [0 ])
218+ if cur_major > major :
219+ return True
220+ cur_minor = int (version_split [1 ])
221+ if cur_major == major and cur_minor >= minor :
222+ return True
223+ return False
224+
225+
204226@lru_cache ()
205227def get_engine_prefix () -> str :
206228 return f"{ pbconfig .get ('engine_base_version' )} -{ get_engine_version_prefix ()} "
@@ -673,7 +695,10 @@ def get_unreal_version_selector_path():
673695def run_unreal_setup ():
674696 base_path = get_engine_base_path ()
675697 pblog .info ("Installing Unreal Engine prerequisites (requires admin permission)" )
676- prereq_exe = "UEPrereqSetup_x64" if is_ue5 () else "UE4PrereqSetup_x64"
698+ if require_engine_version (5 , 6 ):
699+ prereq_exe = "vc_redist.x64"
700+ else :
701+ prereq_exe = "UEPrereqSetup_x64" if is_ue5 () else "UE4PrereqSetup_x64"
677702 prereq_path = base_path / Path (
678703 f"Engine/Extras/Redist/en-us/{ prereq_exe } { get_exe_ext ()} "
679704 )
0 commit comments