推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shunconf
V2EX  ›  Python

Python 可以做软件安装器吗?

  •  
  •   shunconf · Aug 5, 2020 · 2973 views
    This topic created in 2134 days ago, the information mentioned may be changed or developed.

    PYTHON 可以做软件安装器吗?

    需求:

    0. 软件运行环境为 win 平台,ad 域的

    1. 打开软件输入指定密码

    2. 可以指定以哪个用户权限安装。需要内置 2 个用户

    3. 指定软件路径

    现在想知道需要用那些框架,Emmmmmm

    11 replies    2020-08-06 16:17:10 +08:00
    zhiyzellda
        1
    zhiyzellda  
       Aug 5, 2020 via Android
    不熟悉 Python 。但你的第二点必须使用此系统的 Admin 账户操作。如果这个软件的成品已经制作出来了,那怎么会缺少 installer ?这个软件如果是用 C++写的,那开发者自然跟着一起用 C++去写安装器( installer )。没有 C++写了软件主体,又用 Python 去写安装器的理由吧。
    devliu1
        2
    devliu1  
       Aug 5, 2020
    为什么 不用成熟的安装器呢
    shunconf
        3
    shunconf  
    OP
       Aug 5, 2020
    @zhiyzellda
    @devliu1 上级给的任务 让我研究研究,而且我只是个桌面运维,只有点 py 基础
    hyperbin
        4
    hyperbin  
       Aug 5, 2020 via Android
    python 自己都需要安装才能起来
    zhiyzellda
        5
    zhiyzellda  
       Aug 5, 2020 via Android
    @shunconf
    都是只会使用跟自己的软件主体语言一致的语言来写安装器的吧。
    软件主体是 Java 就用 Java 写安装器,
    软件主体是 C++就用 C++来写。
    软件主体如果是 Python, “pyinstaller” 这个工具可以直接转换成.exe 文件,win 可以直接运行。具体谷歌搜 pyinstaller 。
    这个需求严格来说可以实现,只是没人愿意用。不合乎情理。
    devliu1
        6
    devliu1  
       Aug 5, 2020
    @shunconf 用 python 不是很合适,毕竟 python 程序要独立运行还得用 pyinstaller 之类的打包,还得加上 GUI 编程。

    打包工具可以试试 nsis 、inno 。
    shunconf
        7
    shunconf  
    OP
       Aug 5, 2020
    @zhiyzellda 软件无非就是常用的 wps qq 钉钉 之类的
    naohion
        8
    naohion  
       Aug 5, 2020
    @devliu1
    @zhiyzellda
    看 7 楼,他的意思是用 python 自动安装别的软件,这种需求试试 /S 参数运行安装包行不行,不行就用 AutoIT 这样专门的语言写比较快,python 的话就用 PyUserInput 之类的模块,比较麻烦。
    shunconf
        9
    shunconf  
    OP
       Aug 6, 2020
    @naohion 非常感谢哈,autoit 不会写 哈哈哈
    devliu1
        10
    devliu1  
       Aug 6, 2020
    @naohion
    @shunconf

    那其实就是 AD 下推送软件了,AD 下最好封装成*.msi ,自动化可以用 python 。
    shunconf
        11
    shunconf  
    OP
       Aug 6, 2020
    @devliu1 主要是文件关联问题,还有如果自动安装只能安装在 C 盘,我都配置好 msi 安装为 d 盘的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3411 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 12:11 · PVG 20:11 · LAX 05:11 · JFK 08:11
    ♥ Do have faith in what you're doing.