Windows installer 使用cx freeze创建向桌面添加快捷方式的msi

Windows installer 使用cx freeze创建向桌面添加快捷方式的msi,windows-installer,cx-freeze,Windows Installer,Cx Freeze,我正在使用cx freeze为Python应用程序创建MSI安装程序。如何从桌面安装指向应用程序的链接?要创建应用程序的快捷方式,请为可执行文件提供shortCutName和shortcutDir选项。shortcutDir可以命名任何一个(谢谢Aaron)。例如: from cx_Freeze import * setup( executables = [ Executable( "MyApp.py", shortcut

我正在使用cx freeze为Python应用程序创建MSI安装程序。如何从桌面安装指向应用程序的链接?

要创建应用程序的快捷方式,请为可执行文件提供shortCutNameshortcutDir选项。shortcutDir可以命名任何一个(谢谢Aaron)。例如:

from cx_Freeze import *

setup(
    executables = [
        Executable(
            "MyApp.py",
            shortcutName="DTI Playlist",
            shortcutDir="DesktopFolder",
            )
        ]
    )
您还可以将项目添加到MSI快捷方式表中。这允许您创建多个快捷方式并设置工作目录(快捷方式的“起始位置”设置)


可能重复的问题是不同的。在这个问题中,我想创建一个桌面图标。另一个问题是关于捆绑几个MSI安装程序的问题。你知道系统管理员要安装这样的应用程序时这是如何工作的吗?如果设置了ALLUSERS属性,将为所有用户安装快捷方式。设置ALLUSERS的一种方法是在安装.MSI时将“ALLUSERS=1”添加到msiexec命令行。以下是可与shortcutDir一起使用的Windows文件夹列表:@Har Yes,通过向快捷方式表格列表中添加多个项目,可以创建多个桌面快捷方式。为每个项目使用不同的“快捷方式”名称。
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",
            )
        ]
    )