{"id":20601975,"url":"https://github.com/bessouat40/exe-generation-tutorial","last_synced_at":"2025-03-06T16:21:24.773Z","repository":{"id":228012290,"uuid":"772928058","full_name":"Bessouat40/exe-generation-tutorial","owner":"Bessouat40","description":"Tutorial for exe generation","archived":false,"fork":false,"pushed_at":"2024-03-16T09:12:21.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T01:48:47.438Z","etag":null,"topics":["executable","executable-file","executable-packing","python","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bessouat40.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-16T09:07:00.000Z","updated_at":"2024-09-12T16:46:31.000Z","dependencies_parsed_at":"2024-03-16T10:44:36.125Z","dependency_job_id":"2638c038-9015-402f-abe4-e13ea9efab0e","html_url":"https://github.com/Bessouat40/exe-generation-tutorial","commit_stats":null,"previous_names":["bessouat40/exe-generation-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bessouat40%2Fexe-generation-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bessouat40%2Fexe-generation-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bessouat40%2Fexe-generation-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bessouat40%2Fexe-generation-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bessouat40","download_url":"https://codeload.github.com/Bessouat40/exe-generation-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242241252,"owners_count":20095339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["executable","executable-file","executable-packing","python","tutorial"],"created_at":"2024-11-16T09:12:35.477Z","updated_at":"2025-03-06T16:21:24.744Z","avatar_url":"https://github.com/Bessouat40.png","language":null,"readme":"# Exe generation\n\nDocumentation for exe generation.\n\n1. [Virtual environment creation](#virtual-environment-creation)\n2. [Setup your virtual environment](#setup-your-virtual-environment)\n    1. [Setup environment for a script](#setup-environment-for-a-script)\n    2. [Setup environment for a library](#setup-environment-for-a-library)\n        1. [With a requirements.txt file](#with-a-requirementstxt-file)\n        2. [Without requirements.txt file](#without-requirementstxt-file)\n3. [EXE file generation](#exe-file-generation)\n    1. [EXE generation for a script](#exe-generation-for-a-script)\n    2. [EXE generation for a library](#exe-generation-for-a-library)\n4. [Add properties to your EXE file](#add-properties-to-your-exe-file)\n\n## Virtual environment creation\n\nFirst we need to create a virtual environment in order to reduce our exe file weight and his generation time.\n\nWe will add only necessaries libraries in this environment.\nFor that, we need to create a requirements.txt file listing all our dependencies.\n\nThen :\n\n* Go in your directory :\n\n```BASH\npython -m venv myEnv\n```\n\nThen you will have a new folder `myEnv` in your directory.\n\n* Go to `myEnv/Scripts/` and copy `activate.bat` in your `C:\\Workspace` directory.\n\n* Finally :\n\n```BASH\ncd /Workspace\nactivate.bat\n```\n\nNow your virtual environment is running.\n\n![venv](venv.png)\n\n## Setup your virtual environment\n\nNow we need to create our virtual environment with needed libraries.\n\n### Setup environment for a script\n\nInstall all your dependencies :\n\n```bash\npip install \u003cname of your library\u003e\n```\n\n\u003e **⚠ WARNING: At least, you need to install pyinstaller :**\n\n```bash\npip install pyinstaller\n```\n\n### Setup environment for a library\n\n#### With a requirements.txt file\n\nIf you have a `requirements.txt` file with all your dependencies, go to your project directory and run :\n\n```BASH\npython -m pip install -r requirements.txt\n```\n\n\u003e **⚠ WARNING: Don't forget to add pyinstaller in your requirements.txt file !!!**\n\n#### Without requirements.txt file\n\nInstall all your dependencies :\n\n```bash\npip install \u003cname of your library\u003e\n```\n\n\u003e **⚠ WARNING: At least, you need to install pyinstaller :**\n\n```bash\npip install pyinstaller\n```\n\n## EXE file generation\n\n### EXE generation for a script\n\nYou just need to run :\n\n```BASH\npyinstaller --onefile \u003cpath-to-my-file\u003e\n```\n\n### EXE generation for a library\n\nYou just need to run :\n\n```bash\npyinstaller \u003cpath-to-your-main-file\u003e --paths \u003cabslolute-path-to-your-library\u003e\n```\n\n\u003e **⚠ WARNING: If your library is at `/Workspace/dev/Library`, you need to specify `/Workspace/dev` for --paths parameter !**\n\n## Add properties to your EXE file\n\nIf you want to add `Properties` to your executable file, you need to execute this command line :\n\n```bash\npyinstaller --version-file=/Path/to/properties.rc \u003cpath-to-your-main-file\u003e --paths \u003cabslolute-path-to-your-library\u003e\n```\n\n`properties.rc` is the file wich contains all details of your executable file.\n\n\u003e **You can find an example `properties.rc` file in this Gitlab repository !**\n\n*File example :*\n\n```rc\nVSVersionInfo(\n  ffi=FixedFileInfo(\n    filevers=(1, 0, 0, 0),\n    prodvers=(1, 0, 0, 0),\n    mask=0x3f,\n    flags=0x0,\n    OS=0x40004,\n    fileType=0x1,\n    subtype=0x0,\n    date=(0, 0)\n    ),\n  kids=[\n    StringFileInfo(\n      [\n      StringTable(\n        u'040904B0',\n        [StringStruct(u'CompanyName', u'Company'),\n        StringStruct(u'FileDescription', u'Description of my script'),\n        StringStruct(u'FileVersion', u'1.0.0'),\n        StringStruct(u'InternalName', u'script'),\n        StringStruct(u'LegalCopyright', u'\\xa9 MyScript. All rights reserved.'),\n        StringStruct(u'OriginalFilename', u'script.exe'),\n        StringStruct(u'ProductName', u'Script'),\n        StringStruct(u'ProductVersion', u'1.0.0')])\n      ]),\n    VarFileInfo([VarStruct(u'Translation', [0, 0])])\n  ]\n)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbessouat40%2Fexe-generation-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbessouat40%2Fexe-generation-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbessouat40%2Fexe-generation-tutorial/lists"}