2

I'm using cx_freeze to export a Python program. The exported program was working fine until I tried to add shortcut with icon on the desktop. I've taken the codes from there and there. When running the main.exe file from its folder in C://Program files, there is no problem, but when I run the shortcut on the desktop there is this error :enter image description here

The setup.py file :

import sys
from cx_Freeze import setup,Executable

base = None
if sys.platform == "win32":
    base = "Win32GUI"

includefiles = ['bouton_ajouter_contact.png','bouton_contacts.png','bouton_deconnexion.png',\
'bouton_message.png','bouton_messages.png','bouton_reglages.png','fond_home.png','worldco.png']

includes = []
excludes = []
packages = ['os']


setup(
    ...
    options = {'build_exe': {'includes':includes,'excludes':excludes,'packages':packages,'include_files':includefiles}}, 
    executables = [Executable(
        'main.py', base=base,
        shortcutName="Messagerie Cryptee", shortcutDir="DesktopFolder",
        icon='messagerie_cryptee_ico.ico'
        )]
)

All the .png files and the .ico file are in the same folder as the setup.py file, in Python34. Before adding a shortcut, this problem was not there, and I don't remember having changed anything about images. Thanks for help

MAYANK SHARMA
  • 307
  • 1
  • 4
  • 12
Guil23
  • 191
  • 14
  • 1
    This might be relevant, http://stackoverflow.com/questions/24195311/how-to-set-shortcut-working-directory-in-cx-freeze-msi-bundle – J.J. Hakala May 07 '17 at 07:25
  • Yes, [http://stackoverflow.com/q/38637337/7767459](http://stackoverflow.com/q/38637337/7767459) has used the same solution.. I was waiting for another solution because this one seems a bit strange, but I'm gonna try – Guil23 May 07 '17 at 07:54
  • See [Frequently Asked Questions — Using data files — cx_Freeze documentation](http://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files). Does that help? – Craig McQueen Jun 02 '17 at 06:19
  • Possible duplicate of [How to set shortcut working directory in cx\_freeze msi bundle?](https://stackoverflow.com/questions/24195311/how-to-set-shortcut-working-directory-in-cx-freeze-msi-bundle) – Travis J Aug 17 '17 at 22:48

0 Answers0