Advertisement
AceScottie

setup.py

Nov 23rd, 2018
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. from distutils.core import setup
  2. import py2exe, os
  3. Mydata_files = []
  4. for files in os.listdir('folder of assets'):
  5.     f1 = 'folder of assets' + files
  6.     if os.path.isfile(f1): # skip directories
  7.         f2 = 'assets', [f1]
  8.         Mydata_files.append(f2)
  9. icon_location = "icon_location\\encryptor.ico"
  10.  
  11. setup_dict = dict(
  12.     name="Application Name",
  13.     version="1.0",
  14.     description="description",
  15.     author="Your Name",
  16.     windows = [{
  17.             "script":"script.py",
  18.             "icon_resources": [(0, icon_location), (1, icon_location), (42, icon_location)],
  19.             "dest_base":"exe name"
  20.             }],
  21.     zipfile=None,
  22.     options={
  23.          "py2exe": {
  24.             "optimize": 2,
  25.             "dll_excludes": [
  26.             "api-ms-win-core-heap-l2-1-0.dll",
  27.             "api-ms-win-core-delayload-l1-1-1.dll",
  28.             "api-ms-win-core-libraryloader-l1-2-0.dll",
  29.             "api-ms-win-security-activedirectoryclient-l1-1-0.dll",
  30.             "api-ms-win-core-delayload-l1-1-0.dll",
  31.             "api-ms-win-core-processthreads-l1-1-0.dll",
  32.             "api-ms-win-core-string-obsolete-l1-1-0.dll",
  33.             "api-ms-win-core-profile-l1-1-0.dll",
  34.             "api-ms-win-core-errorhandling-l1-1-0.dll",
  35.             "api-ms-win-core-sysinfo-l1-1-0.dll"
  36.             ]
  37.            
  38.             }
  39.         },
  40.     data_files=Mydata_files
  41. )
  42.  
  43. setup(**setup_dict)
  44. setup(**setup_dict)##run it again fixes the icon bug
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement