静默安装、授权及卸载Microsoft SQL Server、NET Framework、Windows Installer 、ArcGIS License Manager、ArcGIS Engine(Silent install、uninstall and Authorization.. .through Setup Factory)基于Setup Factory

时间:2022-02-10 05:07:30

通过Setup Factory写的代码大概有1700行,所以就不整理了。思路如下:

静默安装都是通过去Microsoft 和Esri的官网找到静默安装的命令,然后File.Run(...)或者Shell.Execute(...)一下;静默卸载就是搜素注册表,调用微软的卸载命令即可。

1、NET Framework静默安装(" /q /norestart")

File.Run(DOTNetFilePath, " /q /norestart","",SW_SHOWNORMAL, true);

2、ArcGIS License Manager、ArcGIS Engine静默安装(" /qb")

local strInstallerCommand = " /qb";
local nSetupResult = Shell.Execute(strInstallerDest,"open",strInstallerCommand,"", SW_SHOWNORMAL,true);

3、Microsoft SQL Server静默安装

/q /ACTION=Install
/FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SECURITYMODE=SQL /SAPWD="SQLEXPRESS" /IACCEPTSQLSERVERLICENSETERMS

附:

number Shell.Execute (

string  Filename,

string  Verb = "open",

string  Arguments = "",

string  WorkingFolder = "",

number  WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )