Skip to content

Commit 47425c2

Browse files
authored
Merge pull request #1058 from mandiant/windbg-install
Refactor WinDbg install
2 parents ceea06e + 287aeda commit 47425c2

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

packages/windbg.vm/tools/chocolateyinstall.ps1

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@ try {
55
$toolName = 'WinDbg'
66
$category = 'Debuggers'
77

8-
# It seems WinDbg is now distributed as an .appinstaller and we need to install it using Add-AppxPackage
9-
Add-AppxPackage -AppInstallerFile 'https://windbg.download.prss.microsoft.com/dbazure/prod/1-0-0/windbg.appinstaller'
8+
$bundleVersion = "1-2402-24001"
9+
$bundleUrl = "https://windbg.download.prss.microsoft.com/dbazure/prod/$bundleVersion-0/windbg.msixbundle"
10+
$bundleSha256 = "e941076cb4d7912d32a22ea87ad2693c01fa465227b4d1ead588283518de428f"
1011

11-
$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
12-
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
13-
$executableCmd = Join-Path ${Env:WinDir} "system32\cmd.exe"
14-
# Use `start` to close the open console
15-
$executableArgs = "/C start WinDbgX.exe"
16-
$executableDir = Join-Path ${Env:UserProfile} "Desktop"
17-
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executableCmd -Arguments $executableArgs -WorkingDirectory $executableDir -RunAsAdmin
12+
$packageArgs = @{
13+
packageName = ${Env:ChocolateyPackageName}
14+
url = $bundleUrl
15+
checksum = $bundleSha256
16+
checksumType = "sha256"
17+
fileFullPath = Join-Path ${Env:TEMP} "$toolName.msixbundle"
18+
}
19+
Get-ChocolateyWebFile @packageArgs
20+
Add-AppxPackage -Path $packageArgs.fileFullPath
21+
22+
$toolPackage = Get-AppxPackage -Name "Microsoft.$toolName"
23+
$iconLocation = Join-Path $toolPackage.InstallLocation "DbgX.Shell.exe" -Resolve
24+
$executablePath = "shell:AppsFolder\$($toolPackage.PackageFamilyName)!$($toolPackage.Name)"
25+
26+
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -iconLocation $iconLocation -RunAsAdmin
1827
} catch {
1928
VM-Write-Log-Exception $_
2029
}
21-

packages/windbg.vm/windbg.vm.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
33
<metadata>
44
<id>windbg.vm</id>
5-
<version>0.0.0</version>
5+
<version>1.2402.24001.20250124</version>
66
<authors>Microsoft</authors>
77
<description>WinDbg is a debugger that can be used to analyze crash dumps, debug live user-mode and kernel-mode code, and examine CPU registers and memory.</description>
88
<dependencies>

0 commit comments

Comments
 (0)