VS2015U1 的使用问题基本上解决了

上次的尝试结果继续。这都是昨天到今天的事了。

打开错误日志,经过一番过滤,大概找到了关键问题的发生处。

[2EC0:1C2C][2015-12-11T02:27:39]i000: SI:  Processing product entry: 'PowerShellToolsV1'.
[2EC0:1C2C][2015-12-11T02:27:39]i000: SI:  Downloading file: 'http://go.microsoft.com/fwlink/?LinkID=616995'
[2EC0:1C2C][2015-12-11T02:27:55]i000: SI:  Downloaded file: 'http://go.microsoft.com/fwlink/?LinkID=616995' to location 'D:\Downloads\VS2015\OfflineCache\installers\PowerShellToolsV1\en\1\PowerShellTools.14.0.vsix'
[2EC0:1C2C][2015-12-11T02:28:10]i000: SI:  Certificate not valid for file:D:\Downloads\VS2015\OfflineCache\installers\PowerShellToolsV1\en\1\PowerShellTools.14.0.vsix
[2EC0:1C2C][2015-12-11T02:28:10]e000: SI:  System.ApplicationException: Downloaded file failed signature verification and may have been tampered with
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.ThrowOnDownloadFailedTrustVerification(String downloadedPath)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.Execute(OfflineCacheSnapshot snapshot, String offlineFeedPath, ProductEntry entry, XmlNamespaceManager namespaceManager, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.Tasks.OfflineTaskManager.AddProduct(OfflineCacheSnapshot snapshot, String onlineFeedPath, String offlineFeedPath, String productId, ILogger logger, Func`1 checkIfUserCanceled)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.OfflineCacheManager.SyncProducts(UpdateMode updateMode, ICollection`1 productIds, String parent, String callerBaseDirectory, Func`1 checkIfUserCanceled)
[2EC0:1C2C][2015-12-11T02:28:10]i000: SI:  Processing product entry: 'Win10_VSTools_14.0.24720'.
[2EC0:1C2C][2015-12-11T02:28:10]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\en\0\Windows_VSTools.exe'
[2EC0:1C2C][2015-12-11T02:28:10]i000: SI:  Starting burn layout for product 'Win10_VSTools_14.0.24720'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\en\0\Windows_VSTools.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\en\0"'
[2EC0:1C2C][2015-12-11T02:30:42]i000: SI:  Burn layout exit code for product 'Win10_VSTools_14.0.24720' is '0'
[2EC0:1C2C][2015-12-11T02:30:42]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\zh-CHS\0\Windows_VSTools.exe'
[2EC0:1C2C][2015-12-11T02:30:42]i000: SI:  Starting burn layout for product 'Win10_VSTools_14.0.24720'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\zh-CHS\0\Windows_VSTools.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_VSTools_14.0.24720\zh-CHS\0"'
[2EC0:1C2C][2015-12-11T02:34:17]i000: SI:  Burn layout exit code for product 'Win10_VSTools_14.0.24720' is '0'
[2EC0:1C2C][2015-12-11T02:34:17]i000: SI:  Processing product entry: 'Win10SDK_10.0.10586.15'.
[2EC0:1C2C][2015-12-11T02:34:17]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_10.0.10586.15\en\0\sdksetup.exe'
[2EC0:1C2C][2015-12-11T02:34:17]i000: SI:  Starting burn layout for product 'Win10SDK_10.0.10586.15'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_10.0.10586.15\en\0\sdksetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_10.0.10586.15\en\0"'
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Burn layout exit code for product 'Win10SDK_10.0.10586.15' is '-2146889721'
[2EC0:1C2C][2015-12-11T02:34:20]e000: SI:  System.ApplicationException: Burn layout for 'Win10SDK_10.0.10586.15' failed with exit code '-2146889721'.
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.ExecuteBurnLayout(String productId, String installer, String layoutDirectory, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.Execute(OfflineCacheSnapshot snapshot, String offlineFeedPath, ProductEntry entry, XmlNamespaceManager namespaceManager, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.Tasks.OfflineTaskManager.AddProduct(OfflineCacheSnapshot snapshot, String onlineFeedPath, String offlineFeedPath, String productId, ILogger logger, Func`1 checkIfUserCanceled)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.OfflineCacheManager.SyncProducts(UpdateMode updateMode, ICollection`1 productIds, String parent, String callerBaseDirectory, Func`1 checkIfUserCanceled)
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Processing product entry: 'AppInsightsToolsVisualStudio_HiddenV2_4.0.51117.1'.
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\AppInsightsToolsVisualStudio_HiddenV2_4.0.51117.1\en\0\AppInsights_VisualStudio.msi'
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Processing product entry: 'Win10_Emulator_10.0.10240'.
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10240\en\0\EmulatorSetup.exe'
[2EC0:1C2C][2015-12-11T02:34:20]i000: SI:  Starting burn layout for product 'Win10_Emulator_10.0.10240'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10240\en\0\EmulatorSetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10240\en\0"'
[2EC0:1C2C][2015-12-11T02:35:07]i000: SI:  Burn layout exit code for product 'Win10_Emulator_10.0.10240' is '-2146889721'
[2EC0:1C2C][2015-12-11T02:35:07]e000: SI:  System.ApplicationException: Burn layout for 'Win10_Emulator_10.0.10240' failed with exit code '-2146889721'.
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.ExecuteBurnLayout(String productId, String installer, String layoutDirectory, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.Execute(OfflineCacheSnapshot snapshot, String offlineFeedPath, ProductEntry entry, XmlNamespaceManager namespaceManager, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.Tasks.OfflineTaskManager.AddProduct(OfflineCacheSnapshot snapshot, String onlineFeedPath, String offlineFeedPath, String productId, ILogger logger, Func`1 checkIfUserCanceled)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.OfflineCacheManager.SyncProducts(UpdateMode updateMode, ICollection`1 productIds, String parent, String callerBaseDirectory, Func`1 checkIfUserCanceled)
[2EC0:1C2C][2015-12-11T02:35:07]i000: SI:  Processing product entry: 'Win10_Emulator_10.0.10586.11'.
[2EC0:1C2C][2015-12-11T02:35:07]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10586.11\en\0\EmulatorSetup.exe'
[2EC0:1C2C][2015-12-11T02:35:07]i000: SI:  Starting burn layout for product 'Win10_Emulator_10.0.10586.11'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10586.11\en\0\EmulatorSetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10586.11\en\0"'
[2EC0:1C2C][2015-12-11T02:35:10]i000: SI:  Burn layout exit code for product 'Win10_Emulator_10.0.10586.11' is '-2146889721'
[2EC0:1C2C][2015-12-11T02:35:10]e000: SI:  System.ApplicationException: Burn layout for 'Win10_Emulator_10.0.10586.11' failed with exit code '-2146889721'.
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.ExecuteBurnLayout(String productId, String installer, String layoutDirectory, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.Execute(OfflineCacheSnapshot snapshot, String offlineFeedPath, ProductEntry entry, XmlNamespaceManager namespaceManager, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.Tasks.OfflineTaskManager.AddProduct(OfflineCacheSnapshot snapshot, String onlineFeedPath, String offlineFeedPath, String productId, ILogger logger, Func`1 checkIfUserCanceled)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.OfflineCacheManager.SyncProducts(UpdateMode updateMode, ICollection`1 productIds, String parent, String callerBaseDirectory, Func`1 checkIfUserCanceled)
[2EC0:1C2C][2015-12-11T02:35:10]i000: SI:  Processing product entry: 'Win10SDK_Hidden_10.0.10240'.
[2EC0:1C2C][2015-12-11T02:35:10]i000: SI:  Using existing file: 'D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_Hidden_10.0.10240\en\0\sdksetup.exe'
[2EC0:1C2C][2015-12-11T02:35:10]i000: SI:  Starting burn layout for product 'Win10SDK_Hidden_10.0.10240'. Command line: 'D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_Hidden_10.0.10240\en\0\sdksetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_Hidden_10.0.10240\en\0"'
[2EC0:1C2C][2015-12-11T02:35:13]i000: SI:  Burn layout exit code for product 'Win10SDK_Hidden_10.0.10240' is '-2146889721'
[2EC0:1C2C][2015-12-11T02:35:13]e000: SI:  System.ApplicationException: Burn layout for 'Win10SDK_Hidden_10.0.10240' failed with exit code '-2146889721'.
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.ExecuteBurnLayout(String productId, String installer, String layoutDirectory, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.InstallerProductTask.Execute(OfflineCacheSnapshot snapshot, String offlineFeedPath, ProductEntry entry, XmlNamespaceManager namespaceManager, ILogger logger)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.Tasks.OfflineTaskManager.AddProduct(OfflineCacheSnapshot snapshot, String onlineFeedPath, String offlineFeedPath, String productId, ILogger logger, Func`1 checkIfUserCanceled)
   在 Microsoft.Web.PlatformInstaller.CommandLine.Offline.OfflineCacheManager.SyncProducts(UpdateMode updateMode, ICollection`1 productIds, String parent, String callerBaseDirectory, Func`1 checkIfUserCanceled)

所以什么东西缺失了就很清楚了。简单写了一个小程序。

private static void work(String listFileName) throws IOException {
    ArrayList<String> commands = new ArrayList<>();
    BufferedReader reader = new BufferedReader(new FileReader(listFileName));
    String command = null;
    int currentIndex = 0;
    int commandCount;

    while ((command = reader.readLine()) != null) {
        if (command.length() > 0) {
            commands.add(command);
        }
    }
    reader.close();
    if (commands.isEmpty()) {
        return;
    }
    commandCount = commands.size();

    @NotNull Process process;
    while (currentIndex < commandCount) {
        try {
            command = commands.get(currentIndex);
            log(command, currentIndex + 1, commandCount);
            process = Runtime.getRuntime().exec(command);
            process.waitFor();
            log(process.exitValue());
            process.destroy();
            if (process.exitValue() == 0) {
                currentIndex++;
            }
        } catch (IOException | InterruptedException ex) {
            ex.printStackTrace();
        }
    }

    out.println("Completed: " + Integer.toString(commandCount) + " tasks.");
}

轰炸式运行下面的命令行:

D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_10.0.10586.15\en\0\sdksetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_10.0.10586.15\en\0"
D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10240\en\0\EmulatorSetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10240\en\0"
D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10586.11\en\0\EmulatorSetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10_Emulator_10.0.10586.11\en\0"
D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_Hidden_10.0.10240\en\0\sdksetup.exe /quiet /layout "D:\Downloads\VS2015\OfflineCache\installers\Win10SDK_Hidden_10.0.10240\en\0"

经过8个小时(凌晨四点到中午十二点),花费了大量的流量,终于搞定了。Python 那个,没有一个校验的命令行,所以无法自动做。

关于为什么这么频繁地失败,我做了一下抓包。发起请求(向 download.microsoft.com)下载一个包的时候,URI 是正常的,同时我 nslookup 了一下,解析也是正常的,但是最后总会302跳转到一个 10.254.*.*(内网)的地址上,发回无效的内容,于是校验就失败了。不知道是什么人污染了。

可以注意到,这是 offline cache,在VS的ISO中是不带的。(也就是说,自身不带 Windows SDK!)

看到4个任务都完成,运行 vs_community.exe,可视化安装。但是还是和以前一样,报告 UWP CRT 安装失败,像这种。回到 OfflineCache 一看,经过installer对可选项的burn操作,内容又缺失了。无奈只好重新来,这次主攻两个10586。

傍晚完成,手工切到SDK目录,用自带的 sdksetup.exe 可视化安装,正常。再次打开 vs_community,安装好的东西被识别为 UWP 和工具版本1.2。

运行VS,还是报 ResourceManagerPackage 包加载错误。按照网上的一些解决方案(123)全都失败了。同时还搭上了 Azure,和方案1中的报错差不多。

卸载,从零开始。碰上了 LocalESPCui 卡死,幸好有前人将解决过程放在了网上

按照上面的修复后继续运行默认安装器,安装自动继续。完成后我再让其进行完整修复重启,终于能运行了。然后导入原有的设置。有小小的问题,虽然版本号对了,但是有界面元素还是RTM而不是U1的,看得出。

然后试验了一下工程模板,UWP处于需要安装状态,就让它自动安装,去睡觉了(三点)。

现在正常了,图标(笑脸->用户图标)也正常了。

不过 TypeScript 支持损坏了,原因是无法加载 Microsoft.Web.Editor 程序集。安装了一个Java 语言支持插件也有程序集的问题。不过幸好语言选择除了 C# 和 VB.NET 之外的我都是用着 JetBrains 的产品,不怎么受影响(也许如果写 ASP.NET 可能会有?)。

还没有试验 C# 的工程;不过下午受人所托编译了一下原来的一个mod,C++用的是12.0(2013)的工具链,工作正常。

先到这里吧。

分享到 评论