@@ -196,13 +196,24 @@ ACTION_IF ~%SYSTEM_ARCH%~ STR_EQ ~amd64~ BEGIN
196196 OUTER_SPRINT arch_var ~x86_64%os_slash%~
197197END
198198PRINT ~arch_var = %arch_var%~
199+
199200ACTION_FOR_EACH file IN lua weidu BEGIN
200201 ACTION_IF FILE_EXISTS ~%MOD_FOLDER%/bin/%WEIDU_OS%/%arch_var%%file%%exe%~ BEGIN
201202 OUTER_SPRINT EVAL ~%file%~ ~%bin%%MOD_FOLDER%%os_slash%bin%os_slash%%WEIDU_OS%%os_slash%%arch_var%%file%%exe%~
202203 END ELSE ACTION_IF (NOT ~%arch_var%~ STR_EQ ~~) AND (FILE_EXISTS ~%MOD_FOLDER%/bin/%WEIDU_OS%/%file%%exe%~) BEGIN
203204 OUTER_SPRINT EVAL ~%file%~ ~%bin%%MOD_FOLDER%%os_slash%bin%os_slash%%WEIDU_OS%%os_slash%%file%%exe%~
204205 END ELSE BEGIN
205- FAIL ~%file% not found~
206+ ACTION_IF NOT ~%WEIDU_OS%~ STR_EQ ~win32~ BEGIN
207+ OUTER_SPRINT shell_cmd ~which %file%~
208+ AT_NOW ret_val ~%shell_cmd%~ EXACT
209+ ACTION_IF (ret_val != 0) BEGIN
210+ WARN ~Shell command failed to execute: %shell_cmd%~
211+ FAIL ~%file% not found, you'll need to add %file% to your path~
212+ END
213+ OUTER_SPRINT EVAL ~%file%~ ~%shell_cmd%~
214+ END ELSE BEGIN
215+ FAIL ~%file% not found~
216+ END
206217 END
207218 OUTER_SPRINT tool EVAL ~%%file%%~
208219 ACTION_IF NOT ~%WEIDU_OS%~ STR_EQ ~win32~ BEGIN
@@ -270,13 +281,13 @@ ACTION_IF NOT ~%log%~ STR_EQ ~~ BEGIN
270281 APPEND_OUTER + ~%MOD_FOLDER%/temp/append.tra~ ~%log%~
271282END
272283
273- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --traify# 200000 --traify-tlk --out "%MOD_FOLDER%/temp/bgee.tra"~
284+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --traify# 200000 --traify-tlk --out "%MOD_FOLDER%/temp/bgee.tra"~
274285AT_NOW ret_val ~%shell_cmd%~
275286ACTION_IF (ret_val != 0) BEGIN
276287 WARN ~Shell command failed to execute: %shell_cmd%~
277288END
278289
279- OUTER_SPRINT shell_cmd ~% lua% %MOD_FOLDER%/lib/tlk_cnt.lua~
290+ OUTER_SPRINT shell_cmd ~lua %MOD_FOLDER%/lib/tlk_cnt.lua~
280291AT_NOW ret_val ~%shell_cmd%~
281292ACTION_IF (ret_val != 0) BEGIN
282293 WARN ~Shell command failed to execute: %shell_cmd%~
@@ -285,7 +296,7 @@ COPY + ~%MOD_FOLDER%/temp/tlk_cnt.txt~ ~%MOD_FOLDER%/temp~
285296 READ_LONG 0xa "tlk_end"
286297 SET tlk_end = tlk_end + 200000 - 1
287298
288- OUTER_SPRINT shell_cmd ~% lua% %MOD_FOLDER%/lib/tra_merge.lua~
299+ OUTER_SPRINT shell_cmd ~lua %MOD_FOLDER%/lib/tra_merge.lua~
289300AT_NOW ret_val ~%shell_cmd%~
290301ACTION_IF (ret_val != 0) BEGIN
291302 WARN ~Shell command failed to execute: %shell_cmd%~
@@ -309,7 +320,7 @@ ACTION_FOR_EACH var IN are bcs chr cre dlg eff ini itm pro spl sto vef vvc wed B
309320 PRINT ~~
310321 PRINT ~Preparing %var% files...~
311322 MKDIR ~%patch_dir%/%var%~
312- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%patch_dir%/%var%" --biff-get-rest "^.*\.%var%$"~
323+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%patch_dir%/%var%" --biff-get-rest "^.*\.%var%$"~
313324 AT_NOW ret_val ~%shell_cmd%~
314325 LAM bash_log
315326 ACTION_IF (ret_val != 0) BEGIN
@@ -329,7 +340,7 @@ ACTION_FOR_EACH file IN baldur.gam worldmap.wmp bgmap.wmp sodmap.wmp BEGIN
329340 ACTION_IF (FILE_EXISTS ~%bgee_dir%/override/%file%~) BEGIN
330341 COPY_LARGE + ~%bgee_dir%/override/%file%~ ~%patch_dir%~
331342 END ELSE BEGIN
332- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%patch_dir%" --biff-get-rest "%file%"~
343+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%patch_dir%" --biff-get-rest "%file%"~
333344 AT_NOW ret_val ~%shell_cmd%~
334345 LAM bash_log
335346 ACTION_IF (ret_val != 0) BEGIN
356367ACTION_FOR_EACH var IN bam bmp mos tis pvrz BEGIN
357368 PRINT ~~
358369 PRINT ~Preparing %var% files...~
359- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%%os_slash%temp%os_slash%biff" --biff-get-rest "^.*\.%var%$"~
370+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%%os_slash%temp%os_slash%biff" --biff-get-rest "^.*\.%var%$"~
360371 AT_NOW ret_val ~%shell_cmd%~
361372 LAM bash_log
362373 ACTION_IF (ret_val != 0) BEGIN
@@ -376,7 +387,7 @@ ACTION_FOR_EACH var IN 2da /*plt*/ ttf wav wbm wfx BEGIN
376387 PRINT ~~
377388 PRINT ~Preparing %var% files...~
378389 MKDIR ~%MOD_FOLDER%/temp/%var%~
379- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%/temp/%var%" --biff-get-rest "^.*\.%var%$"~
390+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%/temp/%var%" --biff-get-rest "^.*\.%var%$"~
380391 AT_NOW ret_val ~%shell_cmd%~
381392 LAM bash_log
382393 ACTION_IF (ret_val != 0) BEGIN
@@ -396,7 +407,7 @@ ACTION_FOR_EACH file IN animate.ids anisnd.ids class.ids ea.ids gtimes.ids kit.i
396407 ACTION_IF (FILE_EXISTS ~%bgee_dir%/override/%file%~) BEGIN
397408 COPY_LARGE + ~%bgee_dir%/override/%file%~ ~%MOD_FOLDER%/temp/array~
398409 END ELSE BEGIN
399- OUTER_SPRINT shell_cmd ~% weidu% --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%/temp/array" --biff-get-rest "%file%"~
410+ OUTER_SPRINT shell_cmd ~weidu --noautoupdate --no-auto-tp2 --logapp --log "%MOD_FOLDER%/temp/bash.debug" --game "%bgee_dir%" --use-lang "%LANGUAGE_BG1%" --out "%MOD_FOLDER%/temp/array" --biff-get-rest "%file%"~
400411 AT_NOW ret_val ~%shell_cmd%~
401412 LAM bash_log
402413 ACTION_IF (ret_val != 0) BEGIN
@@ -1215,7 +1226,7 @@ APPEND_OUTER + ~%MOD_FOLDER%/temp/tables.lua~ ~%tbl_lua%~
12151226OUTER_SPRINT tbl_lua ~~
12161227
12171228//LUA regexp conversion
1218- OUTER_SPRINT shell_cmd ~% lua% %MOD_FOLDER%/lib/main.lua~
1229+ OUTER_SPRINT shell_cmd ~lua %MOD_FOLDER%/lib/main.lua~
12191230AT_NOW ret_val ~%shell_cmd%~
12201231LAM bash_log
12211232ACTION_IF (ret_val != 0) BEGIN
@@ -2772,8 +2783,6 @@ ACTION_FOR_EACH file IN EET_end EET_gui BEGIN
27722783 ACTION_IF ~%WEIDU_OS%~ STR_EQ ~osx~ BEGIN
27732784 COPY ~setup-EET.command~ ~setup-%file%.command~
27742785 REPLACE_TEXTUALLY ~EET/EET.tp2 --log SETUP-EET.DEBUG~ ~%file%/%file%.tp2 --log SETUP-%file%.DEBUG~
2775- END ELSE BEGIN
2776- COPY ~%weidu%~ ~setup-%file%%exe%~
27772786 END
27782787END
27792788
0 commit comments