通过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 ( |
number File.Run ( |