I was able to convert DllPackFiles(), but I inserted a try statement before the DllCall to block the error
Code: Select all
; AHK v2 port
DllPackFiles(Folder, DLL, Section := "Files")
{
Section := Format("{:U}", Section)
; DLL file must be created by DllCreateEmpty() manually, since the function is not ported
;DLL := FileExist(DLL) ? DLL : DllCreateEmpty(DLL)
hUPD := DllCall("BeginUpdateResource", "Str",DLL, "Int",0, "Ptr")
Loop Files, Folder "\*.*"
{
Key := Format("{:U}", A_LoopFileName)
BIN := FileRead(A_LoopFileFullPath, "RAW")
try DllCall( "UpdateResource", "Ptr",hUPD, "Str",Section, "Str",Key
, "Int",0, "Ptr",&BIN, "UInt",A_LoopFileSize )
}
DllCall( "EndUpdateResource", "Ptr",hUPD, "Int",0 )
}