我正在使用cx-freeze为Python应用程序创建一个MSI安装程序。如何从桌面安装指向应用程序的链接?
发布于 2013-04-01 09:15:04
要创建应用程序的快捷方式,请为可执行文件提供shortCutName和shortcutDir选项。shortcutDir可以命名任何System Folder Properties (感谢Aaron)。例如:
from cx_Freeze import *
setup(
executables = [
Executable(
"MyApp.py",
shortcutName="DTI Playlist",
shortcutDir="DesktopFolder",
)
]
)您还可以将项目添加到MSI快捷表中。这使您可以创建多个快捷方式并设置工作目录(快捷方式的“开始位置”设置)。
from cx_Freeze import *
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa371847(v=vs.85).aspx
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"DTI Playlist", # Name
"TARGETDIR", # Component_
"[TARGETDIR]playlist.exe",# Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
)
]
# Now create the table dictionary
msi_data = {"Shortcut": shortcut_table}
# Change some default MSI options and specify the use of the above defined tables
bdist_msi_options = {'data': msi_data}
setup(
options = {
"bdist_msi": bdist_msi_options,
},
executables = [
Executable(
"MyApp.py",
)
]
)https://stackoverflow.com/questions/15734703
复制相似问题