Skip to content

Commit

Permalink
Refactor WinDbg install
Browse files Browse the repository at this point in the history
  • Loading branch information
naacbin committed May 28, 2024
1 parent 5aae1f0 commit 50b7c8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions packages/windbg.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ try {
$toolName = 'WinDbg'
$category = 'Debuggers'

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

$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
$executableCmd = Join-Path ${Env:WinDir} "system32\cmd.exe"
# Use `start` to close the open console
$executableArgs = "/C start WinDbgX.exe"
$executableDir = Join-Path ${Env:UserProfile} "Desktop"
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executableCmd -Arguments $executableArgs -WorkingDirectory $executableDir -RunAsAdmin
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
url = $exeUrl
checksum = $exeSha256
checksumType = "sha256"
fileFullPath = Join-Path ${Env:TEMP} "$toolName.msixbundle"
}
Get-ChocolateyWebFile @packageArgs
Add-AppxPackage -Path $packageArgs.fileFullPath

$installDir = (Get-AppxPackage -Name "Microsoft.$toolName").InstallLocation
$executablePath = Join-Path $installDir "DbgX.Shell.exe" -Resolve
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -RunAsAdmin
} catch {
VM-Write-Log-Exception $_
}
Expand Down
2 changes: 1 addition & 1 deletion packages/windbg.vm/windbg.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>windbg.vm</id>
<version>0.0.0</version>
<version>1.2402.24001.20240527</version>
<authors>Microsoft</authors>
<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>
<dependencies>
Expand Down

0 comments on commit 50b7c8b

Please sign in to comment.