@@ -4,7 +4,7 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin
44import { setupBrewPack } from "../utils/setup/setupBrewPack"
55import { setupChocoPack } from "../utils/setup/setupChocoPack"
66import { addBinExtension } from "../utils/extension/extension"
7- import { extractTar } from "../utils/setup/extract"
7+ import { extractTar , extractZip } from "../utils/setup/extract"
88import { notice } from "../utils/io/io"
99import { setupGraphviz } from "../graphviz/graphviz"
1010import { getVersion } from "../default_versions"
@@ -23,6 +23,16 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
2323 url : `https://www.doxygen.nl/files/${ folderName } .linux.bin.tar.gz` ,
2424 }
2525 }
26+ case "win32" : {
27+ const folderName = `doxygen-${ version } `
28+ return {
29+ binRelativeDir : "bin/" ,
30+ binFileName : addBinExtension ( "doxygen" ) ,
31+ extractedFolderName : folderName ,
32+ extractFunction : extractZip ,
33+ url : `https://www.doxygen.nl/files/${ folderName } .windows.x64.bin.zip` ,
34+ }
35+ }
2636 default :
2737 throw new Error ( `Unsupported platform '${ platform } '` )
2838 }
@@ -31,10 +41,17 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
3141export async function setupDoxygen ( version : string , setupDir : string , arch : string ) {
3242 switch ( process . platform ) {
3343 case "win32" : {
34- await setupChocoPack ( "doxygen.install" , version )
44+ let installationInfo : InstallationInfo
45+ try {
46+ installationInfo = await setupBin ( "doxygen" , version , getDoxygenPackageInfo , setupDir , arch )
47+ } catch ( err ) {
48+ notice ( `Failed to download doxygen binary. ${ err } . Falling back to choco.` )
49+ await setupChocoPack ( "doxygen.install" , version )
50+ const binDir = activateWinDoxygen ( )
51+ installationInfo = { binDir }
52+ }
3553 await setupGraphviz ( getVersion ( "graphviz" , undefined ) , "" , arch )
36- const binDir = activateWinDoxygen ( )
37- return { binDir }
54+ return installationInfo
3855 }
3956 case "darwin" : {
4057 const installationInfo = setupBrewPack ( "doxygen" , undefined )
0 commit comments