diff --git a/downloads/guidepup_nvda.zip b/downloads/guidepup_nvda.zip deleted file mode 100644 index 260320b..0000000 Binary files a/downloads/guidepup_nvda.zip and /dev/null differ diff --git a/package.json b/package.json index baef8d0..63aca91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@guidepup/setup", - "version": "0.10.0", + "version": "0.11.0", "description": "Setup your environment for screen-reader automation.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -52,5 +52,6 @@ "inquirer": "^8.2.0", "regedit": "5.0.1", "semver": "^7.3.8" - } + }, + "guidepupNvdaVersion": "0.1.0-2021.3.1" } diff --git a/src/windows/constants.ts b/src/windows/constants.ts index c65b51a..6bb3ff2 100644 --- a/src/windows/constants.ts +++ b/src/windows/constants.ts @@ -1,8 +1,9 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -const { version } = require("../../package.json"); +const { guidepupNvdaVersion } = require("../../package.json"); +export const GUIDEPUP_NVDA_VERSION = guidepupNvdaVersion; export const SUB_KEY_GUIDEPUP_NVDA = "HKCU\\Software\\Guidepup\\Nvda"; -export const VERSIONED_KEY = `guidepup_nvda_${version}`; +export const VERSIONED_KEY = `guidepup_nvda_${GUIDEPUP_NVDA_VERSION}`; export const SUB_KEY_CONTROL_PANEL_DESKTOP = "HKCU\\Control Panel\\Desktop"; export const FOREGROUND_LOCK_TIMEOUT_KEY = "ForegroundLockTimeout"; diff --git a/src/windows/installNvda.ts b/src/windows/installNvda.ts index 5e40fd4..c0e4284 100644 --- a/src/windows/installNvda.ts +++ b/src/windows/installNvda.ts @@ -4,13 +4,13 @@ import { createWriteStream, mkdtempSync, rmSync } from "fs"; import { join } from "path"; import { tmpdir } from "os"; import { ERR_WINDOWS_FAILED_TO_INSTALL_NVDA } from "../errors"; +import { GUIDEPUP_NVDA_VERSION } from "./constants"; const appName = "guidepup_nvda"; -const sourceUrl = `https://raw.githubusercontent.com/guidepup/setup/main/downloads/${appName}.zip`; +const sourceUrl = `https://codeload.github.com/guidepup/nvda/zip/refs/tags/${GUIDEPUP_NVDA_VERSION}`; export async function installNvda(): Promise { const destinationBaseDirectory = mkdtempSync(join(tmpdir(), `${appName}_`)); - const destinationDirectory = join(destinationBaseDirectory, appName); const destinationZip = join(destinationBaseDirectory, `${appName}.zip`); const fileZip = createWriteStream(destinationZip); @@ -57,5 +57,9 @@ export async function installNvda(): Promise { throw new Error(`${ERR_WINDOWS_FAILED_TO_INSTALL_NVDA}\n\n${e.message}`); } - return destinationDirectory; + return join( + destinationBaseDirectory, + `nvda-${GUIDEPUP_NVDA_VERSION}`, + "nvda" + ); }