我想为我的 Python Windows 安装程序包创建开始菜单或桌面快捷方式。我正在尝试遵循https://docs.python.org/3.4/distutils/builtdist.html#the-post 安装脚本 https://docs.python.org/3.4/distutils/builtdist.html#the-postinstallation-script
这是我的脚本;
import sys
from os.path import dirname, join, expanduser
pyw_executable = sys.executable.replace('python.exe','pythonw.exe')
script_file = join(dirname(pyw_executable), 'Scripts', 'tklsystem-script.py')
w_dir = expanduser(join('~','lsf_files'))
print(sys.argv)
if sys.argv[1] == '-install':
print('Creating Shortcut')
create_shortcut(
target=pyw_executable,
description='A program to work with L-System Equations',
filename='L-System Tool',
arguments=script_file,
workdir=wdir
)
我还在脚本设置选项中指定了此脚本,如上述文档所示。
这是我用来创建安装程序的命令;
python setup.py bdist_wininst --install-script tklsystem-post-install.py
使用创建的 Windows 安装程序安装软件包后,我找不到快捷方式的创建位置,也无法确认脚本是否运行?
如何让 setuptools 生成 Windows 安装程序来创建桌面或开始菜单快捷方式?