VS 2017 安装失败 [英] VS 2017 Installation failed

查看:17
本文介绍了VS 2017 安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 上安装了 VS2017.一段时间后我收到错误:

MSI:C:ProgramDataMicrosoftVisualStudioPackagesMicrosoft.VisualStudio.MinShell.Msi,version=15.6.27421.1Microsoft.VisualStudio.MinShell.Msi.msi,属性:REBOOT=ReallySuppress ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL="7" VSEXTUI="1" VS7.3643236F_FC70_11D3_A536_0090278A1BB8="G:Program Files (x86)Microsoft Visual Studio2017Community"返回码:1632返回代码详细信息:Temp 文件夹位于已满或无法访问的驱动器上.释放驱动器上的空间或验证您对 Temp 文件夹具有写入权限.日志G:TEMPdd_setup_20180318121545_006_Microsoft.VisualStudio.MinShell.Msi.log

我已经检查了 TEMP 所在的 G:.它有 200 GB 的免费空间.但是一件奇怪的事情:这个文件夹和所有其他文件夹都是只读的.我在属性中取消选中它,然后关闭属性对话框,再次打开它:它是只读的.我可以修改它,即使是 MSI 安装程序也可以:它在那里创建了日志文件.但是在安装过程中出现错误.它是什么以及我如何解决这个问题?

我用日志运行:

机器策略值 'DisableUserInstalls' 为 0此事务已跳过 SRSetRestorePoint.注意:1:1336 2:3 3:C:WindowsInstallerMainEngineThread 返回 1632此安装没有系统还原序列号.用户策略值DisableRollback"为 0机器策略值DisableRollback"为 0递增计数器以禁用关机.递增后的计数器:0注意:1:1402 2:HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerRollbackScripts 3:2注意:1:1402 2:HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerInProgress 3:2递减计数器以禁用关机.如果 counter >= 0,则关闭将被拒绝.递减后的计数器:-1恢复环境变量递减计数器以禁用关机.如果 counter >= 0,则关闭将被拒绝.递减后的计数器:-1MainEngineThread 返回 1632

解决方案

磁盘空间回收 - 快速获胜?:阅读太多?

<块引用>

