vc_redist.x64 repair install versus regular install


perdrix

Well-known member
Member
Local time
4:01 PM
Posts
112
OS
Windows 11 for Workstations
We've hit a number of issues lately where user's systems had back-level version of msvcp140.dll. This caused no end of grief.

I thought I'd change our install script to do this:

Section "Visual Studio Runtime"
SetOutPath "$INSTDIR"
File "..\x64\Release\vc_redist.x64.exe"
SetRegView 64
ReadRegDWORD $0 HKLM "Software\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Bld"
SetRegView 32
${If} $0 != 33816
#
# vc_redist build 33816 isn't installed, so install it
#
ExecWait "$INSTDIR\vc_redist.x64.exe /install /passive /norestart"
${Else}
#
# vc_redist build 33816 is installed, force a repair install
#
ExecWait "$INSTDIR\vc_redist.x64.exe /repair /passive /norestart"
${Endif}

Delete "$INSTDIR\vc_redist.x64.exe"
SectionEnd

This sort of works if the 14.40.33816 build has never been installed, in which case it does a regular install, otherwise a repair is done.

However if the redist package has previously been installed and then uninstalled, the registry keys remain so it always does a repair install

So will a repair install do everything a regular install would but without checking that the redist has been installed?

Or do I need a better check for the vc_redist.x64 being installed or not?

Thanks
David
 
Windows Build/Version
Version 23H2

My Computer My Computer

At a glance

Windows 11 for WorkstationsXeon W-11885M128GB
OS
Windows 11 for Workstations
Computer type
Laptop
Manufacturer/Model
Dell Precision 7750
CPU
Xeon W-11885M
Motherboard
Dell
Memory
128GB
Any help much appreciated.
 

My Computer My Computer

At a glance

Windows 11 for WorkstationsXeon W-11885M128GB
OS
Windows 11 for Workstations
Computer type
Laptop
Manufacturer/Model
Dell Precision 7750
CPU
Xeon W-11885M
Motherboard
Dell
Memory
128GB
Most of the time, a repair install will refresh the application by re-installing the app in the background. Occasionally, the repair install will only examine the files and replace or repair what is necessary. In my experience, the repair installers usually just re-install the app, rather than the second more complicated option.

But this is Microsoft, they may write the more complicated installer.

However, checking the file dates on my last .NET repair install, the installer overwrote all of the files, suggesting a complete re-install of the package.

I think you will be all right if it just runs the repair install. The installer will see that the app is no longer installed and put everything back where it should be.

This is one thing that I don't like about some of MS's uninstall process. It eaves remnants in the registry. Without using a registry cleaner of some kind, or a brute force uninstaller that will clear remnants and leftovers, you can wind up with issues like this.

Best of luck.
 

My Computers My Computers

  • At a glance

    Win 11 Pro 25H2Intel i7 13700KF32 GB Team Group DDR5 - 6000 CL 30ASUS TUF GAMING RTX 3070 Ti
    OS
    Win 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self build
    CPU
    Intel i7 13700KF
    Motherboard
    Gigabyte Z790 UD AC
    Memory
    32 GB Team Group DDR5 - 6000 CL 30
    Graphics Card(s)
    ASUS TUF GAMING RTX 3070 Ti
    Sound Card
    On board Realtek
    Monitor(s) Displays
    ACER 34 inch
    Screen Resolution
    Not 4K like I thought. 35" wide though.
    Hard Drives
    1 TB Samsung 980 Pro Nvme, 1 TB Samsung 970 EVO Nvme, 2 x Samsung 970 2TB SSD SATA
    PSU
    EVGA 1000Q
    Case
    Rosewill something or other
    Cooling
    Noctua NH-D15. A whole schwak of Noctua case fans. $$$
    Keyboard
    Logitech G815
    Mouse
    Logitech G502 Hero
    Internet Speed
    700 up, 600 down
    Browser
    Firefox
    Antivirus
    MalwareBytes
  • At a glance

    Widows 11 ProRyzen 2700X32 GB DDR4XFX Radeon R9 280
    Operating System
    Widows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self build
    CPU
    Ryzen 2700X
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    32 GB DDR4
    Graphics card(s)
    XFX Radeon R9 280
    Sound Card
    Onboard
    Monitor(s) Displays
    Two 27 inch Acer monitors
    Screen Resolution
    1920 x 1080
    Hard Drives
    One 1 TB NVME (Samsung)
    PSU
    Corsair 750 Watt
    Case
    HAF 912
    Cooling
    Wraith cooler and case fans
    Keyboard
    Logitech G710+
    Mouse
    Generic
    Internet Speed
    700 down, 650 up
    Browser
    Firefox, Chrome
    Antivirus
    Malware bytes
We check these two registry keys:

Code:
HKLM\Software\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum
HKLM\Software\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeAdditional

One or both will contain a Version value, with a format such as 14.40.33810. You seem to be writing a Nullsoft (NSIS) installer, which does have a VersionCompare function you could use to compare against the known version number you're installing.
 

My Computer My Computer

At a glance

Win11 Ent. 25H2
OS
Win11 Ent. 25H2

Latest Tutorials

Back
Top Bottom