Skip to content

Commit 8f1d4fe

Browse files
authored
Send host geo to sandbox (microsoft#5873)
## Change My sandbox was using the `World` region by default; this change gets the location from the host and sends/sets it into the sandbox so that we can still talk to the Store.
1 parent 087ea0e commit 8f1d4fe

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tools/CorrelationTestbed/InSandboxScript.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ Param(
66
[String] $OutputPath,
77
[Switch] $UseDev,
88
[Switch] $MetadataCollection,
9-
[String] $System32Path
9+
[String] $System32Path,
10+
[Int32] $GeoID = 0
1011
)
1112

13+
if ($GeoID -ne 0)
14+
{
15+
Write-Host "--> Setting GeoID to $GeoID"
16+
Set-WinHomeLocation -GeoId $GeoID
17+
}
18+
1219
function Get-ARPTable {
1320
$registry_paths = @('HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKCU:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*')
1421
return Get-ItemProperty $registry_paths -ErrorAction SilentlyContinue |

tools/CorrelationTestbed/Test-CorrelationInSandbox.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ if ($MetadataCollection)
242242
Copy-Item -Path $WingetUtilPath -Destination $tempFolder -Force
243243
}
244244

245+
$HostGeoID = (Get-WinHomeLocation).GeoId
246+
245247
# Copy main script
246248

247249
$mainPs1FileName = 'InSandboxScript.ps1'
@@ -262,7 +264,7 @@ foreach ($packageIdentifier in $PackageIdentifiers)
262264
$dependenciesPathsInSandbox = "@('$($vcLibsUwp.pathInSandbox)')"
263265
}
264266

265-
$bootstrapPs1Content = ".\$mainPs1FileName -DesktopAppInstallerDependencyPath @($dependenciesPathsInSandbox) -PackageIdentifier '$packageIdentifier' -SourceName '$Source' -OutputPath '$outPathInSandbox' -System32Path '$system32PathInSandbox'"
267+
$bootstrapPs1Content = ".\$mainPs1FileName -DesktopAppInstallerDependencyPath @($dependenciesPathsInSandbox) -PackageIdentifier '$packageIdentifier' -SourceName '$Source' -OutputPath '$outPathInSandbox' -System32Path '$system32PathInSandbox' -GeoID $HostGeoID"
266268

267269
if ($UseDev)
268270
{

0 commit comments

Comments
 (0)