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