如何使用命令行工具/批处理自动(批量化、静默地)安装桌面程序
自动安装(文件夹内所有安装包)过程=批量处理过程(for 循环)+静默安装过程(/silent_params)
自动安装过程模板=批量处理过程模板+静默安装过程模板
cd setup_files_direction
for %%f in (*.exe) do (
echo Install "%%f"
start /wait .\"%%f" /slient_params
)
批量处理过程模板
cd setup_files_direction
for %%f in (*.exe) do (
echo Install "%%f"
REM start /wait .\"%%f" /slient_params
)
静默安装过程模板
start /wait .\xxx.exe /slient_params
仅针对 Windows 可执行文件,其使用不同的安装包封装工具,所以自动化安装脚本中的静默安装参数略有不同。
InstallShield 封装
自动安装过程=批量处理过程+静默安装过程
cd setup_files_direction
for %%f in (*.exe) do (
echo Install "%%f"
start /wait .\"%%f" /s /i
)
批量处理过程
cd setup_files_direction
for %%f in (*.exe) do (
echo Install "%%f"
REM start /wait .\"%%f" /s /i
)
静默安装过程
start /wait .\Application_D7RY5_WN32_0.33.0.20_A01.exe /s /i
InstallShield 封装的安装包,其特征是:将 xxx.exe 程序解压后,其解压文件夹中往往存在.iss文件。
静默安装参数获取
以下以 DELL 笔记本更新程序(InstallShield封装)为例,详细说明以下静默安装参数获取
- 解压更新程序于同程序名文件夹内,可以看到.iss文件
- (在解压文件夹)运行(带 /? 帮助参数的)安装程序,获取静默安装方式的参数(/S /v/qn)
setup.exe /?
3. (在原始安装文件所在的文件夹中)运行(带 /S /v/qn)安装程序,获取静默安装方式的真正参数(/s /i)
start /wait .\Application_D7RY5_WN32_0.33.0.20_A01.exe /S /v/qn