清泛IT社区

搜索
App Inventor 2 中文社区 轻松创建Apps

扫码访问移动社区 移动社区,您的掌上技术专家

关注我,精彩不错过! 关注我,精彩不错过!

扫码安装最新版AI伴侣 最新版AI伴侣v2.69

Aia Store .aia 源码一站式解决方案 发布日志AI2连接测试ai2Starter模拟器

开通VIPApp Inventor 2 拓展有奖征文 VIP会员享专有教程,免费赠送基础版*技术支持服务! AI2入门必读中文文档中文教程IoT专题

查看: 430|回复: 0
打印 上一主题 下一主题

NSIS做的安装程序,可接受命令行参数,实现静默安装,静默卸载

  • TA的每日心情
    开心
    2024-02-17 18:16
  • 签到天数: 14 天

    [LV.3]偶尔看看II

    546

    主题

    715

    帖子

    1万

    积分

    管理员

    这里没有广告...

    Rank: 9Rank: 9Rank: 9

    积分
    10689
    QQ
    跳转到指定楼层
    楼主
    发表于 2016-04-07 17:27:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

    命令参数 /D=xxx 可以指定安装包的安装路径,覆盖安装包中设置的默认路径及注册表中默认路径。

    但是,/D= 后面一定不能有引号(不能写成 /D="xxx"),否则不生效,仍然按照安装包中的默认路径安装。


    更多请参考英文资料:

    Generated installers and uninstallers accept a few options on the command line. These options give the user a bit more control over the installation process.

    3.2.1 Common Options
    • /NCRC disables the CRC check, unless CRCCheck force was used in the script.
    • /S runs the installer or uninstaller silently. See section 4.12 for more information.
    • /D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported.
    3.2.2 Uninstaller Specific Options
    • _?= sets $INSTDIR. It also stops the uninstaller from copying itself to the temporary directory and running from there. It can be used along with ExecWait to wait for the uninstaller to finish. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
    3.2.3 Examples

    installer.exe /NCRC
    installer.exe /S
    installer.exe /D=C:\Program Files\NSIS
    installer.exe /NCRC /S /D=C:\Program Files\NSIS
    uninstaller.exe /S _?=C:\Program Files\NSIS

    # uninstall old version
    ExecWait '"$INSTDIR\uninstaller.exe" /S _?=$INSTDIR'


    清泛网 - 专注IT技能提升
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    © 2024 tsingfun.com, Inc.  沪ICP备2020034476号-1  沪公网安备31011702000040号

    GMT+8, 2024-05-07 02:24 , Processed in 0.018614 second(s), 36 queries .