But, of course, we don't want to ask users to pass additional arguments. That's why we have to embed this command line into packed exe. It's easy: check "Override command line" and enter there:
It means that the packed exe runs as if main.py really passed!
We need to pack python.exe that interprets python scripts. So select it as input exe. Also we need to add additional files: folders DLLs and Lib. In fact you can remove files that are not required by your application, but firstly better to include everything. So let's import these folders.
Additionally, python27.dll is required, find it in System32 directory (or in SysWow64 on 64-bit Windows) and add to Application Directory.
Of course we also should add main.py (a script file) and hello.txt (the scripts reads this file).
Now we are ready to build it and run. See screenshots below.
1. Select python.exe
2. Set output name
3. Override command line
4. Import directories
5. Add files
6. Build and run. It works!
Both sources and BoxedApp Packer project are available on GitHub.
BoxedApp is a virtualization library, an executable packer, and a developer API to create custom packers.