Skip to main content

gen-exe

GitHub workflow status: master PyPI version Code style: black

A small utility which allows you to generate Windows executables that can run custom commands on your Windows system.

Features

  • generate portable executables that can run customizable commands
  • commands can use the {EXE_DIR} macro to get the directory relative to the executable
  • the generated executable supports passing command-line arguments
  • you can add icons during or after generation of the executable
  • installation adds two CLIs: gen-exe and add-icon-to-exe

Installation

Install from PyPi using:

pip install gen-exe

Usage gen-exe

Custom commands can be embedded in the executables by providing a command string to the CLI, for example:

gen-exe test.exe "echo hello world"

The command string argument also supports the {EXE_DIR} macro, which expands the path where the executable is executed from, for example:

gen-exe test.exe "echo I am running from: {EXE_DIR}"

This can be used to run relative executables:

gen-exe test.exe "{EXE_DIR}\\another.exe"

Optionally you can provide an icon file for the executable.

gen-exe test.exe "echo I have a fancy icon now..." -i path-to-your.ico

Another use case is to call a script or command using a Python interpreter, for example:

gen-exe test.exe "python -c print(\'hello world\')"

For other options see the help:

gen-exe --help

Usage generated executables

Execute them by double clicking or via the command line:

test.exe optional_argument_1 optional_argument_2

Usage add-icon-to-exe

To add an icon called test.ico to a test.exe executable file.

add-icon-to-exe test.exe test.ico

Note that the utility will replace any icons that already exist in the target executable.

Contributing

Fork the gen-exe repository

Setup your forked repository locally as an editable installation:

$ cd ~
$ git clone https://github.com/yourproject/genexe
$ pip install --editable ./genexe

Now you can work locally and create your own pull requests.

Feel free to open issues and pull requests.

Maintainer

Sil van de Leemput

History

0.2.1 (2021-02-08)
  • Added hide-console option to the executable and the CLI
0.2.0 (2021-02-07)
  • Embedded runtimes in the executable. Executable should now work on Windows systems without VC++ redistributables installed
0.1.1 (2021-02-06)
  • Better documentation - updated the README.md
0.1.0 (2021-02-06)
  • Initial release on PyPi

Metadata

Release files for gen-exe 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gen-exe 0.2.1
File Size Uploaded Provenance
gen-exe-0.2.1.tar.gz 70.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gen-exe 0.2.1
File Interpreter ABI Platform
gen_exe-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 140.9 kB

Release files / gen-exe-0.2.1.tar.gz

Download URL gen-exe-0.2.1.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f02bfe6f8fe123c50320a3ef159d85ffaf2dcd5e80f191e308231f51ec82b015
BLAKE2b-256 checksum
How to use checksums
d0656c4c1d16ea897ee67bec7311ee1c61a8977e46f79bb66cc9babbb04a5757
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release files / gen_exe-0.2.1-py3-none-any.whl

Download URL gen_exe-0.2.1-py3-none-any.whl
Size 70.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d76215e9d91b0d3788db2000e2000b57e3929607e3eb542f8c5a2eeb97cd9c34
BLAKE2b-256 checksum
How to use checksums
b22ac30cb8322799bad2ac475211aec36a2b95dc9e31e121aaaab1f7c8ccf48b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Security for gen-exe 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page