How to pack a Windows EXE and its DLL in a Flet application?

120 Views Asked by At

I use flet CLI to package on Windows. The package depends on unrar, which requires the EXE and its DLL to be included in the package. My command line looks like this:

flet pack -D main.py -n bee --icon="E:\python\file-manager\icon\48_Goat.png" --add-data "assets\unrar.dll;." --add-data "assets\unrar.exe;."

When I run the exe on another Windows machine, I get the following error:

pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'C:\\Users\\WDAGUtilityAccount\\Desktop\\bee\\unrar.dll'. Most likely this dynlib/dll was not found when the application was frozen.

I confirmed the DLL can be find in the folder. What is the problem and how can I fix it?

0

There are 0 best solutions below