Distribution & Packaging - HaxeFoundation/hashlink GitHub Wiki
In order to package and distribute a HashLink application, you need to the following files (on Windows):
hl.exewhich can safely be renamed toYourGame.exelibhl.dllfor the HL runtimemsvcr120.dll(for the later use eitherWindows/System32for HL 64 bits orWindows/SysWOW64for HL 32)yourgame.hl(compiled bytecode) to rename tohlboot.datso it's automatically executed byhl.exe- the
.hdllfiles you are usingfmt.hdllfor PNG/JPG/ZIP/etc. supportssl.hdllfor HTTPs support- some others (see below)
Other dependencies:
- if you are using Heaps you need
heaps.dllopenal.hdllui.hdlluv.hdllas well asOpenAL32.dll(from OpenAL Soft) - if you are using SDL support (
-lib hlsdl) you needsdl.hdllandSDL2.dll - if you are using DirectX support (
-lib hldx) you needdirectx.hdllandd3dcompiler_47.dll(version 6.3, since version 10.x that comes with Windows 10 also requires Universal CRT) - if you are using DirectX12 support (
-lib hldx -D dx12) you needdirectx.hdll,dx12.hdll,dxcompiler.dllanddxil.dll(see https://github.com/microsoft/DirectXShaderCompiler/releases) - if you are using Steam support you need
steam.hdllsteam_api.dll(from steamworks sdk) andmsvcp120.dll(see remarks regarding msvcr120)
You can change the exe icon using rcedit with the following command rcedit YourGame.exe --set-icon myicon.ico
Linux
You'll need a Linux build machine (can be a VM) to build hashlink and related binaries.
Use the following command to fix all binaries in the current folder:
chmod +x *.so* && find *.hdll hl *.so *.so.* | xargs -L 1 patchelf --set-rpath ./
Use the following command to find missing dependencies in the current folder:
ldd * | grep ":\| => " | tr -s " " | cut -d"(" -f1
Mac
You'll need a Mac build machine (can be a VM) to build hashlink and related binaries.
Use the following command to fix all binaries in the current folder:
ls *.hdll *.dylib hl | xargs -L 1 install_name_tool -change libhl.dylib @rpath/libhl.dylib
ls *.hdll *.dylib hl | xargs -I{} sh -c 'otool -l {} | grep " name " | tail -n +2 | tr -s " " | cut -d " " -f3 | grep -v -e "/usr/lib" -e "/System/Library" -e "libhl.dylib" -e "\@loader_path" -e "\@rpath" | sed -E "s/^(\/.*\/)(.*)$$/\1\2 \@rpath\/\2 {}/g"' > tmpargs.txt
cat tmpargs.txt | xargs -L1 echo "install_name_tool -change" > tmpargs2.txt
cat tmpargs2.txt && bash tmpargs2.txt && rm tmpargs.txt tmpargs2.txt
Use the following command to find missing dependencies in the current folder:
ls *.hdll *.dylib hl | xargs -I {} sh -c 'otool -l {} | grep " name " | tail -n +2 | tr -s " " | cut -d " " -f3 | grep -v -e "/usr/lib" -e "/System/Library" -e "libhl.dylib"' || true