维修手册是个好东西

读了一遍汽车的维修手册(给 4S店修车用的那种,不是给用户的)。维修保养步骤写得非常详细,也非常务实。

空气滤清器:保养流程是用压缩空气吹一下,实在太脏了再换。

雨刷:换胶条,不用换整个雨刷。

音频U盾通信失败问题

2015年左右办了工行的网上银行,彼时流行的是二代盾,有一个 USB 接口用来和 PC 通信,另有一个 3.5mm 音频接口,用来与手机通信。(当然现在手机也不配 3.5mm 接口,U盾也升级到了蓝牙U盾)

最近需要更新 U盾证书,为了方便就在手机银行上操作,结果出现通信失败。上网查询,需要把音质音效设置里的“杜比全景声”功能关闭,果然好了。

杜比全景声是音频后处理技术,对音频信号进行了二次变换。而 U盾使用高频音频信号通讯,如果开启后处理技术(包括杜比、DTS、小米、华为等厂家的后处理技术),会导致音频信号失真,信号传到 U盾上再解调,就会出现通讯错误。

错误的API依赖

曾经把系统语言设成英文,AutoCAD、Office 等软件均能很好的适应。但发现打开某些包含天正元素的图纸时,中文显示不正常。系统语言切换回中文就正常了。准确地说是区域和语言选项里把区域格式设为中文就正常了。

看来天正开发人员使用了错误的 API,以区域格式来判断系统当前语言。真无理。

想起微软不再更新 cmd.exe,连 cmd 窗口里的版本字符串也不改动。就是因为有大量的非正常依赖,要读取这些字符串来判断当前环境。真是被动。

解决OFFICE临时文件导致的OneDrive同步状态问题

在 OneDrive 使用过程中,经常会发现某些文件夹的状态一直是“正在同步”,但一直未见完成。状态栏上的 OneDrive 图标却是显示“已同步”。

图一:还有文件夹未同步完成
图二:状态栏图标显示已经同步完成

经查,发现是文件夹内一般有无法同步的临时文件导致的。一般是由于 Word、Excel、PowerPoint 未正常关闭,在文件夹内留下了隐藏属性的临时文件(一般以 ~$ 开头)。取消隐藏属性,删除文件后,问题解决。

解决vs_installershell.exe has an invalid certificate问题

问题描述:打开Visual Studio Installer出现了错误:vs_installershell.exe has an invalid certificate,程序终止,无法启动visual studio installer.

问题分析:检查vs_installer.exe的数字签名,发现SHA1签署的签名无效。点击证书详情,发现是Microsoft Root Certificate Authority被吊销,导致数字签名验证失败,所以无法启动VS Installer。但在证书管理器里检查这个证书没有问题。

Work around:手动启动vs_installershell.exe(注意要以管理员模式启动),仍然能打开VS Installer并执行VS更新。

解决方法:

  1. 导出Microsoft Root Certificate Authority这个根证书到文件备份。
  2. 在组策略中取消证书自动更新。gpedit.msc -> 计算机配置 -> 管理模板 -> 系统 -> Internet通信管理 -> Internet通信设置 -> 关闭自动根证书更新 -> 已启用
  3. 在证书管理器中删除Microsoft Root Certificate Authority这个根证书,注意计算机账户和用户账户里的证书都要删掉。(方法是运行mmc.exe然后选择添加管理单元,选择证书后再选择本地计算机账户)
  4. 导入刚才备份的根证书到系统中。
  5. 在文件属性中查看vs_installershell.exe的数字签名,此时应该签名正常。
  6. 打开组策略中的证书自动更新。(参考第2步,最后选择已停用或未配置即可)

原因:出现问题之前自己手动删除了系统里所有的根证书。猜想是这个原因导致系统的证书验证出现异常。而Microsoft Root Certificate Authority这个证书是Windows系统需要的,如果出现问题会导致系统组件工作不正常。所以通过停用自动更新的方式,手动刷新了这个根证书的状态,系统恢复正常。


English Version:

Error description: An error occurred while opening Visual Studio Installer: “vs_installershell.exe has an invalid certificate”. The program terminates afterwards.

Problem analysis: Manually check the digital signature via Properties window, the SHA1 signature is invalid. By clicking “View certificate”, it says that the “Microsoft Root Certificate Authority” CA certificate is revoked, the signature is invalid. The VS installer cannot be started because the digital signature validation failed.

Work around: Manually start vs_installershell.exe from File Explorer. By default it’s located in C:\Program Files(x86)\Microsoft Visual Studio\Installer\. Note that you should run as administrator.

Solution:

  1. Export the CA certificate “Microsoft Root Certificate Authority” to file.
  2. Disable Automatic Root Certificate Update in Group policy. Run gpedit.msc -> Computer config -> Administrative Templates -> System -> Internet Communication Management -> Internet Communication Settings -> Turn off Automatic Root Certificates Update -> Enabled.
  3. Open local computer certificate manager. (Steps here) Delete the “Microsoft Root Certificate Authority” CA certificate from trusted root certification authorities.
  4. Import the certificate from file (just exported in step 1).
  5. Check the digital signature of vs_installershell.exe from File Properties again. Now the signature should be valid.
  6. Turn on Automatic Root Certificates Update. (Refer to the operation in step 2)

Root cause: Before the error occurs, I just deleted all the certificate from system. But “Microsoft Root Certificate Authority” is required for Windows. If deleted, the system might encounter unknown issue. Turn off and turn on the Automatic Certificate Update and re-import the certificate would reset internal system state, which solve the problem.