David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 1 | # Copyright (c) 2015-2016 The Khronos Group Inc.
|
| 2 | # Copyright (c) 2015-2016 Valve Corporation
|
| 3 | # Copyright (c) 2015-2016 LunarG, Inc.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 4 | #
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 | # of this software and/or associated documentation files (the "Materials"), to
|
| 7 | # deal in the Materials without restriction, including without limitation the
|
| 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 9 | # sell copies of the Materials, and to permit persons to whom the Materials are
|
| 10 | # furnished to do so, subject to the following conditions:
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 11 | #
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 12 | # The above copyright notice(s) and this permission notice shall be included in
|
| 13 | # all copies or substantial portions of the Materials.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 14 | #
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 15 | # The Materials are Confidential Information as defined by the Khronos
|
| 16 | # Membership Agreement until designated non-confidential by Khronos, at which
|
| 17 | # point this condition clause shall be removed.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 18 | #
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 19 | # THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 22 | #
|
| 23 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
| 24 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 25 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
|
| 26 | # USE OR OTHER DEALINGS IN THE MATERIALS.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 27 | #
|
| 28 | # Author: David Pinedo <david@LunarG.com>
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 29 | # Author: Mark Young <mark@LunarG.com>
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 30 | #
|
| 31 |
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 32 |
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 33 | # This Powershell script is used by the Vulkan Run Time Installer/Uninstaller to:
|
| 34 | # - Copy the most recent vulkan-<majorabi>-*.dll in C:\Windows\System32
|
| 35 | # to vulkan-<majorabi>.dll
|
| 36 | # - Copy the most recent version of vulkaninfo-<abimajor>-*.exe in
|
| 37 | # C:\Windows\System32 to vulkaninfo.exe
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 38 | # - The same thing is done for those files in C:\Windows\SysWOW64 on a 64-bit
|
| 39 | # target.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 40 | # - Set the layer registry entries to point to the layer json files
|
| 41 | # in the Vulkan SDK associated with the most recent vulkan*dll.
|
| 42 | #
|
Mark Young | af87f22 | 2016-01-20 16:33:18 -0700 | [diff] [blame] | 43 | # This script takes the following parameters:
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 44 | # $majorabi : a single string number specifying the major abi version.
|
Mark Young | af87f22 | 2016-01-20 16:33:18 -0700 | [diff] [blame] | 45 | # $ossize : an integer indicating if the target is a 64 (64) or 32 (32) bit OS.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 46 | #
|
| 47 |
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 48 | Param(
|
| 49 | [string]$majorabi,
|
| 50 | [int]$ossize
|
| 51 | )
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 52 |
|
| 53 | $vulkandll = "vulkan-"+$majorabi+".dll"
|
| 54 |
|
| 55 | # The name of the versioned vulkan dll file is one of the following:
|
| 56 | #
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 57 | # vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prerelease>-<prebuildno>
|
| 58 | # vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prerelease>
|
| 59 | # vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prebuildno>
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 60 | # vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>.dll
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 61 | #
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 62 | # <major>, <minor>, <patch>, <buildno> and <prebuildno> are 1 to 10 numeric digits.
|
| 63 | # <prerelease> is any combination of alpha and numeric characters.
|
| 64 | # If <prerelease> and/or <prebuildno> are present, this identifies a prerelease,
|
| 65 | # and the vulkan dll file will be considered less recent than one with the same
|
| 66 | # <major>, <minor>, <patch>, <buildno> numbers without the <prerelease> and/or
|
| 67 | # <prebuildno>.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 68 |
|
| 69 |
|
| 70 | # We first create an array, with one array element for each vulkan-*dll in
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 71 | # C:\Windows\System32 (and C:\Windows\SysWOW64 on 64-bit systems), with each element
|
| 72 | # containing:
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 73 | # <major>=<minor>=<patch>=<buildno>=<prerelease>=<prebuildno>=
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 74 | # filename
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 75 | # @<major>@<minor>@<patch>@<buildno>@<prerelease>@<prebuildno>@
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 76 | # [Note that the above three lines are one element in the array.]
|
| 77 | # The build identifiers separated by "=" are suitable for sorting, i.e.
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 78 | # expanded to 10 digits with leading 0s. If <prerelease> or <prebuildno> are
|
| 79 | # not specified, "zzzzzzzzzz" is substituted for them, so that they sort
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 80 | # to a position after those that do specify them.
|
| 81 | # The build identifiers separated by "@" are the original values extracted
|
| 82 | # from the file name. They are used later to find the path to the SDK
|
| 83 | # install directory for the given filename.
|
| 84 |
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 85 | function UpdateVulkanSysFolder([string]$dir, [int]$writeSdkName)
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 86 | {
|
| 87 | # Push the current path on the stack and go to $dir
|
| 88 | Push-Location -Path $dir
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 89 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 90 | # Create a list for all the DLLs in the folder
|
| 91 | $VulkanDllList=@()
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 92 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 93 | # Find all DLL objects in this directory
|
| 94 | dir -name vulkan-$majorabi-*.dll |
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 95 | ForEach-Object {
|
| 96 | $major=$_.Split('-')[2]
|
| 97 | $majorOrig=$major
|
| 98 | $minor=$_.Split('-')[3]
|
| 99 | $minorOrig=$minor
|
| 100 | $patch=$_.Split('-')[4]
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 101 | $patchOrig=$patch
|
| 102 | $buildno=$_.Split('-')[5]
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 103 |
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 104 | if ($buildno -match ".dll") {
|
| 105 | # <prerelease> and <prebuildno> are not in the name
|
| 106 | $buildno=$buildno -replace ".dll",""
|
| 107 | $buildnoOrig=$buildno
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 108 | $prerelease="z"*10
|
| 109 | $prereleaseOrig=""
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 110 | $prebuildno="z"*10
|
| 111 | $prebuildnoOrig=""
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 112 | } else {
|
| 113 |
|
| 114 | # We assume we don't have more than 5 dashes
|
| 115 |
|
| 116 | $f=$_ -replace ".dll",""
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 117 | $buildno=$f.Split('-')[5]
|
David Pinedo | 5da20dd | 2016-01-13 16:22:19 -0700 | [diff] [blame] | 118 | $buildnoOrig=$buildno
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 119 | $prerelease=$f.Split('-')[6]
|
| 120 | $prebuildno=$f.Split('-')[7]
|
| 121 | if ($prebuildno.Length -eq 0) {
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 122 | if ($prerelease -match "^[0-9]") {
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 123 | # prerelease starts with a digit, it must be the prebuildno
|
| 124 | $prebuildno=$prerelease
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 125 | $prerelease=""
|
| 126 | }
|
| 127 | }
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 128 | $prereleaseOrig=$prerelease
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 129 | $prebuildnoOrig=$prebuildno
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 130 |
|
| 131 | if ($prerelease.Length -eq 0) {
|
| 132 | $prerelease="z"*10
|
| 133 | }
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 134 | if ($prebuildno.Length -eq 0) {
|
| 135 | $prebuildno="z"*10
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 136 | }
|
| 137 | }
|
| 138 |
|
| 139 | $major = $major.padleft(10,'0')
|
| 140 | $minor = $minor.padleft(10,'0')
|
| 141 | $patch = $patch.padleft(10,'0')
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 142 | $buildno = $buildno.padleft(10,'0')
|
David Pinedo | 3bdbe5d | 2016-01-12 16:14:53 -0700 | [diff] [blame] | 143 | $prerelease = $prerelease.padleft(10,'0')
|
| 144 | $prebuildno = $prebuildno.padleft(10,'0')
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 145 |
|
| 146 | # Add a new element to the $VulkanDllList array
|
David Pinedo | 5da20dd | 2016-01-13 16:22:19 -0700 | [diff] [blame] | 147 | $VulkanDllList+="$major=$minor=$patch=$buildno=$prerelease=$prebuildno= $_ @$majorOrig@$minorOrig@$patchOrig@$buildnoOrig@$prereleaseOrig@$prebuildnoOrig@"
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 148 | }
|
| 149 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 150 | # If $VulkanDllList contains at least one element, there's at least one vulkan*.dll file.
|
| 151 | # Copy the most recent vulkan*.dll (named in the last element of $VulkanDllList) to vulkan-$majorabi.dll.
|
| 152 | # TODO: In the future, also copy the corresponding vulkaninfo-*.exe to vulkaninfo.exe.
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 153 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 154 | if ($VulkanDllList.Length -gt 0) {
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 155 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 156 | # Sort the list. The most recent vulkan-*.dll will be in the last element of the list.
|
| 157 | [array]::sort($VulkanDllList)
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 158 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 159 | # Put the name of the most recent vulkan-*.dll in $mrVulkanDLL.
|
| 160 | # The most recent vulkanDLL is the second word in the last element of the
|
| 161 | # sorted $VulkanDllList. Copy it to $vulkandll.
|
| 162 | $mrVulkanDll=$VulkanDllList[-1].Split(' ')[1]
|
| 163 | copy $mrVulkanDll $vulkandll
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 164 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 165 | # Copy the most recent version of vulkaninfo-<abimajor>-*.exe to vulkaninfo.exe.
|
| 166 | # We create the source file name for the copy from $mrVulkanDll.
|
| 167 | $mrVulkaninfo=$mrVulkanDll -replace ".dll",".exe"
|
| 168 | $mrVulkaninfo=$mrVulkaninfo -replace "vulkan","vulkaninfo"
|
| 169 | copy $mrVulkaninfo vulkaninfo.exe
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 170 |
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 171 | # Create the name used in the registry for the SDK associated with $mrVulkanDll.
|
| 172 | $major=$VulkanDLLList[-1].Split('@')[1]
|
| 173 | $minor=$VulkanDLLList[-1].Split('@')[2]
|
| 174 | $patch=$VulkanDLLList[-1].Split('@')[3]
|
| 175 | $buildno=$VulkanDLLList[-1].Split('@')[4]
|
| 176 | $prerelease=$VulkanDLLList[-1].Split('@')[5]
|
| 177 | $prebuildno=$VulkanDLLList[-1].Split('@')[6]
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 178 |
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 179 | $sdktempname="VulkanSDK"+$major + "." + $minor + "." + $patch + "." + $buildno
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 180 | if ($prerelease -ne "") {
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 181 | $sdktempname=$sdktempname + "." + $prerelease
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 182 | }
|
| 183 | if ($prebuildno -ne "") {
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 184 | $sdktempname=$sdktempname + "." + $prebuildno
|
Mark Young | a81e608 | 2016-01-15 12:35:39 -0700 | [diff] [blame] | 185 | }
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 186 | }
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 187 |
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 188 | # Return to our previous folder
|
| 189 | Pop-Location
|
| 190 |
|
| 191 | # Only update the overall script-scope SDK name if we're told to
|
| 192 | if ($writeSdkName -ne 0) {
|
| 193 | $script:sdkname = $sdktempname
|
| 194 | }
|
| 195 |
|
| 196 | return
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 197 | }
|
| 198 |
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 199 | # We only care about SYSWOW64 if we're targeting a 64-bit OS
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 200 | if ($ossize -eq 64) {
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 201 | # Update the SYSWOW64 Vulkan DLLS/EXEs
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 202 | UpdateVulkanSysFolder c:\WINDOWS\SYSWOW64 0
|
Mark Young | 4b8b548 | 2016-01-15 15:09:39 -0700 | [diff] [blame] | 203 | }
|
| 204 |
|
| 205 | # Update the SYSTEM32 Vulkan DLLS/EXEs
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 206 | UpdateVulkanSysFolder c:\WINDOWS\SYSTEM32 1
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 207 |
|
| 208 | # Create an array of vulkan sdk install dirs
|
| 209 |
|
| 210 | $mrVulkanDllInstallDir=""
|
| 211 | $VulkanSdkDirs=@()
|
David Pinedo | 1e368f7 | 2016-02-04 17:04:44 -0700 | [diff] [blame] | 212 | Get-ChildItem -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall |
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 213 | ForEach-Object {
|
| 214 | $regkey=$_ -replace ".*\\",""
|
| 215 | if ($_ -match "\\VulkanSDK") {
|
| 216 | # Get the install path from UninstallString
|
| 217 | $tmp=Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$regkey -Name UninstallString
|
| 218 | $tmp=$tmp -replace "\\Uninstall.exe.*",""
|
| 219 | $tmp=$tmp -replace ".*=.",""
|
| 220 | $VulkanSdkDirs+=$tmp
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 221 | if ($regkey -eq $script:sdkname) {
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 222 | # Save away the sdk install dir for the the most recent vulkandll
|
| 223 | $mrVulkanDllInstallDir=$tmp
|
| 224 | }
|
| 225 | }
|
| 226 | }
|
| 227 |
|
| 228 | # Add C:\Vulkan\SDK\0.9.3 to list of SDK install dirs.
|
| 229 | # We do this because there is in a bug in SDK 0.9.3 in which layer
|
| 230 | # reg entries were not removed on uninstall. So we'll try to clean up
|
| 231 | # and remove them now.
|
| 232 | # This works only if 0.9.3 was installed to the default location.
|
| 233 | # If it was not installed to the default location, those entries will
|
| 234 | # need to be cleaned up manually.
|
| 235 |
|
| 236 | $VulkanSdkDirs+="C:\VulkanSDK\0.9.3"
|
| 237 |
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 238 | # Remove layer registry entries associated with all installed Vulkan SDKs.
|
| 239 | # Note that we remove only those entries created by Vulkan SDKs. If other
|
| 240 | # layers were installed that are not from an SDK, we don't mess with them.
|
| 241 |
|
| 242 | Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ExplicitLayers | Select-Object -ExpandProperty Property |
|
| 243 | ForEach-Object {
|
| 244 | $regval=$_
|
| 245 | ForEach ($sdkdir in $VulkanSdkDirs) {
|
| 246 | if ($regval -like "$sdkdir\*.json") {
|
David Pinedo | 9bb478f | 2016-01-19 21:19:11 -0700 | [diff] [blame] | 247 | Remove-ItemProperty -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers -name $regval
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 248 | }
|
| 249 | }
|
| 250 | }
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 251 | # Remove 32-bit layer registry entries if we're targeting a 64-bit OS
|
| 252 | if ($ossize -eq 64) {
|
| 253 | Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers | Select-Object -ExpandProperty Property |
|
| 254 | ForEach-Object {
|
| 255 | $regval=$_
|
| 256 | ForEach ($sdkdir in $VulkanSdkDirs) {
|
| 257 | if ($regval -like "$sdkdir\*.json") {
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 258 | Remove-ItemProperty -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers -name $regval
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 259 | }
|
| 260 | }
|
| 261 | }
|
| 262 | }
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 263 |
|
| 264 |
|
| 265 | # Create layer registry entries associated with Vulkan SDK from which $mrVulkanDll is from
|
| 266 |
|
| 267 | if ($mrVulkanDllInstallDir -ne "") {
|
David Pinedo | 9bb478f | 2016-01-19 21:19:11 -0700 | [diff] [blame] | 268 | New-Item -Force -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers | out-null
|
David Pinedo | 431b82a | 2016-02-05 09:48:26 -0700 | [diff] [blame^] | 269 | Get-ChildItem $mrVulkanDllInstallDir\Bin -Filter VkLayer*json |
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 270 | ForEach-Object {
|
| 271 | New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers -Name $mrVulkanDllInstallDir\Bin\$_ -PropertyType DWord -Value 0 | out-null
|
| 272 | }
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 273 |
|
| 274 | # Create registry entires for the WOW6432Node registry only if we're targeting a 64-bit OS
|
| 275 | if ($ossize -eq 64) {
|
| 276 | New-Item -Force -ErrorAction Ignore -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers | out-null
|
David Pinedo | 431b82a | 2016-02-05 09:48:26 -0700 | [diff] [blame^] | 277 | Get-ChildItem $mrVulkanDllInstallDir\Bin32 -Filter VkLayer*json |
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 278 | ForEach-Object {
|
Mark Young | d6897a3 | 2016-01-20 14:48:21 -0700 | [diff] [blame] | 279 | New-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers -Name $mrVulkanDllInstallDir\Bin32\$_ -PropertyType DWord -Value 0 | out-null
|
Mark Young | b628d16 | 2016-01-19 15:29:34 -0700 | [diff] [blame] | 280 | }
|
| 281 | }
|
David Pinedo | c21fdb9 | 2016-01-04 16:31:57 -0700 | [diff] [blame] | 282 | }
|