可以将此驱动器与

  • 第三方清理应用程序:CCleaner 等第三方工具可能能够通过擦除来清理更多空间各种应用程序和工具的缓存文件和临时文件.这个特殊的工具最近遭受了恶意软件攻击.使用风险自负.

    • 个人意见/建议:仅用于测试盒或非关键机器.清理非常棒,但它也涉及一些风险(丢失登录密码,丢失系统日志等......).不言而喻,但可能应该提及.
    • 我的 2 美分:不是企业解决方案,但对于喜欢试验和保持机器调整的高级家庭用户来说可能没问题.
  • 管理安装:对于大型 MSI 文件,执行管理安装将阻止在 C:Windows 中缓存整个 MSI 文件安装程序.您必须从适当的网络共享安装,以便文件可用于修复操作.

  • 安装的驱动器:有些人涉足将外部驱动器作为文件夹安装到系统驱动器上.换句话说,另一个驱动器在您的系统驱动器上显示为常规文件夹,并具有这样的功能(sample).

    • 我没有这方面的经验,而且随着时间的推移,我怀疑它的可靠性.据我所知,如果你做得对(并且永远不要取出物理驱动器),它实际上可能比其他几个选项更好.
    • 我只会数据文件夹(不是设置文件夹或核心操作系统文件夹,如桌面).也许用于源代码管理文件夹.如果链接中断,数据应该仍然是安全的,系统仍然可以启动(并重新建立链接).
    • 更新:Windows 资源管理器的包含在库中"(看看)我喜欢创建一个源代码库";随处包含文件夹.
  • Visual Studio:以及明显的 Visual Studio 清理选项(为了完整性):

    • 如果您已在本地下载 MSDN 帮助(Help => 添加和删除帮助内容,请根据需要删除项目并改用在线帮助或更改 本地存储路径到底部以使用另一个驱动器存储内容).
    • 或者您有几个不需要的 SDK 版本,或者您有不需要的 Visual Studio 功能,去掉它们(在 Visual Studio 中:Tools => Get Tools and Features... - 去掉不必要的功能 - 我经常使用 Individual Components 视图).
  • 下载文件夹:我相信我已经忘记了许多可行的选择来获得更多的工作空间而不会破坏你的盒子.一种方法是清理您的 Downloads 文件夹 并将所有安装程序移动到网络位置 - 对于某些人来说,这可能是最大的节省.

    • 这也适用于笔记本电脑 - 这几乎是我为磁盘空间很小的笔记本电脑做的第一件事.如果您无法访问安装程序的网络共享 - 例如在旅行中 - 那么只需使用拇指驱动器或外部硬盘驱动器来保存您的安装程序和 ISO 文件.
    • 对于有多个用户的计算机,显然会有多个下载文件夹,里面可能装满了东西.使用磁盘空间可视化工具查看(请参阅列表顶部的链接).
  • 页面文件:有些人将系统页面文件 (pagefile.sys) 从系统驱动器移动到另一个驱动器.在过去,这导致我无法启动系统,但现在情况可能好转了.不过,这不是我要做的第一件事 - 这是非常核心的操作系统内容.

    • 对于只有一个驱动器的笔记本电脑来说显然是不可能的(除非您擦除恢复分区并在其位置创建一个真实可见的分区).
    • 我觉得这个选项有风险,也许我应该把它放在不光彩的提及"中下面的部分.
    • 小心点.如果您遇到问题,也许上次已知的好"功能或系统还原可以帮助您?
  • 休眠文件:Windows 系统上的休眠文件将存在于系统驱动器上,我不知道有什么方法可以将它移动到其他任何地方 非常基本的技术原因.但是,您可以禁用休眠以清除整个文件.这将在现代计算机上释放几 GB 的空间.

    • 您显然无法将机器置于休眠状态(内存转储到磁盘),但睡眠模式(低功耗使用模式/待机)应该仍然可用.
    • 笔记本电脑可能更希望保持休眠模式(如果电池在旅途中耗尽,笔记本电脑将无法自动休眠,您可能会丢失数据).
  • 应用温度&缓存文件夹:上面提到的 CCleaner 可以清除各种应用程序的大量临时文件(虽然我并不真正推荐使用它 - 我使用 cleanmgr.exe 而不是 - 和 CCleaner 用于测试盒).

    • Web 浏览器(Firefox、Opera、Vivaldi、Chrome、IE、Edge、Safari 等)也可以通过大量缓存文件和下载的垃圾邮件向磁盘发送垃圾邮件.可以重定向所有这些文件夹,但我更喜欢将它们减小到某个可接受的最大大小.
    • 随着时间的推移,许多其他各种应用程序都会在系统上留下垃圾.其中一些可以使用上面提到的 CCleaner(或其他此类工具)进行清理.再次不是工具推荐.如果可用,请使用应用程序本身内部的清理功能.
    • 对于具有多个用户的计算机,显然会有多个缓存文件夹文件夹需要限制和清理.
  • 特殊数据密集型应用程序的存储文件夹:某些应用程序可能会在您的系统驱动器上(以及我的文档"之外)存储大量数据文件可以移动到其他驱动器.

    • 最大的嫌疑人可能是 Outlook(至少在旧版本中) - 或其他电子邮件软件(Thunderbird、Lotus Notes 等...).对于 Outlook,有一个 *.PST 文件存储所有电子邮件和附件,如果连接到 Exchange,则有一个类似的同步文件.这个文件可以相对容易地移动到不同的驱动器.有些人甚至只为他们的电子邮件使用网络界面,并消除了本地 PST 文件(适用于笔记本电脑).
    • 不过分,MS-SQL 数据库可能是另一种类型的海量数据文件,可以相对轻松地移动到不同的驱动器.
    • 这个列表可以做得很大,但增加更多的收益递减(网络服务器文件夹虚拟机图像、媒体/视频文件(如上所述)、虚拟化应用程序,等等...).
    • 对于具有多个用户的计算机,显然需要重定向多个存储位置.
  • 源代码管理工作文件夹 &存储库:对于开发人员来说,这是 100% 不言而喻的 - 并且几乎令人尴尬地列出,但我只想提到它.它也与上一点有关,但我将其添加为自己的要点.您将工作文件夹和源代码存储库(如果不同,如果是本地)移动到与系统驱动器不同的驱动器.例如GIT、Mercurial、Perforce、StarTeam 等...

  • 构建垃圾进程:除了将源代码管理文件夹移动到其他驱动器之外,某些进程还可能生成巨大的日志文件,从而意外地向系统发送垃圾邮件有时地点.我听说 MSBuild 倾向于热情地创建散布在系统中的日志文件我不确定普通的 Microsoft 清理工具是否检测到它们(例如上面提到的 cleanmgr.exe).并且您的源代码可能有很多可以删除的目标文件.

  • Visual Studio Code:愚蠢的选择,但适用于临时开发人员笔记本电脑出差的技术工作者,一个人可以潜在地依靠更小和多平台的 Visual Studio Code 而不是 Visual Studio 来进行小型开发测试/工作.显着较小的安装.个人笔记:整个工具有点奇怪:-).现在还有浏览器版本吗?

  • Windows 应用商店应用和应用每个用户安装:如果盒子上有多个用户,则可以多次安装多个应用商店应用,每个用户一次.如果需要,可以在这里进行一些清理.我想有些游戏可能会很大.在并行安装功能的时代,我们现在要为每个用户部署一切吗?奇怪.

  • 调整每个包的安装:几乎您安装的每个包都可以在安装过程中稍作修改,以减少向系统分区添加的文件.

    • 重定向应用程序安装文件夹:这是我个人不喜欢的一个选项,但它经常被使用.对于每个安装,您将安装文件夹重定向到与常规 ProgramFilesFolder 不同的驱动器和文件夹层次结构.这是在每个包的基础上完成的,并不是所有的包都支持这一点.通常你会去一个自定义"执行功能选择"的安装对话框(要安装哪些设置功能).
    • 省略可选功能:您安装的大多数软件包都具有可选组件,您可以省略这些组件,甚至在某些 MSI 软件包的情况下从源代码运行.某些开发人员工具通常可以进行相当多的调整,而不会产生太多副作用.大型游戏通常安装在非系统驱动器的普通非 SSD 硬盘上.
  • 卸载 Windows 组件:可以在 Windows 中添加/删除一些组件.单击旧式 添加/删除控制面板小程序中的打开或关闭 Windows 功能.您可以关闭/删除某些 .NET 版本、IE、IIS、Windows Media Player、消息队列服务器、打印到 PDF、PowerShell 和各种其他组件.可能不会从中获得太多好处(可能通过删除一些组件来获得一些安全优势 - 例如支持 SMB 1.0/CIFS 文件共享或 IIS).

  • 为系统驱动器启用压缩:您可以在整个系统驱动器上启用压缩 - 有一些性能损失 - 前提是文件系统是 NTFS.只需右键单击系统驱动器=>属性 =>压缩驱动器以节省磁盘空间.这可能需要相当长的时间(旧 HD、SSD 速度更快).您还可以压缩单个文件夹.我喜欢启用以彩色显示压缩或加密的 NTFS 文件"Windows 资源管理器中的选项.文件菜单=>选项 =>显示 =>以彩色显示压缩或加密的 NTFS 文件.

  • 卸载不需要的软件:上面第 2 项中提到的明显被遗忘的选项,您显然应该卸载任何不再需要的软件.常见的磁盘猪:游戏奇怪的SDKs开发工具安装用于测试,过期的试用版 用于各种软件等...要卸载:Windows 键 + R,键入 appwiz.cpl 并按 Enter.

  • 用户数据清理:对于某些已卸载的应用程序,%UserProfile%%AllUsersProfile%.清理和往常一样有风险,请谨慎使用,但这里可能有很多垃圾 - 有时是千兆字节.

    • 在进行此类清理时必须非常小心.首先压缩文件夹.只有大赢"- 为什么要挑剔微小的文本文件?如果您陷入这些文件夹中,实际收益会减少.使用磁盘空间可视化工具查看猪.
      • %AllUsersProfile% - 共享数据
      • %UserProfile%%UserProfile%AppData - 用户特定数据,记得为所有用户(如果有多个)清理.
  • 杂散包缓存:如上所述,MSI 包(和其他安装程序包)会进行大量缓存.卸载后很可能会留下很多这些包(至少在当天的 Installshield 缓存设置就是这种情况).

    • 最常见的缓存位置如下所述:(MSI) 包的缓存位置.清洁风险自负,显然 - 我重复一遍,我是认真的.一些千兆字节通常存储在这里.
    • 内联路径(只是一个选择,可以有很多其他的):
      • WiX:%ProgramData%Package Cache
      • Installshield:%SystemRoot%Downloaded Installations(旧的 IS 设置)和 %LocalAppData%Downloaded Installations(新的 IS 设置)
      • 高级安装程序:[AppDataFolder][|Manufacturer][|ProductName] [|ProductVersion]install
      • Visual Studio:%AllUsersProfile%MicrosoftVisualStudioPackages.请参阅下面评论中的重要提示(禁用缓存).
  • 包分发缓存文件夹:SCCM 和其他包分发系统的缓存文件夹变得非常大.例如 ccmcache.通常可以清理或重新配置这些文件夹以减少空间.

  • 毫无疑问还有很多其他的小技巧,但是请不要重定向系统文件夹!

    替代方法

    (Dis)-Honorable Mentions:以下是不是建议,而是一些替代方法.它们比上面的选项风险更高(应该足够好),最好是如果您正在设置新的笔记本电脑或重新安装它,并且想要摆脱讨厌的供应商恢复分区你可以没有.

    让我们坚定地陈述一个显而易见的事实:使用这些工具每年都会丢失大量数据.所以先喝咖啡或咖啡因.戴上眼镜.环视四周.调整任何马尾辫和胡须(女士也是).用第三人称自言自语.摆出明显疯狂的姿势并大喊我愿意!";真正致力于迫在眉睫的灾难!祝你好运!洞里着火!以火取胜".恶心.富巴.好的,已经足够了......我有过糟糕的经历 - 但没有发生过巨大的灾难(敲木头) - 使用所有这些工具.话不多说 - 小心,您的数据很重要.老婆的宝贝照片,你的未提交代码等...

    1. diskmgmt.mscdiskpart.exe (Windows):打开分区管理器 (diskmgmt.msc)并清除您可以不用的任何恢复分区或隐藏分区,然后扩展系统磁盘以填充整个物理磁盘或创建一个新的可见分区.
      • 恢复出厂设置不再可能(无论如何都可能过时).您需要安装介质才能重新安装(可下载?).
      • 小心你抹掉的东西!不可恢复.分区通常受到保护且不可触及.在许多情况下,它们也是不可移动和不可扩展的.
      • 也许可以创建一个新的可见分区来替换恢复分区并将数据文件和下载文件夹移到那里,以便在系统分区上腾出更多空间?
      • 如果分区受到保护,您可以使用 diskpart 删除它们相反,或查看 gparted 的下一个要点.使用 diskpart 很容易搞砸(命令行).
    2. gparted (Linux):您可能无法从 diskmgmt.msc(受保护分区)中删除恢复分区.如果您坚持并坚持,您可以启动到 Linux Live Disc/System(从例如,可移动媒体)并使用 gparted 删除.
      • 我这样做是为了摆脱过时和无用的恢复分区和/或恶意软件,而且效果很好.但坦率地说,我相信这个 gparted 应用程序,只要我能扔掉它.gparted 没有冒犯的意思,但是在 Windows 上玩得很好是具有挑战性的.显然,备份对于此类冒险活动至关重要且必不可少.
      • Though risky (a Linux tool is updating the partition tables where your Windows partitions are declared) this may work for laptops where there is nowhere to redirect data folders since there is only one physical disk and you want the full disk for your system partition.
      • I think gparted even allows you to try to resize existing partitions at this point. I have never tried it. Good luck if you try. "Fire in the hole!".
    3. Cloning: some use imaging tools or disk cloning features (hardware) to clone the old disk onto a bigger one. Backups essential obviously. Far from my comfort zone - just mentioning it. Not really relevant for this list (which was supposed to be about simple and effective measures to gain more disc space).
      • I believe there are features for this in gparted as well. Never tested.
      • Various hardware solutions. I gave them up years ago.
      • Why I am skeptical? Malware. Disk errors. Encryption. NTFS complexity? AD-problems (old & new drive in use post-clone)? Etc...
      • Several hard drive vendors seem to deliver proprietary solutions for this - these may be better tested than generic approaches?
    4. File System Allocation Size: the file system used and its allocation size affects available space. Never bothered to look much at this, but a lot of space can be wasted by allocation size issues: Would SSD drives benefit from a non-default allocation unit size?
      • Allocation size cannot be easily/safely changed for a disk in use. There may be tools that can do it, but the benefits areuncertain.
      • Modern Windows versions require NTFS as system partition file system. Other file systems such as FAT32 or exFAT have lower overhead (especially for smaller partitions - there will be more space available), and they are potentially faster but have more limitations. For FAT32 the biggest limitation is probably the 4GB max file size - not viable today.


    The rest of this answer (below) was written during debugging - I will leave it in. It contains generic and general-purpose debugging options.


    VC+ Runtimes

    As seen in the link towards the bottom, other people have seen the same deployment error. Before getting into too much debugging, let's try the simplest approach possible. Please try to install the VC++ runtimes for 2017 (and 2015 perhaps) from here:

    Potential General Fixes

    This seems to be the better discussion online for this problem. I would first try the suggestion to run this tool: Microsoft Install and Uninstall Troubleshooter.

    You can try this list of fixes as well. Crucially I would also try a reboot before trying again to release any potential locked files. Just to wipe the slate clean. The system's event log might have further information on the error seen (sometimes even beyond what is in an msiexec.exe log).

    ACLs

    What is the ACL (Access Control List) for your TEMP folder on that G: drive?

    UPDATE: Also make sure the hidden folder C:WindowsInstaller exists and have the correct permission settings. You need to show protected operating system files in Windows Explorer to see this folder.

    Verbose Logging

    Try to create a proper, verbose log for the MSI install in question (much more informative than the log you refer to). This gives you something to start with to figure out what is happening. You can find some information on how to do logging here.

    I would enable logging for all MSI installations for debugging purposes. See installsite.org on logging (section "Globally for all setups on a machine") for how to do this.

    I prefer this default logging switched on for dev and test boxes. Typically you suddenly see an MSI error and you wish you had a log - now you can, always ready in %tmp%.

    Quick Testing

    In your case, I would go to C:ProgramDataMicrosoftVisualStudioPackagesMicrosoft.VisualStudio.MinShell.Msi,version=15.6.27421.1 to see if the MSI package is present on disk, and then I would launch it with logging enabled:

    msiexec.exe/I "Microsoft.VisualStudio.MinShell.Msi.msi"/QN/L*V "C:msilog.log"

    Alternatively I would just double click the MSI file and see if I get a better, interactive error message. You will most likely need the verbose log to get any info.

    See link in comment below (concrete error).

    I install the VS2017 on Windows 7. After some time I receive the error:

    MSI: C:ProgramDataMicrosoftVisualStudioPackagesMicrosoft.VisualStudio.MinShell.Msi,version=15.6.27421.1Microsoft.VisualStudio.MinShell.Msi.msi, Properties:  REBOOT=ReallySuppress ARPSYSTEMCOMPONENT=1  MSIFASTINSTALL="7"  VSEXTUI="1"  VS7.3643236F_FC70_11D3_A536_0090278A1BB8="G:Program Files (x86)Microsoft Visual Studio2017Community" 
            Return code: 1632
            Return code details: The Temp folder is on a drive that is full or is inaccessible. Free up space on the drive or verify that you have write permission on the Temp folder.
        Log
            G:TEMPdd_setup_20180318121545_006_Microsoft.VisualStudio.MinShell.Msi.log
    

    I have checked the G: where the TEMP located. It has 200 GB free. BUT one strange thing: this folder and all other folders are Read-Only. I uncheck it in the Properties, then close Properties dialog, open it again: it is Read-Only. I can modify it, even MSI installer could: it created the log file there. But in the middle of installation the error occurs. What is it and how I can solve this problem?

    I run with log:

    Machine policy value 'DisableUserInstalls' is 0
    SRSetRestorePoint skipped for this transaction.
    Note: 1: 1336 2: 3 3: C:WindowsInstaller 
    MainEngineThread is returning 1632
    No System Restore sequence number for this installation.
    User policy value 'DisableRollback' is 0
    Machine policy value 'DisableRollback' is 0
    Incrementing counter to disable shutdown. Counter after increment: 0
    Note: 1: 1402 2: HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerRollbackScripts 3: 2 
    Note: 1: 1402 2: HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerInProgress 3: 2 
    Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    Restoring environment variables
    Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MainEngineThread is returning 1632
    

    解决方案

    Disc Space Reclaiming - Quick Wins?: Too much to read? The essential options (arguably).


    Final Summary

    This issue turned out to be a redirected TEMP and C:WindowsInstaller cache folder - with the latter being on an unavailable drive.

    Please be careful redirecting system folders, in particular C:WindowsInstaller. It is a super-hidden system folder and side-effects are very common.

    You must make sure that the relocated folder has the correct ACL permissions that the original folder had. This is crucially important for security reasons. For one thing the whole folder could be deleted by someone who do not understand what it is for - making all packages un-uninstallable and un-maintainable. There are also other security reasons.

    Also: putting this folder on the network is not technically sound in my opinion - problems will result. A local drive is also problematic if drive letters change. Which brings me to the next point:

    Lacking Space for your System SSD Drive?

    If your real issue is lacking disk space on your system SSD drive, please consider some alternatives listed below. Proceed with care and at your own risk with every option. Most of them should be harmless.

    Disc Space Visualizing: I have an ancient tool called SpaceMonger.exe which shows me a visual representation of whatever is taking up my disc space. Very useful. It seems this tool is no longer supported. Maybe check https://en.wikipedia.org/wiki/WinDirStat for a similar tool (untested by me - run it by virustotal.com).

    DriverStore: And a word to the resident hacker in all computer guys: no, no - don't try to redirect %SystemRoot%System32DriverStore (!). "Seductive The Dark Side Is". "Run Forrest, Run!". "Careful With That Axe Eugene". Etc... You get the picture. Leaving out Monty Python allusions for now. Seriously: I do not know what low-level stuff could be involved in the boot process. One would have to ask Raymond Chen, but don't. He has important things to do. However: pnputil.exe, DriverStore Explorer - your own risk. Don't do it :-).

    Overall Suggestions

    UPDATE: For laptops I like to use a high capacity, low-profile USB flash drive and / or a high capacity SD-card permanently sitting in a port to hold my downloads and installers, VS Help files, maybe even source code (riskier). An obvious, but somewhat "clunky" option.

    One can combine this drive with the Library feature in Windows Explorer to show the flash drive under whatever library you want (Downloads, Videos, Pictures, Source, etc...).

    My preferred desktop disc cleanup options below would be: 7, 19, 2, 18, 1, 6, 11, 12 (in that order).

    Preferred options for laptops: 7, 19, 2, 18, 6, 10 (reduce max cache sizes), 15, 17, 3 (in that order).

    The real-world approach for me is a slightly different order: 2 (purge obsolete Windows Updates - this may also trim WinSxS - but I am not positive), 19 (uninstall unneccessary software - can be relatively quick), then I run SpaceMonger.exe to find space hogs and move them - this often involves zapping the Downloads folder (7) and purging, moving or clouding media files (Pictures, Videos, Music), then 6 for developer PCs (jogging Visual Studio and uninstall useless SDKs and help files), and 9 (eliminate hibernation - not great for laptops), 18 (enable compression - can take forever), and finally I might zap the recovery partitions (laptops) and create a new partition in its place to allow data files to be stored there (freeing up system partition space). This zapping is a high-risk operation - obviously. Very error-prone (especially if inexperienced users use the diskpart command-line tool or a Linux Live Boot tool - described below). And obviously verify that you have installation media AND a valid license key before wiping out recovery partitions - it has to be mentioned. Data files I move are usually: source code repository, downloads folder, outlook PST file, images and videos, etc... This procedure should reclaim many gigabytes of disc space. Don't do it for fun though - though risk should be acceptable for most of these options (barring the recovery partition zapping - it is relatively simple to do, but error prone).

    Cleanup Options

    Apply healthy skepticism to these options. They are not all terribly useful in many cases - just attempting to mention all kinds of tweaks. Potential easy, big wins without much configuration and fiddling could be 2, 6, 7, 9, 18. Options 2 and 18 are almost always time consuming, but very effective. Maybe hours for option 2 (especially on Windows 7 & 8 - do not abort when it is running) and even longer for option 18 on a large computer or a slow disk (but the operation can be cancelled).

    Option 0, Cloud Storage is an implied overall option in this day and age. OneDrive Filer, GDisk, Dropbox, etc... Download data files on demand.

    1. My Documents: It is generally much better to move user data folders to a network location or another, local drive (best) than to redirect system folders! Few system-entanglements.

      • I wouldn't move the desktop or other folders found here: HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders, I would move "My Documents". Just right-click it in Windows Explorer, go to properties and there is a tab there with features to help you move it. Careful whilst doing this - a backup is in order first.
      • Pictures and Video might also be OK to move, but not the desktop or the other special folders - they may be involved in the boot or logon process (erroneous packages could cause that even for My Documents - nothing is without risk).
      • Streaming and media files from apps such as iTunes or similar can obviously totally hog a disc with limited capacity. I use SpaceMonger.exe to get an overview and then move the files somewhere else.
      • For computers with multiple users there will obviously be multiple "My Documents" folders to redirect.
    2. Microsoft's Disk Cleanup Tool: Run cleanmgr.exe, select Clean up system files as described here: https://serverfault.com/q/573208/20599 (top).

      • UPDATE Oct.2018: "Downloads" folder is now a cleanup option! DO NOT ENABLE! It deletes the whole downloads folder without question. This issue appears corrected by now Oct.2021.

      • You can now zap the uninstalls for applied Windows Updates - this can give you back several gigabytes on your system drive. In the picture below I can zap 5.36 GB. For Windows 7 I have seen dozens of gigabytes being purgeable.

      • This tool might also slim down and shrink the WinSxS directory (the Win32 side-by-side assembly folder). I am not 100% positive.

      • Obviously you can remove unnecessary packages in Add / Remove Programs and remove system restore point (use the second tab in the image below to access these features):

    3. Third Party Cleanup Applications: Third party tools such as CCleaner may be able to clean out even more space by wiping out cache files and temporary files for all kinds of applications and tools. This particular tool suffered a malware attack recently. Use at your own risk.

      • Personal opinion / suggestion: use only for test boxes or non-critical machines. The cleanup is quite awesome, but it also involves some risks (lost login passwords, lost system logs, etc...). Self-evident, but it should probably be mentioned.
      • My 2 cents: not a corporate solution, but may be fine for advanced home users who like to experiment and to keep their machines tuned.
    4. Administrative Installations: For large MSI files, performing an administrative install will prevent the caching of the whole MSI file in C:WindowsInstaller. You must install from a proper network share so files are available for repair operations.

    5. Mounted Drives: Some guys dabble with mounting external drives as folders on their system drive. In other words another drive shows up as a regular folder on your system drive and functions as such (sample).

      • This I have no experience with, and I have doubts about its reliability over time. For all I know it might actually be better than several other options if you do it right (and never take out the physical drive).
      • I would do data file folders only (not settings folders, or core OS folders such as the desktop). Maybe for source control folders. If the link breaks, the data should still be safe and the system can still boot (and the link re-established).
      • UPDATE: Windows Explorer's "Include in library" is an alternative? (do have a peek) I like to create a "Source Code Library" with included folders from here and there.
    6. Visual Studio: And the obvious cleanup options for Visual Studio (for completeness):

      • If you have downloaded MSDN help locally (Help => Add and Remove Help Content, remove items as appropriate and rely on online help instead or change the Local store path towards the bottom to use another drive for content).
      • Or you have several versions of the SDKs you do not need or you have Visual Studio features you do not need, get rid of them (In Visual Studio: Tools => Get Tools and Features... - get rid of unnecessary features - I often use the Individual Components view).
    7. Downloads Folder: I am sure I have forgotten many viable options to get some more workspace without wrecking your box. One would be to clean out your Downloads folder and move all installers to a network location - this might be the biggest save of all for some people.

      • This also works great for laptops - it is just about the first thing I would do for a laptop with little disc space. If you will not have access to your network share of installers - for example whilst traveling - then just use a thumb drive or external hard drive to hold your installers and ISO files.
      • For computers with multiple users there will obviously be multiple download folders potentially full of stuff. Use a disk space visualizer to see (see link on top of list).
    8. Page File: Some people move the system page file (pagefile.sys) from the system drive to another drive. Back in the day this caused me an unbootable system, but perhaps things are better now. Not the first thing I would do though - this is very core OS-stuff.

      • Obviously impossible for a laptop with only one drive (unless you erase the recovery partition and create a real, visible partition in its place).
      • I find this option risky, maybe I should have put it in the "dis-honerable mentions" part below.
      • Be careful. Maybe the "last-known good"-feature or system restore can help you if you get problems?
    9. Hibernation File: the hibernation file on Windows systems will live on the system drive, and I am not aware of any way to move it anywhere else for very fundamental technical reasons. However, you can disable hibernation to get rid of the whole file. This will free up a few gigabytes on a modern computer.

      • You obviously lose the ability to put your machine into hibernation (memory dumped to disk), but sleep mode (low-power use mode / standby) should still be available.
      • Hibernation mode may be more desirable to keep on for laptops (if battery runs out whilst traveling the laptop can not auto-hibernate and you could lose data).
    10. Application Temp & Cache Folders: The above mentioned CCleaner can wipe out a lot of temporary files for various applications (though I don't really recommend this for use - I use cleanmgr.exe instead - and CCleaner for test boxes).

      • Web Browsers (Firefox, Opera, Vivaldi, Chrome, IE, Edge, Safari, etc...) can also spam the disk with a lot of cache files and downloaded junk. It is possible to redirect all these folders, though I prefer to reduce them to a certain acceptable maximum size.
      • Plenty of other applications, of all kinds, leave trash on the system over time. Some of which can be cleaned with CCleaner mentioned above (or another such tool). Again not a tool recommendation. Use the cleanup features inside the application itself if available.
      • For computers with multiple users there will obviously be multiple cache folders folders to restrict and clean.
    11. Special Data-Heavy Applications' Storage Folders: Some applications can potentially store enormous data files on your system drive (and outside "My Documents") that can be moved to other drives.

      • The biggest suspect is probably Outlook (in older versions at least) - or other email software (Thunderbird, Lotus Notes, etc...). For Outlook there is a single *.PST file storing all email and attachments, or a similar sync file if connected to Exchange. This file can be moved to different drive with relative ease. Some even resort to using the Web-interface only for their email and eliminate the local PST file (good for laptops).
      • Without going overboard, MS-SQL databases could be another type of massive data file that could be moved to a different drive with relative ease.
      • And this list could be made very big, but diminishing returns to add any more (web server folders, virtual machine images, media / video files (mentioned above), virtualized applications maybe, etc...).
      • For computers with multiple users there will obviously be multiple storage locations to redirect.
    12. Source Control Working Folder & Repository: for a developer this is 100% self-evident - and almost embarrassing to list, but I just want to have it mentioned. It is also related to the previous point, but I add it as its own bullet point. You move both your working folder and your source code repository (if different, and if local) to a different drive than the system drive. For example GIT, Mercurial, Perforce, StarTeam, etc...

    13. Build Process Junk: Beyond moving source control folders to other drives, it is also possible that certain processes generate huge log files that spam the system in unexpected locations at times. I hear MSBuild tends to enthusiastically create log files sprinkled across the system and I am not sure if normal Microsoft cleanup tools detect them (for example cleanmgr.exe mentioned above). And your source code could have lots of object files you can zap.

    14. Visual Studio Code: silly option, but for ad-hoc developer laptops or traveling tech-workers, one could potentially rely on the smaller and multi-platform Visual Studio Code instead of Visual Studio to do small development testing / work. Significantly smaller install. Personal note: a bit odd the whole tool :-). Also browser version now?

    15. Windows Store Apps & Per User Installations: if there are multiple users on the box, several Store apps could be installed multiple times, once per user. Some cleanup could be done here if need be. I suppose some games could be quite big. And in the day and age of side-by-side installation features, we are now to deploy everything per-user? Odd.

    16. Tweak Each Package Installation: almost every package you install can be modified slightly during installation to add less files to the system partition.

      • Redirect Application Installation Folder: this is an option I personally dislike, but it is used a lot. For every installation you redirect the installation folder to a different drive and folder hierarchy than the regular ProgramFilesFolder. This is done on a per-package basis, and not all packages support this. Typically you go to a "Custom" installation dialog where you perform "feature selection" (what setup features to install).
      • Leave Out Optional Features: most packages you install will have optional components that you can leave out or even run-from-source in the case of some MSI packages. Certain developer tools can often be tweaked quite a bit without too many side-effects. Large games are often installed to a regular non-SSD hard drive which is not the system drive.
    17. Uninstall Windows Components: a few components can be added / removed from Windows. Click Turn Windows Features On or Off from the old-style Add / Remove Control Panel Applet. You can turn off / remove certain .NET versions, IE, IIS, Windows Media Player, Message Queue Server, Print to PDF, PowerShell and various other components. Maybe not that much to gain from this (some security benefits perhaps by removing some components - for example support for SMB 1.0 / CIFS file sharing or IIS).

    18. Enable Compression For System Drive: you can enable compression on the whole system drive - with some performance penalties - provided the file system is NTFS. Simply Right-click the system drive => Properties => Compress drive to save disc space. This can take quite some time (old HD, SSDs are faster). You can also compress individual folders. I like to enable the "Show compressed or encrypted NTFS files in color" option in Windows Explorer. File Menu => Options => Show => Show compressed or encrypted NTFS files in color.

    19. Uninstall Unnecessary Software: the forgotten obvious option mentioned in item 2 above, you should obviously uninstall any software that is not needed anymore. Common disk hogs: games, weird SDKs and development tools installed for testing, expired trial versions for various software, etc... To uninstall: Windows key + R, type appwiz.cpl and hit Enter.

    20. User Data Cleanup: for certain uninstalled applications a lot of junk could be left in the %UserProfile% and in the %AllUsersProfile%. Cleanup is as usual risky, use caution, but there can be lots of junk here - sometimes gigabytes.

      • Great care must be taken during such cleanup. Zip up the folder first. "Big wins only" - why nitpick with tiny text files? Diminishing returns for real if you get bogged down in these folders. Use disc-space visualization tools to see the hogs.
        • %AllUsersProfile% - shared data
        • %UserProfile% and %UserProfile%AppData - user specific data, remember to clean for all users (if multiple).
    21. Stray Package Caches: as mentioned above a lot of caching goes on for MSI packages (and other installer packages). It is likely that a lot of these packages can be left behind after uninstall (this was the case with Installshield cached setups back in the day at least).

      • The most commonly known caching locations are described here: Cache locations for (MSI) packages. Clean at your own risk, obviously - I repeat it, and I mean it. Some gigabytes are commonly stored here.
      • Paths inline (just a selection, there can be many others):
        • WiX: %ProgramData%Package Cache
        • Installshield: %SystemRoot%Downloaded Installations (older IS setups) and %LocalAppData%Downloaded Installations (newer IS setups)
        • Advanced Installer: [AppDataFolder][|Manufacturer][|ProductName] [|ProductVersion]install
        • Visual Studio: %AllUsersProfile%MicrosoftVisualStudioPackages. See important tip in comment below (disable cache).
    22. Package Distribution Cache Folders: SCCM and other package distribution systems have cache folders that get really big. For example ccmcache. These folders can usually be cleaned or re-configured to take less space.

    There are no doubt numerous other little tricks, but please don't redirect system folders!

    Alternative Approaches

    (Dis)-Honorable Mentions: The below are not recommendations, but some alternative approaches. They are higher risk than the options above (which should be good enough), and best if you are setting up a new laptop fresh or reinstalling it, and want to get rid of pesky vendor recovery-partitions that you can do without.

    Let's state the obvious with conviction: A lot of data is lost every year using these tools. So coffee or caffeine first. Glasses on. Look around. Adjust any pony tails and beards (ladies too). Speak to yourself in the third person. Assume a demonstrably insane posture and shout out "I do!" to really commit to the imminent disaster! Good luck! Fire in the hole! "Fire for effect". SNAFU. FUBAR. OK, enough already... I have had bad experiences - but no huge disasters (knock on wood) - with all these tools. Enough said - be careful, your data is important. Wife's baby pictures, your uncommitted code, etc...

    1. diskmgmt.msc or diskpart.exe (Windows): open partition manager (diskmgmt.msc) and wipe out any recovery partitions or hidden partitions that you can live without and then expand your system disk to fill the whole physical disk or create a new visible partition.
      • Factory reset no longer possible (could be outdated anyway). You need installation media to reinstall (downloadable?).
      • Careful what you wipe out! Unrecoverable. Partitions are often protected and untouchable. They are also unmovable and un-expandable in many cases.
      • Maybe create a new, visible partition replacing the recovery partition and move data files and your downloads folder there to make more room on your system partition?
      • If the partitions are protected, you can use diskpart to delete them instead, or see next bullet point for gparted. Very easy to mess things up using diskpart though (command line).
    2. gparted (Linux): you may be prevented from deleting a recovery partition from diskmgmt.msc (protected partitions). If you are adamant and insist, you can boot into a Linux Live Disc / System (booted from removable media) and delete using gparted for example.
      • I have done this to get rid of obsolete and useless recovery partitions and / or malware, and it worked just fine. But frankly I trust this gparted app as far as I can toss it. No offence to gparted, but playing well with Windows is challenging. Backup is crucial and mandatory for such risky endeavors - obviously.
      • Though risky (a Linux tool is updating the partition tables where your Windows partitions are declared) this may work for laptops where there is nowhere to redirect data folders since there is only one physical disk and you want the full disk for your system partition.
      • I think gparted even allows you to try to resize existing partitions at this point. I have never tried it. Good luck if you try. "Fire in the hole!".
    3. Cloning: some use imaging tools or disk cloning features (hardware) to clone the old disk onto a bigger one. Backups essential obviously. Far from my comfort zone - just mentioning it. Not really relevant for this list (which was supposed to be about simple and effective measures to gain more disc space).
      • I believe there are features for this in gparted as well. Never tested.
      • Various hardware solutions. I gave them up years ago.
      • Why I am skeptical? Malware. Disk errors. Encryption. NTFS complexity? AD-problems (old & new drive in use post-clone)? Etc...
      • Several hard drive vendors seem to deliver proprietary solutions for this - these may be better tested than generic approaches?
    4. File System Allocation Size: the file system used and its allocation size affects available space. Never bothered to look much at this, but a lot of space can be wasted by allocation size issues: Would SSD drives benefit from a non-default allocation unit size?
      • Allocation size cannot be easily / safely changed for a disk in use. There may be tools that can do it, but the benefits are uncertain.
      • Modern Windows versions require NTFS as system partition file system. Other file systems such as FAT32 or exFAT have lower overhead (especially for smaller partitions - there will be more space available), and they are potentially faster but have more limitations. For FAT32 the biggest limitation is probably the 4GB max file size - not viable today.


    The rest of this answer (below) was written during debugging - I will leave it in. It contains generic and general-purpose debugging options.


    VC+ Runtimes

    As seen in the link towards the bottom, other people have seen the same deployment error. Before getting into too much debugging, let's try the simplest approach possible. Please try to install the VC++ runtimes for 2017 (and 2015 perhaps) from here:

    Potential General Fixes

    This seems to be the better discussion online for this problem. I would first try the suggestion to run this tool: Microsoft Install and Uninstall Troubleshooter.

    You can try this list of fixes as well. Crucially I would also try a reboot before trying again to release any potential locked files. Just to wipe the slate clean. The system's event log might have further information on the error seen (sometimes even beyond what is in an msiexec.exe log).

    ACLs

    What is the ACL (Access Control List) for your TEMP folder on that G: drive?

    UPDATE: Also make sure the hidden folder C:WindowsInstaller exists and have the correct permission settings. You need to show protected operating system files in Windows Explorer to see this folder.

    Verbose Logging

    Try to create a proper, verbose log for the MSI install in question (much more informative than the log you refer to). This gives you something to start with to figure out what is happening. You can find some information on how to do logging here.

    I would enable logging for all MSI installations for debugging purposes. See installsite.org on logging (section "Globally for all setups on a machine") for how to do this.

    I prefer this default logging switched on for dev and test boxes. Typically you suddenly see an MSI error and you wish you had a log - now you can, always ready in %tmp%.

    Quick Testing

    In your case, I would go to C:ProgramDataMicrosoftVisualStudioPackagesMicrosoft.VisualStudio.MinShell.Msi,version=15.6.27421.1 to see if the MSI package is present on disk, and then I would launch it with logging enabled:

    msiexec.exe /I "Microsoft.VisualStudio.MinShell.Msi.msi" /QN /L*V "C:msilog.log"
    

    Alternatively I would just double click the MSI file and see if I get a better, interactive error message. You will most likely need the verbose log to get any info.

    See link in comment below (concrete error).

    这篇关于VS 2017 安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