python - cx_Freeze: shortcutDir gives error -


i'm creating single file exe form python program. i'm using cx_freeze. works perfect except 1 little agnoying thing.

when install program installs should do, including shortcut on desktop.

but...when want start program shortcut on desktop following error:

error

when try run program within program folder works. when manually create shortcut desktop works aswell.

does know why why shortcut, installed @ installation of program doesn't work?

my cx_freeze setup.py

import cx_freeze import sys  executables = [cx_freeze.executable("tennis_calculator.py", base="win32gui", icon="tennis_ball.ico", shortcutname="tpc", shortcutdir="desktopfolder")] build_exe_options = {"icon": "tennis_ball.ico","packages":["tkinter", "csv", "ttk"], "include_files":["tennis_ball.ico", "testtennis.csv"]} build_msi_options = {"include_files":"testtennis.csv"}   cx_freeze.setup(     name = "tennis probability calculator",     options = {"build_exe":build_exe_options, "build_msi":build_msi_options},     version = "1.0",     author = "ws",      executables = executables     ) 

after long search found solution.

how set shortcut working directory in cx_freeze msi bundle?

i able fix problem making small change cx_freeze/windist.py. in add_config(), line 61, changed:

msilib.add_data(self.db, "shortcut",         [("s_app_%s" % index, executable.shortcutdir,                 executable.shortcutname, "targetdir",                 "[targetdir]%s" % basename, none, none, none,                 none, none, none, none)]) 

to

msilib.add_data(self.db, "shortcut",         [("s_app_%s" % index, executable.shortcutdir,                 executable.shortcutname, "targetdir",                 "[targetdir]%s" % basename, none, none, none,                 none, none, none, "targetdir")]) # <--- working directory. 

thanks everyone.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -