静默安装、授权及卸载Microsoft SQL Server、NET Framework、Windows Installer 、ArcGIS License Manager、ArcGIS Engine

2020-10-09 16:48:38 浏览数 (1)

 通过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 AUTHORITYNETWORK 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 )

number File.Run (

string  Filename, string  Args = "", string  WorkingFolder = "", number  WindowMode = SW_SHOWNORMAL, boolean WaitForReturn = false )

0 人点赞