登录机器前在新虚拟机上静默安装 Visual Studio 2015

Silent Install Visual Studio 2015 on new VM before logging into machine

我在尝试在虚拟机上安装 Visual Studio 2015 时遇到问题。在克隆虚拟机后不久,将自动配置 VM 并将安装 运行 作为脚本的一部分。

我的问题是,当我开始安装时,我认为我没有加载用户配置文件作为 运行 安装的用户。该用户已添加到本地管理员组,因此访问不成问题。

安装完成,但需要大约 4 小时。这是因为它在尝试将日志写入用户临时目录(不存在)时挂起。我将日志记录设置到机器上确实存在的文件夹,并且 99% 的日志都在那里,但是当 运行 设置最终终结器、modernblend 终结器和 vsgraphics vsga 终结器时,它会将日志写入temp 目录,我无法控制这个(我能找到)。这是这些日志的摘录

MSI (s) (74:78) [15:29:37:694]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI5EB8.tmp, Entrypoint: LogCustomAction
MSI (s) (74:74) [15:29:37:694]: Generating random cookie.
MSI (s) (74:74) [15:29:37:694]: Created Custom Action Server with PID 5240 (0x1478).
MSI (s) (74:A4) [15:29:37:709]: Running as a service.
MSI (s) (74:A4) [15:29:37:709]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
05/18/17 15:29:37 DDSet_Status: LANGID: 1033
05/18/17 15:29:37 DDSet_Entry: AppID Logged Custom Action started
05/18/17 15:29:37 DDSet_Status: CustomActionData: E:\Applications\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe;/setup /AllowDuringSetup 
05/18/17 15:29:37 DDSet_Status: Appid Custom Action will log to C:\Users\USJECE2\AppData\Local\Temp\VS1.tmp
05/18/17 15:29:37 DDSet_Status: Launching "E:\Applications\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /setup /AllowDuringSetup  /log "C:\Users\USJECE2\AppData\Local\Temp\VS1.tmp"
MSI (s) (74:88) [16:21:07:403]: Running as a service.
MSI (s) (74:88) [16:21:08:179]: Running as a service.
MSI (s) (74:AC) [16:21:30:551]: Running as a service.
05/18/17 15:29:37 DDSet_Entry: Starting process, will wait for up to 60 minutes to complete...
05/18/17 16:29:37 DDSet_Warning: Unable to open logfile
05/18/17 16:29:37 DDSet_Error: Timeout while waiting on process handle
05/18/17 16:29:37 DDSet_CARetVal: CA_E1B8E5023B1F
MSI (s) (74!60) [16:29:37:722]: Closing MSIHANDLE (92326) of type 790531 for thread 864
05/18/17 16:29:37 DDSet_Exit: AppID Logged Custom Action completed
MSI (s) (74:78) [16:29:37:722]: Closing MSIHANDLE (92325) of type 790536 for thread 5208

这是我在启动进程时运行正在使用的命令行

E:\temp\VisualStudio\vs2015_installer\vs2015_installer.exe /adminfile E:\temp\VisualStudio\vs2015_installer\AdminDeployment.xml /quiet /norestart /Log "E:\logs\VS2015.log"

这里是管理文件的捆绑定制部分

<BundleCustomizations TargetDir="E:\Applications\Microsoft Visual Studio 14.0" NoCacheOnlyMode="default" NoWeb="default" NoRefresh="default" SuppressRefreshPrompt="default" Feed="default" />

如果我登录机器然后注销并 运行 脚本,这不是问题,但是,这些机器是自动配置的,在成功构建机器之前没有用户交互,包括静默安装。

谢谢!

我终于想通了。即使这可以帮助世界上的一个人,我也会很高兴。我离开了这个,刚刚安装了 VS 2017。我被要求再做一次,所以我走了一条不同的路。我碰巧安装成功了2015,但那是运气。

要安装它,我需要安装 ASP.NET 4.0。确保你不安装 3.0,因为它会失败,即使你也安装 4.0。我希望这可以让其他人免于数小时的故障排除。