@@ -11,10 +11,7 @@ param (
1111 #
1212 # The following version pinnings are semi-automatically checked for
1313 # updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
14- # [string] $AsioSDKName = "asiosdk_2.3.3_2019-06-14",
15- [string ] $AsioSDKName = " ASIOSDK" ,
1614 [string ] $AsioSDKUrl = " https://download.steinberg.net/sdk_downloads/asiosdk_2.3.3_2019-06-14.zip" ,
17- [string ] $NsisName = " nsis-3.11" ,
1815 [string ] $NsisUrl = " https://downloads.sourceforge.net/project/nsis/NSIS%203/3.11/nsis-3.11.zip" ,
1916 [string ] $BuildOption = " "
2017)
@@ -129,8 +126,6 @@ Function Install-Dependency
129126 [Parameter (Mandatory = $true )]
130127 [string ] $Uri ,
131128 [Parameter (Mandatory = $true )]
132- [string ] $Name ,
133- [Parameter (Mandatory = $true )]
134129 [string ] $Destination
135130 )
136131
@@ -141,7 +136,11 @@ Function Install-Dependency
141136 }
142137
143138 $TempFileName = [System.IO.Path ]::GetTempFileName() + " .zip"
144- $TempDir = [System.IO.Path ]::GetTempPath()
139+ $TempPath = [System.IO.Path ]::GetTempPath()
140+ $TempGuid = [System.Guid ]::NewGuid()
141+ # Create a unique empty directory to unpack into
142+ $TempDir = (Join-Path $TempPath $TempGuid )
143+ New-Item - ItemType Directory - Path $TempDir
145144
146145 if ($Uri -Match " downloads.sourceforge.net" )
147146 {
@@ -152,7 +151,10 @@ Function Install-Dependency
152151 echo $TempFileName
153152 Expand-Archive - Path $TempFileName - DestinationPath $TempDir - Force
154153 echo $WindowsPath \$Destination
155- Move-Item - Path " $TempDir \$Name " - Destination " $WindowsPath \$Destination " - Force
154+ # Because we unpacked into a new directory, we can use * for the directory in the archive,
155+ # so that we do not need to know the directory name the archive was packed from.
156+ Move-Item - Path " $TempDir \*" - Destination " $WindowsPath \$Destination " - Force
157+ Remove-Item - Path $TempDir - Recurse - Force
156158 Remove-Item - Path $TempFileName - Force
157159}
158160
@@ -163,16 +165,12 @@ Function Install-Dependencies
163165 Install-PackageProvider - Name " Nuget" - Scope CurrentUser - Force
164166 }
165167 Initialize-Module - Here - m " VSSetup"
166- Install-Dependency - Uri $NsisUrl `
167- - Name $NsisName - Destination " ..\libs\NSIS\NSIS-source"
168+ Install-Dependency - Uri $NsisUrl - Destination " ..\libs\NSIS\NSIS-source"
168169
169170 if ($BuildOption -Notmatch " jack" ) {
170171 # Don't download ASIO SDK on Jamulus JACK builds to save
171172 # resources and to be extra-sure license-wise.
172- Set-PSDebug - Trace 2
173- Install-Dependency - Uri $AsioSDKUrl `
174- - Name $AsioSDKName - Destination " ..\libs\ASIOSDK2"
175- Set-PSDebug - Off
173+ Install-Dependency - Uri $AsioSDKUrl - Destination " ..\libs\ASIOSDK2"
176174 }
177175}
178176
0 commit comments