代码之家  ›  专栏  ›  技术社区  ›  Xantium

将cx冻结msi添加到路径

  •  0
  • Xantium  · 技术社区  · 6 年前

    exe

    我发现了这个:

    the documentation .

    setup(  name = "cabbage",
            version = "0.1",
            description = "just a vegetable",
            add_to_path = True, # <-- Just here
            options = {"build_exe": build_exe_options},
            executables = [Executable("spam.py", base=base)])
    

    我还从命令行尝试:

    C:\Users\Simon\Desktop>python setup.py bdist_msi add_to_path=True
    invalid command name 'add_to_path=True'
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   Humsawani    6 年前

      if 'bdist_msi' in sys.argv:
    
            sys.argv += ['--add-to-path', 'True']
    

    您的代码应该如下所示:

     if 'bdist_msi' in sys.argv:
    
            sys.argv += ['--add-to-path', 'True']
    
    
     setup(  name = "cabbage",
        version = "0.1",
        description = "just a vegetable",
        add_to_path = True, # <-- Just here
        options = {"build_exe": build_exe_options},
        executables = [Executable("spam.py", base=base)])