How to set shortcut working directory in cx_freeze msi bundle?

前端 未结 2 908
死守一世寂寞
死守一世寂寞 2021-01-03 12:40

I was working on a Python program which deals with SQLite3 databases. I made it as an MSI setup file by using cx_Freeze.

Windows shortcuts produced by .msi set-up fi

2条回答
  •  孤街浪徒
    2021-01-03 13:43

    I was able to fix the problem by making a small change to cx_Freeze/windist.py. In add_config(), line 61, I 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.

提交回复
热议问题