From: David Pinedo Date: Fri, 10 Jun 2016 17:37:44 +0000 (-0600) Subject: winrt: fix error on uninstall X-Git-Tag: upstream/1.1.92~3040^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9913c6f30caf8b0e9d5059e3f474683f47d83832;p=platform%2Fupstream%2FVulkan-Tools.git winrt: fix error on uninstall Remove old log files before writing them. When 2 uninstalls are done in a row, this caused the uninstaller to display an error --- diff --git a/windowsRuntimeInstaller/InstallerRT.nsi b/windowsRuntimeInstaller/InstallerRT.nsi index 462cbb8..0bfd47f 100644 --- a/windowsRuntimeInstaller/InstallerRT.nsi +++ b/windowsRuntimeInstaller/InstallerRT.nsi @@ -248,6 +248,7 @@ Function ${un}ConfigLayersAndVulkanDLL # Exectute the script by piping it to powershell.exe. This gets around possible OS # security restrictions on running powershell scripts. nsExec::ExecToStack 'cmd /k type "$TEMP\VulkanRT\VulkanRT.ps1" | powershell -NoProfile -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -Command -' + Delete "$TEMP\VulkanRT\ConfigLayersAndVulkanDLL1.${un}log" Rename "$TEMP\ConfigLayersAndVulkanDLL.log" "$TEMP\VulkanRT\ConfigLayersAndVulkanDLL1.${un}log" pop $0 @@ -255,6 +256,7 @@ Function ${un}ConfigLayersAndVulkanDLL ${If} $0 != 0 nsExec::ExecToStack 'cmd /k type "$TEMP\VulkanRT\VulkanRT.ps1" | "$WINDIR\System32\WindowsPowerShell\v1.0\powershell" -NoProfile -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -Command -' pop $0 + Delete "$TEMP\VulkanRT\ConfigLayersAndVulkanDLL2.${un}log" Rename "$TEMP\ConfigLayersAndVulkanDLL.log" "$TEMP\VulkanRT\ConfigLayersAndVulkanDLL2.${un}log" ${Endif} @@ -274,6 +276,9 @@ Function ${un}ConfigLayersAndVulkanDLL Delete "$TEMP\ConfigLayersAndVulkanDLL.stat" Delete "$TEMP\VulkanRT\VulkanRT.ps1" + # Ignore errors. If something went wrong, the return value will indicate it. + ClearErrors + FunctionEnd !macroend !insertmacro ConfigLayersAndVulkanDLL "" @@ -294,6 +299,10 @@ Function ${un}DiagConfigLayersAndVulkanDLL nsExec::ExecToStack 'cmd /k dir "$WINDIR\System32\WindowsPowerShell\v1.0" >"$TEMP\VulkanRT\Diagnostic2.${un}log"' pop $1 LogText "cmd2 rval is $1" + + # Ignore errors + ClearErrors + FunctionEnd !macroend !insertmacro DiagConfigLayersAndVulkanDLL "" @@ -506,7 +515,6 @@ Section ${If} $0 != 0 SetOutPath "$INSTDIR" Call DiagConfigLayersAndVulkanDLL - ClearErrors # The Powershell script failed, and we don't know why. # Simply configure system to use our loader and vulkaninfo.