Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from distutils.core import setup
- import py2exe, os
- Mydata_files = []
- for files in os.listdir('folder of assets'):
- f1 = 'folder of assets' + files
- if os.path.isfile(f1): # skip directories
- f2 = 'assets', [f1]
- Mydata_files.append(f2)
- icon_location = "icon_location\\encryptor.ico"
- setup_dict = dict(
- name="Application Name",
- version="1.0",
- description="description",
- author="Your Name",
- windows = [{
- "script":"script.py",
- "icon_resources": [(0, icon_location), (1, icon_location), (42, icon_location)],
- "dest_base":"exe name"
- }],
- zipfile=None,
- options={
- "py2exe": {
- "optimize": 2,
- "dll_excludes": [
- "api-ms-win-core-heap-l2-1-0.dll",
- "api-ms-win-core-delayload-l1-1-1.dll",
- "api-ms-win-core-libraryloader-l1-2-0.dll",
- "api-ms-win-security-activedirectoryclient-l1-1-0.dll",
- "api-ms-win-core-delayload-l1-1-0.dll",
- "api-ms-win-core-processthreads-l1-1-0.dll",
- "api-ms-win-core-string-obsolete-l1-1-0.dll",
- "api-ms-win-core-profile-l1-1-0.dll",
- "api-ms-win-core-errorhandling-l1-1-0.dll",
- "api-ms-win-core-sysinfo-l1-1-0.dll"
- ]
- }
- },
- data_files=Mydata_files
- )
- setup(**setup_dict)
- setup(**setup_dict)##run it again fixes the icon bug
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement