blob: 00c7ee6c3b6c1c8d33ad98022f90a88666622350 [file] [log] [blame]
David Pinedo1e368f72016-02-04 17:04:44 -07001# Copyright (c) 2015-2016 The Khronos Group Inc.
2# Copyright (c) 2015-2016 Valve Corporation
3# Copyright (c) 2015-2016 LunarG, Inc.
David Pinedoc21fdb92016-01-04 16:31:57 -07004#
David Pinedo1e368f72016-02-04 17:04:44 -07005# 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 Pinedoc21fdb92016-01-04 16:31:57 -070011#
David Pinedo1e368f72016-02-04 17:04:44 -070012# The above copyright notice(s) and this permission notice shall be included in
13# all copies or substantial portions of the Materials.
David Pinedoc21fdb92016-01-04 16:31:57 -070014#
David Pinedo1e368f72016-02-04 17:04:44 -070015# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
David Pinedoc21fdb92016-01-04 16:31:57 -070016# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
David Pinedo1e368f72016-02-04 17:04:44 -070017# 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 Pinedoc21fdb92016-01-04 16:31:57 -070023#
24# Author: David Pinedo <david@LunarG.com>
David Pinedo1e368f72016-02-04 17:04:44 -070025# Author: Mark Young <mark@LunarG.com>
David Pinedoc21fdb92016-01-04 16:31:57 -070026#
27
David Pinedo1e368f72016-02-04 17:04:44 -070028
David Pinedoc21fdb92016-01-04 16:31:57 -070029# 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 Young4b8b5482016-01-15 15:09:39 -070034# - The same thing is done for those files in C:\Windows\SysWOW64 on a 64-bit
35# target.
David Pinedoc21fdb92016-01-04 16:31:57 -070036# - 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 Youngaf87f222016-01-20 16:33:18 -070039# This script takes the following parameters:
Mark Young4b8b5482016-01-15 15:09:39 -070040# $majorabi : a single string number specifying the major abi version.
Mark Youngaf87f222016-01-20 16:33:18 -070041# $ossize : an integer indicating if the target is a 64 (64) or 32 (32) bit OS.
David Pinedoc21fdb92016-01-04 16:31:57 -070042#
43
Mark Young4b8b5482016-01-15 15:09:39 -070044Param(
45 [string]$majorabi,
46 [int]$ossize
47)
David Pinedoc21fdb92016-01-04 16:31:57 -070048
49$vulkandll = "vulkan-"+$majorabi+".dll"
Mark Young71e2a402016-02-12 12:07:45 -070050$windrive = $env:SYSTEMDRIVE
51$winfolder = $env:SYSTEMROOT
David Pinedod133b782016-03-16 14:41:56 -060052$script:VulkanDllList=@()
David Pinedoc21fdb92016-01-04 16:31:57 -070053
David Pinedoc27e0442016-03-15 11:07:19 -060054function notNumeric ($x) {
55 try {
56 0 + $x | Out-Null
57 return $false
58 } catch {
59 return $true
60 }
61}
62
David Pinedoc21fdb92016-01-04 16:31:57 -070063# The name of the versioned vulkan dll file is one of the following:
64#
David Pinedo3bdbe5d2016-01-12 16:14:53 -070065# vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prerelease>-<prebuildno>
66# vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prerelease>
67# vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>-<prebuildno>
David Pinedoc21fdb92016-01-04 16:31:57 -070068# vulkan-<majorabi>-<major>-<minor>-<patch>-<buildno>.dll
David Pinedoc21fdb92016-01-04 16:31:57 -070069#
David Pinedo3bdbe5d2016-01-12 16:14:53 -070070# <major>, <minor>, <patch>, <buildno> and <prebuildno> are 1 to 10 numeric digits.
71# <prerelease> is any combination of alpha and numeric characters.
72# If <prerelease> and/or <prebuildno> are present, this identifies a prerelease,
73# and the vulkan dll file will be considered less recent than one with the same
74# <major>, <minor>, <patch>, <buildno> numbers without the <prerelease> and/or
75# <prebuildno>.
David Pinedoc21fdb92016-01-04 16:31:57 -070076
77
78# We first create an array, with one array element for each vulkan-*dll in
Mark Young4b8b5482016-01-15 15:09:39 -070079# C:\Windows\System32 (and C:\Windows\SysWOW64 on 64-bit systems), with each element
80# containing:
David Pinedo3bdbe5d2016-01-12 16:14:53 -070081# <major>=<minor>=<patch>=<buildno>=<prerelease>=<prebuildno>=
David Pinedoc21fdb92016-01-04 16:31:57 -070082# filename
David Pinedo3bdbe5d2016-01-12 16:14:53 -070083# @<major>@<minor>@<patch>@<buildno>@<prerelease>@<prebuildno>@
David Pinedoc21fdb92016-01-04 16:31:57 -070084# [Note that the above three lines are one element in the array.]
85# The build identifiers separated by "=" are suitable for sorting, i.e.
David Pinedo3bdbe5d2016-01-12 16:14:53 -070086# expanded to 10 digits with leading 0s. If <prerelease> or <prebuildno> are
87# not specified, "zzzzzzzzzz" is substituted for them, so that they sort
David Pinedoc21fdb92016-01-04 16:31:57 -070088# to a position after those that do specify them.
89# The build identifiers separated by "@" are the original values extracted
90# from the file name. They are used later to find the path to the SDK
91# install directory for the given filename.
92
David Pinedoc27e0442016-03-15 11:07:19 -060093
Mark Youngd6897a32016-01-20 14:48:21 -070094function UpdateVulkanSysFolder([string]$dir, [int]$writeSdkName)
Mark Younga81e6082016-01-15 12:35:39 -070095{
96 # Push the current path on the stack and go to $dir
97 Push-Location -Path $dir
David Pinedo1e368f72016-02-04 17:04:44 -070098
David Pinedod133b782016-03-16 14:41:56 -060099 # Create a list for all the DLLs in the folder.
100 # First Initialize the list to empty
101 $script:VulkanDllList = @()
David Pinedo1e368f72016-02-04 17:04:44 -0700102
Mark Younga81e6082016-01-15 12:35:39 -0700103 # Find all DLL objects in this directory
104 dir -name vulkan-$majorabi-*.dll |
David Pinedoc21fdb92016-01-04 16:31:57 -0700105 ForEach-Object {
David Pinedoc27e0442016-03-15 11:07:19 -0600106 if ($_ -match "=" -or
107 $_ -match "@" -or
108 $_ -match " " -or
109 ($_.Split('-').count -lt 6) -or
110 ($_.Split('-').count -gt 8))
111 {
112 # If a file name contains "=", "@", or " ", or it contains less then 5 dashes or more than
113 # 7 dashes, it wasn't installed by the Vulkan Run Time.
114 # Note that we need to use return inside of ForEach-Object is to continue with iteration.
115 return
116 }
David Pinedoc21fdb92016-01-04 16:31:57 -0700117 $major=$_.Split('-')[2]
118 $majorOrig=$major
119 $minor=$_.Split('-')[3]
120 $minorOrig=$minor
121 $patch=$_.Split('-')[4]
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700122 $patchOrig=$patch
123 $buildno=$_.Split('-')[5]
David Pinedoc21fdb92016-01-04 16:31:57 -0700124
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700125 if ($buildno -match ".dll") {
David Pinedoc27e0442016-03-15 11:07:19 -0600126 # prerelease and prebuildno are not in the name
127 # Extract buildno, and set prerelease and prebuildno to "z"s
128 $buildno=$buildno -replace ".dll",""
129 $buildnoOrig=$buildno
130 $prerelease="z"*10
131 $prereleaseOrig=""
132 $prebuildno="z"*10
133 $prebuildnoOrig=""
David Pinedoc21fdb92016-01-04 16:31:57 -0700134 } else {
David Pinedoc27e0442016-03-15 11:07:19 -0600135 # Extract buildno, prerelease, and prebuildno
David Pinedoc21fdb92016-01-04 16:31:57 -0700136 $f=$_ -replace ".dll",""
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700137 $buildno=$f.Split('-')[5]
David Pinedo5da20dd2016-01-13 16:22:19 -0700138 $buildnoOrig=$buildno
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700139 $prerelease=$f.Split('-')[6]
140 $prebuildno=$f.Split('-')[7]
141 if ($prebuildno.Length -eq 0) {
David Pinedoc21fdb92016-01-04 16:31:57 -0700142 if ($prerelease -match "^[0-9]") {
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700143 # prerelease starts with a digit, it must be the prebuildno
144 $prebuildno=$prerelease
David Pinedoc21fdb92016-01-04 16:31:57 -0700145 $prerelease=""
146 }
147 }
David Pinedoc21fdb92016-01-04 16:31:57 -0700148 $prereleaseOrig=$prerelease
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700149 $prebuildnoOrig=$prebuildno
David Pinedoc21fdb92016-01-04 16:31:57 -0700150
151 if ($prerelease.Length -eq 0) {
152 $prerelease="z"*10
153 }
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700154 if ($prebuildno.Length -eq 0) {
155 $prebuildno="z"*10
David Pinedoc21fdb92016-01-04 16:31:57 -0700156 }
157 }
158
David Pinedoc27e0442016-03-15 11:07:19 -0600159 # Make sure fields that are supposed to be numbers are numbers
160 if (notNumeric($major)) {return}
161 if (notNumeric($minor)) {return}
162 if (notNumeric($patch)) {return}
163 if (notNumeric($buildno)) {return}
164 if (notNumeric($prebuildno)) {
165 if ($prebuildno -ne "z"*10) {return}
166 }
167
David Pinedoc21fdb92016-01-04 16:31:57 -0700168 $major = $major.padleft(10,'0')
169 $minor = $minor.padleft(10,'0')
170 $patch = $patch.padleft(10,'0')
David Pinedoc21fdb92016-01-04 16:31:57 -0700171 $buildno = $buildno.padleft(10,'0')
David Pinedo3bdbe5d2016-01-12 16:14:53 -0700172 $prerelease = $prerelease.padleft(10,'0')
173 $prebuildno = $prebuildno.padleft(10,'0')
David Pinedoc21fdb92016-01-04 16:31:57 -0700174
175 # Add a new element to the $VulkanDllList array
David Pinedod133b782016-03-16 14:41:56 -0600176 $script:VulkanDllList+="$major=$minor=$patch=$buildno=$prerelease=$prebuildno= $_ @$majorOrig@$minorOrig@$patchOrig@$buildnoOrig@$prereleaseOrig@$prebuildnoOrig@"
David Pinedoc21fdb92016-01-04 16:31:57 -0700177 }
178
Mark Younga81e6082016-01-15 12:35:39 -0700179 # If $VulkanDllList contains at least one element, there's at least one vulkan*.dll file.
180 # Copy the most recent vulkan*.dll (named in the last element of $VulkanDllList) to vulkan-$majorabi.dll.
David Pinedoc21fdb92016-01-04 16:31:57 -0700181
David Pinedod133b782016-03-16 14:41:56 -0600182 if ($script:VulkanDllList.Length -gt 0) {
David Pinedoc21fdb92016-01-04 16:31:57 -0700183
Mark Younga81e6082016-01-15 12:35:39 -0700184 # Sort the list. The most recent vulkan-*.dll will be in the last element of the list.
David Pinedod133b782016-03-16 14:41:56 -0600185 [array]::sort($script:VulkanDllList)
David Pinedoc21fdb92016-01-04 16:31:57 -0700186
Mark Younga81e6082016-01-15 12:35:39 -0700187 # Put the name of the most recent vulkan-*.dll in $mrVulkanDLL.
188 # The most recent vulkanDLL is the second word in the last element of the
189 # sorted $VulkanDllList. Copy it to $vulkandll.
David Pinedod133b782016-03-16 14:41:56 -0600190 $mrVulkanDll=$script:VulkanDllList[-1].Split(' ')[1]
Mark Younga81e6082016-01-15 12:35:39 -0700191 copy $mrVulkanDll $vulkandll
David Pinedoc21fdb92016-01-04 16:31:57 -0700192
Mark Younga81e6082016-01-15 12:35:39 -0700193 # Copy the most recent version of vulkaninfo-<abimajor>-*.exe to vulkaninfo.exe.
194 # We create the source file name for the copy from $mrVulkanDll.
195 $mrVulkaninfo=$mrVulkanDll -replace ".dll",".exe"
196 $mrVulkaninfo=$mrVulkaninfo -replace "vulkan","vulkaninfo"
197 copy $mrVulkaninfo vulkaninfo.exe
David Pinedo1e368f72016-02-04 17:04:44 -0700198
Mark Younga81e6082016-01-15 12:35:39 -0700199 # Create the name used in the registry for the SDK associated with $mrVulkanDll.
David Pinedod133b782016-03-16 14:41:56 -0600200 $major=$script:VulkanDllList[-1].Split('@')[1]
201 $minor=$script:VulkanDllList[-1].Split('@')[2]
202 $patch=$script:VulkanDllList[-1].Split('@')[3]
203 $buildno=$script:VulkanDllList[-1].Split('@')[4]
204 $prerelease=$script:VulkanDllList[-1].Split('@')[5]
205 $prebuildno=$script:VulkanDllList[-1].Split('@')[6]
David Pinedo1e368f72016-02-04 17:04:44 -0700206
Mark Youngd6897a32016-01-20 14:48:21 -0700207 $sdktempname="VulkanSDK"+$major + "." + $minor + "." + $patch + "." + $buildno
Mark Younga81e6082016-01-15 12:35:39 -0700208 if ($prerelease -ne "") {
Mark Youngd6897a32016-01-20 14:48:21 -0700209 $sdktempname=$sdktempname + "." + $prerelease
Mark Younga81e6082016-01-15 12:35:39 -0700210 }
211 if ($prebuildno -ne "") {
Mark Youngd6897a32016-01-20 14:48:21 -0700212 $sdktempname=$sdktempname + "." + $prebuildno
Mark Younga81e6082016-01-15 12:35:39 -0700213 }
David Pinedoc21fdb92016-01-04 16:31:57 -0700214 }
David Pinedo1e368f72016-02-04 17:04:44 -0700215
Mark Youngd6897a32016-01-20 14:48:21 -0700216 # Return to our previous folder
217 Pop-Location
218
219 # Only update the overall script-scope SDK name if we're told to
220 if ($writeSdkName -ne 0) {
221 $script:sdkname = $sdktempname
222 }
223
224 return
David Pinedoc21fdb92016-01-04 16:31:57 -0700225}
226
Mark Young4b8b5482016-01-15 15:09:39 -0700227# We only care about SYSWOW64 if we're targeting a 64-bit OS
Mark Youngb628d162016-01-19 15:29:34 -0700228if ($ossize -eq 64) {
Mark Young4b8b5482016-01-15 15:09:39 -0700229 # Update the SYSWOW64 Vulkan DLLS/EXEs
Mark Young71e2a402016-02-12 12:07:45 -0700230 UpdateVulkanSysFolder $winfolder\SYSWOW64 0
Mark Young4b8b5482016-01-15 15:09:39 -0700231}
232
233# Update the SYSTEM32 Vulkan DLLS/EXEs
Mark Young71e2a402016-02-12 12:07:45 -0700234UpdateVulkanSysFolder $winfolder\SYSTEM32 1
David Pinedoc21fdb92016-01-04 16:31:57 -0700235
236# Create an array of vulkan sdk install dirs
237
238$mrVulkanDllInstallDir=""
239$VulkanSdkDirs=@()
David Pinedo1e368f72016-02-04 17:04:44 -0700240Get-ChildItem -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall |
David Pinedoc21fdb92016-01-04 16:31:57 -0700241 ForEach-Object {
242 $regkey=$_ -replace ".*\\",""
243 if ($_ -match "\\VulkanSDK") {
244 # Get the install path from UninstallString
245 $tmp=Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$regkey -Name UninstallString
246 $tmp=$tmp -replace "\\Uninstall.exe.*",""
247 $tmp=$tmp -replace ".*=.",""
248 $VulkanSdkDirs+=$tmp
Mark Youngd6897a32016-01-20 14:48:21 -0700249 if ($regkey -eq $script:sdkname) {
David Pinedoc21fdb92016-01-04 16:31:57 -0700250 # Save away the sdk install dir for the the most recent vulkandll
251 $mrVulkanDllInstallDir=$tmp
252 }
253 }
254 }
255
David Pinedod133b782016-03-16 14:41:56 -0600256
257# Search list of sdk install dirs for an sdk compatible with $script:sdkname.
258# We go backwards through VulkanDllList to generate SDK names, because we want the most recent SDK.
259if ($mrVulkanDllInstallDir -eq "") {
260 ForEach ($idx in ($script:VulkanDllList.Length-1)..0) {
261 $vulkanDllMajor=$script:VulkanDllList[$idx].Split('@')[1]
262 $vulkanDllMinor=$script:VulkanDllList[$idx].Split('@')[2]
263 $vulkanDllPatch=$script:VulkanDllList[$idx].Split('@')[3]
264 $vulkanDllBuildno=$script:VulkanDllList[$idx].Split('@')[4]
265 $vulkanDllPrerelease=$script:VulkanDllList[$idx].Split('@')[5]
266 $vulkanDllPrebuildno=$script:VulkanDllList[$idx].Split('@')[6]
267 $regEntry="VulkanSDK"+$vulkanDllMajor+"."+$vulkanDllMinor+"."+$vulkanDllPatch+"."+$vulkanDllBuildno
268 if ($vulkanDllPrerelease) {
269 $regEntry=$regEntry+"."+$vulkanDllPrerelease
270 }
271 if ($vulkanDllPrebuildno) {
272 $regEntry=$regEntry+"."+$vulkanDllPrebuildno
273 }
274 $rval=Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$regEntry -ErrorAction SilentlyContinue
275 $instDir=$rval
276 $instDir=$instDir -replace "\\Uninstall.exe.*",""
277 $instDir=$instDir -replace ".*=.",""
278 if ($rval) {
279 $rval=$rval -replace ".* DisplayVersion=",""
280 $rval=$rval -replace ";.*",""
281 $reMajor=$rval.Split('.')[0]
282 $reMinor=$rval.Split('.')[1]
283 $rePatch=$rval.Split('.')[2]
284 if ($reMajor+$reMinor+$rePatch -eq $vulkanDllMajor+$vulkanDllMinor+$vulkanDllPatch) {
285 $mrVulkanDllInstallDir=$instDir
286 break
287 }
288 }
289 }
290}
291
David Pinedoc21fdb92016-01-04 16:31:57 -0700292# Add C:\Vulkan\SDK\0.9.3 to list of SDK install dirs.
293# We do this because there is in a bug in SDK 0.9.3 in which layer
294# reg entries were not removed on uninstall. So we'll try to clean up
295# and remove them now.
296# This works only if 0.9.3 was installed to the default location.
297# If it was not installed to the default location, those entries will
298# need to be cleaned up manually.
299
300$VulkanSdkDirs+="C:\VulkanSDK\0.9.3"
Mark Young71e2a402016-02-12 12:07:45 -0700301$VulkanSdkDirs+="$windrive\VulkanSDK\0.9.3"
David Pinedoc21fdb92016-01-04 16:31:57 -0700302
David Pinedoc21fdb92016-01-04 16:31:57 -0700303# Remove layer registry entries associated with all installed Vulkan SDKs.
304# Note that we remove only those entries created by Vulkan SDKs. If other
305# layers were installed that are not from an SDK, we don't mess with them.
306
307Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ExplicitLayers | Select-Object -ExpandProperty Property |
308 ForEach-Object {
309 $regval=$_
310 ForEach ($sdkdir in $VulkanSdkDirs) {
311 if ($regval -like "$sdkdir\*.json") {
David Pinedo9bb478f2016-01-19 21:19:11 -0700312 Remove-ItemProperty -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers -name $regval
David Pinedoc21fdb92016-01-04 16:31:57 -0700313 }
314 }
315 }
Mark Youngb628d162016-01-19 15:29:34 -0700316# Remove 32-bit layer registry entries if we're targeting a 64-bit OS
317if ($ossize -eq 64) {
318 Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers | Select-Object -ExpandProperty Property |
319 ForEach-Object {
320 $regval=$_
321 ForEach ($sdkdir in $VulkanSdkDirs) {
322 if ($regval -like "$sdkdir\*.json") {
Mark Youngd6897a32016-01-20 14:48:21 -0700323 Remove-ItemProperty -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers -name $regval
Mark Youngb628d162016-01-19 15:29:34 -0700324 }
325 }
326 }
327}
David Pinedoc21fdb92016-01-04 16:31:57 -0700328
329
330# Create layer registry entries associated with Vulkan SDK from which $mrVulkanDll is from
331
332if ($mrVulkanDllInstallDir -ne "") {
Mark Youngb628d162016-01-19 15:29:34 -0700333 if ($ossize -eq 64) {
Mark Young51d35072016-02-09 15:30:34 -0700334
335 # Create registry entires in normal registry location for 64-bit items on a 64-bit OS
336 New-Item -Force -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers | out-null
337 Get-ChildItem $mrVulkanDllInstallDir\Bin -Filter VkLayer*json |
338 ForEach-Object {
339 New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers -Name $mrVulkanDllInstallDir\Bin\$_ -PropertyType DWord -Value 0 | out-null
340 }
341
342 # Create registry entires for the WOW6432Node registry location for 32-bit items on a 64-bit OS
343 New-Item -Force -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers | out-null
David Pinedo431b82a2016-02-05 09:48:26 -0700344 Get-ChildItem $mrVulkanDllInstallDir\Bin32 -Filter VkLayer*json |
Mark Youngb628d162016-01-19 15:29:34 -0700345 ForEach-Object {
Mark Youngd6897a32016-01-20 14:48:21 -0700346 New-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers -Name $mrVulkanDllInstallDir\Bin32\$_ -PropertyType DWord -Value 0 | out-null
Mark Youngb628d162016-01-19 15:29:34 -0700347 }
Mark Young51d35072016-02-09 15:30:34 -0700348
349 } else {
350
351 # Create registry entires in normal registry location for 32-bit items on a 32-bit OS
352 New-Item -Force -ErrorAction SilentlyContinue -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers | out-null
353 Get-ChildItem $mrVulkanDllInstallDir\Bin32 -Filter VkLayer*json |
354 ForEach-Object {
355 New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\Vulkan\ExplicitLayers -Name $mrVulkanDllInstallDir\Bin32\$_ -PropertyType DWord -Value 0 | out-null
356 }
357
Mark Youngb628d162016-01-19 15:29:34 -0700358 }
David Pinedoc21fdb92016-01-04 16:31:57 -0700359}