From e96e38763180cfb31eecc3007feee0083d72ff5f Mon Sep 17 00:00:00 2001 From: Mark Young Date: Wed, 22 Jun 2016 16:55:31 -0600 Subject: winsdk: Fix multiple RT uninstall issue Change originally by David Pinedo. If the same Vulkan Run-time installer is executed multiple times, it will bump the install count for the RT installation. There was a problem during uninstall which failed to look at the install count and would always remove some important files. This fixes that issue. Change-Id: I4dda50b0dbdd9ec901aa25713be7d7348f3d67ec --- windowsRuntimeInstaller/InstallerRT.nsi | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'windowsRuntimeInstaller') diff --git a/windowsRuntimeInstaller/InstallerRT.nsi b/windowsRuntimeInstaller/InstallerRT.nsi index 0bfd47fb..92da3934 100644 --- a/windowsRuntimeInstaller/InstallerRT.nsi +++ b/windowsRuntimeInstaller/InstallerRT.nsi @@ -618,31 +618,44 @@ Section "uninstall" # Delete vulkaninfo.exe in C:\Windows\System32 and C:\Windows\SysWOW64 Delete /REBOOTOK $WINDIR\SysWow64\vulkaninfo.exe - Delete /REBOOTOK "$WINDIR\SysWow64\vulkaninfo-$FileVersion.exe" Delete /REBOOTOK $WINDIR\System32\vulkaninfo.exe - Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" - # Delete vullkan dll files: vulkan-.dll and vulkan-----.dll + # Delete vulkan-.dll in C:\Windows\System32 and C:\Windows\SysWOW64 Delete /REBOOTOK $WINDIR\SysWow64\vulkan-${VERSION_ABI_MAJOR}.dll - Delete /REBOOTOK $WINDIR\SysWow64\vulkan-$FileVersion.dll Delete /REBOOTOK $WINDIR\System32\vulkan-${VERSION_ABI_MAJOR}.dll - Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll # Else, running on a 32-bit OS machine ${Else} # Delete vulkaninfo.exe in C:\Windows\System32 Delete /REBOOTOK $WINDIR\System32\vulkaninfo.exe - Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" - # Delete vullkan dll files: vulkan-.dll and vulkan-----.dll + # Delete vulkan-.dll in C:\Windows\System32 Delete /REBOOTOK $WINDIR\System32\vulkan-${VERSION_ABI_MAJOR}.dll - Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll ${EndIf} StrCpy $1 80 Call un.CheckForError + # If Ref Count is zero, remove files in C:\Windows\System32 and C:\Windows\SysWow64 + ${If} $IC <= 0 + + ${If} ${RunningX64} + # Delete vulkaninfo.exe in C:\Windows\System32 and C:\Windows\SysWOW64 + Delete /REBOOTOK "$WINDIR\SysWow64\vulkaninfo-$FileVersion.exe" + Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" + # Delete vulkan-----.dll from sys dirs + Delete /REBOOTOK $WINDIR\SysWow64\vulkan-$FileVersion.dll + Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll + ${Else} + # Delete vulkaninfo.exe in C:\Windows\System32 + Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" + # Delete vulkan-----.dll from sys dir + Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll + ${EndIf} + + ${Endif} + # Run the ConfigLayersAndVulkanDLL.ps1 script to copy the most recent version of # vulkan--*.dll to vulkan-.dll, and to set up layer registry # entries to use layers from the corresponding SDK @@ -664,7 +677,7 @@ Section "uninstall" ${Endif} Call un.CheckForError - # If Ref Count is zero, uninstall everything + # If Ref Count is zero, remove install dir ${If} $IC <= 0 # Remove files in install dir -- cgit v1.2.3