我想在其他人使用的服务器上安装 Visual Studio(社区版)。安装需要重新启动才能完成。有没有办法手动完成必要的步骤而无需重新启动服务器?
答案1
静默安装 Visual Studio 比想象的要困难得多。在 Win2008R2 上,您需要在运行 Visual Studio 安装程序之前单独安装 .Net 4.5。
在 2008R2 和 2012 上,您还需要自定义 AdminFile 来禁用许多可选内容,例如 SQL 和 Office 工具。Chocolatey 包使用的此 XML 应导致静默安装:https://github.com/mwrock/Chocolatey-Packages/blob/master/VisualStudio2012Ultimate/Tools/AdminDeployment.xml
<?xml version="1.0" encoding="utf-8"?>
<AdminDeploymentCustomizations xmlns="http://schemas.microsoft.com/wix/2011/AdminDeployment">
<BundleCustomizations TargetDir="default" NoWeb="yes"/>
<SelectableItemCustomizations>
<SelectableItemCustomization Id="WebTools" Hidden="no" Selected="no"/>
<SelectableItemCustomization Id="SQL" Hidden="no" Selected="no" />
<SelectableItemCustomization Id="OfficeTools" Hidden="no" Selected="no"/>
<SelectableItemCustomization Id="SharepointTools" Hidden="no" Selected="no"/>
<SelectableItemCustomization Id="LightSwitch" Hidden="no" Selected="no"/>
<SelectableItemCustomization Id="SilverLight_Developer_Kit" Hidden="no" Selected="no" />
<SelectableItemCustomization Id="VC_MFC_Libraries" Hidden="no" Selected="no" />
<SelectableItemCustomization Id="Blend" Hidden="no" Selected="no" />
<SelectableItemCustomization Id="BlissHidden" Selected="yes" />
<SelectableItemCustomization Id="HelpHidden" Selected="yes" />
<SelectableItemCustomization Id="IntelliTraceUltimateHidden" Selected="yes" />
<SelectableItemCustomization Id="LocalDBHidden" Selected="yes" />
<SelectableItemCustomization Id="NetFX4Hidden" Selected="yes" />
<SelectableItemCustomization Id="NetFX45Hidden" Selected="yes" />
<SelectableItemCustomization Id="PortableDTPHidden" Selected="yes" />
<SelectableItemCustomization Id="PreEmptiveDotfuscatorHidden" Selected="no" />
<SelectableItemCustomization Id="PreEmptiveAnalyticsHidden" Selected="no" />
<SelectableItemCustomization Id="ProfilerHidden" Selected="yes" />
<SelectableItemCustomization Id="ReportingHidden" Selected="yes" />
<SelectableItemCustomization Id="RIAHidden" Selected="yes" />
<SelectableItemCustomization Id="SDKTools3Hidden" Selected="yes" />
<SelectableItemCustomization Id="SDKTools4Hidden" Selected="yes" />
<SelectableItemCustomization Id="Silverlight5DRTHidden" Selected="yes" />
<SelectableItemCustomization Id="SQLCEHidden" Selected="yes" />
<SelectableItemCustomization Id="SQLCEToolsHidden" Selected="no" />
<SelectableItemCustomization Id="SQLCLRTypesHidden" Selected="yes" />
<SelectableItemCustomization Id="SQLDACHidden" Selected="yes" />
<SelectableItemCustomization Id="SQLDbProviderHidden" Selected="yes" />
<SelectableItemCustomization Id="SQLSharedManagementObjectsHidden" Selected="yes" />
<SelectableItemCustomization Id="StoryboardingHidden" Selected="no" />
<SelectableItemCustomization Id="TSQLHidden" Selected="yes" />
<SelectableItemCustomization Id="VCCompilerHidden" Selected="yes" />
<SelectableItemCustomization Id="VCCoreHidden" Selected="yes" />
<SelectableItemCustomization Id="VCDebugHidden" Selected="yes" />
<SelectableItemCustomization Id="VCDesigntimeHidden" Selected="yes" />
<SelectableItemCustomization Id="VCExtendedHidden" Selected="yes" />
<SelectableItemCustomization Id="WCFDataServicesHidden" Selected="yes" />
<SelectableItemCustomization Id="WinJSHidden" Selected="yes" />
<SelectableItemCustomization Id="WinSDKHidden" Selected="yes" />
</SelectableItemCustomizations>
</AdminDeploymentCustomizations>
最后,您需要在命令中添加 /quiet 和 /norestart:
vs_professional.exe /adminfile \\FQDN\Share\AdminDeployment.xml /quiet /norestart
如果您刚刚运行安装程序,我认为您无法避免重新启动。
https://msdn.microsoft.com/en-us/library/vstudio/ee225237(v=vs.110).aspx