Skip to content

Commit

Permalink
fix windows pdf reader path and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadtdyy committed Jun 17, 2024
1 parent 5538445 commit 687e461
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/xcpc-tools",
"version": "1.0.2",
"version": "1.0.3",
"description": "A tools for XCPC contests",
"main": "index.ts",
"repository": "https://github.com/Hydro-dev/xcpc-tools",
Expand Down
6 changes: 4 additions & 2 deletions packages/server/utils/printers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export function initWinPrinter() {
'./SumatraPDF.exe',
path.resolve(__dirname, 'SumatraPDF.exe'),
path.resolve(process.cwd(), 'SumatraPDF.exe'),
'C:\\Program Files\\SumatraPDF\\SumatraPDF.exe',
'C:\\Program Files (x86)\\SumatraPDF\\SumatraPDF.exe',
path.resolve(process.env.ProgramFiles, 'SumatraPDF\\SumatraPDF.exe'),
path.resolve(process.env['ProgramFiles(x86)'], 'SumatraPDF\\SumatraPDF.exe'),
path.resolve(process.env.LOCALAPPDATA, 'SumatraPDF\\SumatraPDF.exe'),
path.resolve(process.env.APPDATA, 'SumatraPDF\\SumatraPDF.exe'),
];
const sumatraPdfPath = execPath.find((p) => fs.existsSync(p));
if (!sumatraPdfPath) {
Expand Down

0 comments on commit 687e461

Please sign in to comment.