Skip to content

Commit

Permalink
Use correct path to Advanced Installer binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefizso committed Dec 9, 2021
1 parent 620c467 commit 95bd7c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ jobs:
uses: ./
with:
version: ${{ matrix.versions }}
- run: AdvancedInstaller.com /help
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6096,14 +6096,14 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
let version = core.getInput('version');
let toolsPath = _getToolCacheDirectory();
let toolCacheDir = _getToolCacheDirectory();
core.info(`Downloading Advanced Installer release ${version}`);
let downloadFile = path.join(_getTempDirectory(), uuid.v4(), 'advinst.msi');
yield io.mkdirP(path.dirname(downloadFile));
let url = `https://www.advancedinstaller.com/downloads/${version}/advinst.msi`;
let downloadPath = yield tc.downloadTool(url, downloadFile);
core.debug(`Downloaded installer from ${url}`);
let targetPath = `${toolsPath}\\advinst`;
let targetPath = `${toolCacheDir}\\advinst`;
let logFile = `${_getTempDirectory()}\\advinst_install.log`;
let args = [
'/a',
Expand All @@ -6118,9 +6118,10 @@ function run() {
if (exitCode != 0) {
throw new Error(`Failed to install Advanced Installer. Exit code ${exitCode}.`);
}
let binPath = path.join(targetPath, 'bin\\x86');
core.debug(`Configuring paths with Advanced Installer`);
core.exportVariable('ADVANCEDINSTALLER_ROOT', targetPath);
core.addPath(targetPath);
core.exportVariable('ADVANCEDINSTALLER_ROOT', binPath);
core.addPath(binPath);
core.info(`Successfully installed Advanced Installer ${version}`);
}
catch (error) {
Expand Down
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as uuid from 'uuid';
async function run() {
try {
let version = core.getInput('version');
let toolsPath = _getToolCacheDirectory();
let toolCacheDir = _getToolCacheDirectory();

core.info(`Downloading Advanced Installer release ${version}`);

Expand All @@ -20,7 +20,7 @@ async function run() {
let downloadPath = await tc.downloadTool(url, downloadFile);
core.debug(`Downloaded installer from ${url}`);

let targetPath = `${toolsPath}\\advinst`;
let targetPath = `${toolCacheDir}\\advinst`;
let logFile = `${_getTempDirectory()}\\advinst_install.log`;

let args = [
Expand All @@ -38,9 +38,10 @@ async function run() {
throw new Error(`Failed to install Advanced Installer. Exit code ${exitCode}.`);
}

let binPath = path.join(targetPath, 'bin\\x86');
core.debug(`Configuring paths with Advanced Installer`);
core.exportVariable('ADVANCEDINSTALLER_ROOT', targetPath);
core.addPath(targetPath);
core.exportVariable('ADVANCEDINSTALLER_ROOT', binPath);
core.addPath(binPath);

core.info(`Successfully installed Advanced Installer ${version}`);
} catch (error: any) {
Expand Down

0 comments on commit 95bd7c2

Please sign in to comment.