diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f81bd6..b53c5c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,25 @@ All notable changes to the [`alteryx-deploy`](https://github.com/Akaizoku/altery The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.2](https://github.com/Akaizoku/alteryx-deploy/releases/2.0.2) - 2024-12-12 + +Error handling + +### Fixed + +- Invoke-DownloadAlteryx: Fixed an issue with expired license API refresh token causing the script to error ([#39](https://github.com/Akaizoku/alteryx-deploy/issues/39)) +- Invoke-SetupScript: Fixed an issue with invalid or corrupted encrypted key or license files causing the script to error ([#40](https://github.com/Akaizoku/alteryx-deploy/issues/40)) + ## [2.0.1](https://github.com/Akaizoku/alteryx-deploy/releases/2.0.1) - 2024-10-20 Fix key encryption and decryption issues. ### Fixed -- Fixed an issue with license API token and keys encryption during setup [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] -- Fixed an issue with license API token and keys decryption during download [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] -- Fixed an issue when license keys decryption during activation [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] -- Fixed an issue when license keys decryption during deactivation [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] +- Fixed an issue with license API token and keys encryption during setup ([#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)) +- Fixed an issue with license API token and keys decryption during download ([#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)) +- Fixed an issue when license keys decryption during activation ([#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)) +- Fixed an issue when license keys decryption during deactivation ([#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)) - Fixed an issue when attempting to redownload an existing major version without any patch available ## [2.0.0](https://github.com/Akaizoku/alteryx-deploy/releases/2.0.0) - 2024-10-08 diff --git a/README.md b/README.md index 0ac4821..f49b04f 100644 --- a/README.md +++ b/README.md @@ -562,8 +562,7 @@ Below is an example of a successful installation log: This module depends on the usage of functions provided by two PowerShell modules: 1. PowerShell Tool Kit ([PSTK]) module (version 1.2.6); -2. Alteryx PowerShell ([PSAYX]) module (version 1.1.1). -2. Alteryx PowerShell ([PSAYX]) module (version 1.1.1). +2. Alteryx PowerShell ([PSAYX]) module (version 1.1.2). ## Compatibility @@ -571,14 +570,15 @@ Below are listed the compatible versions for each of the release. Only the first version supported is listed. Later releases should also be compatible as long as no breaking change has been introduced. Please refer to the [Alteryx release notes](https://help.alteryx.com/release-notes) for more information. -| `alteryx-deploy` | Alteryx | PowerShell | [PSTK] | [PSAYX] | -| ---------------- | -------- | ---------- | ------ | ------- | -| [1.0.0] | [2021.3] | 5.0 | 1.2.4 | 1.0.0 | -| [1.1.0] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | -| [1.1.1] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | -| [1.1.2] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | -| [2.0.0] | [2024.1] | 5.1 | 1.2.6 | 1.1.1 | -| [2.0.1] | [2024.2] | 5.1 | 1.2.6 | 1.1.1 | +| `alteryx-deploy` | Alteryx | PowerShell | [PSTK] | [PSAYX] | +| ---------------: | -------: | ---------: | -----: | ------: | +| [1.0.0] | [2021.3] | 5.0 | 1.2.4 | 1.0.0 | +| [1.1.0] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | +| [1.1.1] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | +| [1.1.2] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | +| [2.0.0] | [2024.1] | 5.1 | 1.2.6 | 1.1.1 | +| [2.0.1] | [2024.2] | 5.1 | 1.2.6 | 1.1.1 | +| [2.0.2] | [2024.2] | 5.1 | 1.2.6 | 1.1.2 | ## Known issues @@ -611,6 +611,8 @@ If this occurs, simply run the command [`Stop-Transcript`](https://learn.microso [1.1.1]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.1 [1.1.2]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.2 [2.0.0]:https://github.com/Akaizoku/alteryx-deploy/releases/2.0.0 +[2.0.1]:https://github.com/Akaizoku/alteryx-deploy/releases/2.0.1 +[2.0.2]:https://github.com/Akaizoku/alteryx-deploy/releases/2.0.2 [2021.3]:https://help.alteryx.com/release-notes/server/server-20213-release-notes [2024.1]:https://help.alteryx.com/release-notes/en/release-notes/server-release-notes/server-2024-1-release-notes.html [2024.2]:https://help.alteryx.com/release-notes/en/release-notes/server-release-notes/server-2024-2-release-notes.html diff --git a/powershell/Invoke-DownloadAlteryx.ps1 b/powershell/Invoke-DownloadAlteryx.ps1 index 763b9b0..c5ab250 100644 --- a/powershell/Invoke-DownloadAlteryx.ps1 +++ b/powershell/Invoke-DownloadAlteryx.ps1 @@ -10,7 +10,7 @@ function Invoke-DownloadAlteryx { File name: Invoke-DownloadAlteryx.ps1 Author: Florian Carrier Creation date: 2024-09-04 - Last modified: 2024-11-20 + Last modified: 2024-12-10 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -55,7 +55,6 @@ function Invoke-DownloadAlteryx { $RegistryKey = "HKLM:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SRC\Alteryx" # License API refresh token $LicenseAPIPath = Join-Path -Path $Properties.ResDirectory -ChildPath $Properties.LicenseAPIFile - $RefreshToken = ([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath))))) -replace "`r|`n", "" # Placeholder $Skip = $false } @@ -65,6 +64,18 @@ function Invoke-DownloadAlteryx { # ------------------------------------------------------------------------------ # * Checks # ------------------------------------------------------------------------------ + # Retrieve license API refresh token + try { + $RefreshToken = ([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath))))) -replace "`r|`n", "" + } + catch { + Write-Log -Type "ERROR" -Message (Get-PowerShellError) + Write-Log -Type "ERROR" -Message "Cannot read license API refresh token" + Write-Log -Type "WARN" -Message "Run setup to reconfigure" + $DownloadProcess = Update-ProcessObject -ProcessObject $DownloadProcess -Status "Failed" -ErrorCount 1 -ExitCode 1 + return $DownloadProcess + } + # Check refresh token if ($null -eq $RefreshToken) { Write-Log -Type "ERROR" -Message "The Alteryx license portal API refresh token has not been configured" if (-Not $Unattended) { @@ -75,6 +86,7 @@ function Invoke-DownloadAlteryx { return $DownloadProcess } } + # Check license account ID if ($null -eq $Properties.LicenseAccountID) { Write-Log -Type "ERROR" -Message "The AccountID parameter has not been configured" if (-Not $Unattended) { diff --git a/powershell/Invoke-SetupScript.ps1 b/powershell/Invoke-SetupScript.ps1 index 240c567..52887f7 100644 --- a/powershell/Invoke-SetupScript.ps1 +++ b/powershell/Invoke-SetupScript.ps1 @@ -10,7 +10,7 @@ function Invoke-SetupScript { File name: Invoke-SetupScript.ps1 Author: Florian Carrier Creation date: 2022-05-03 - Last modified: 2024-11-20 + Last modified: 2024-12-10 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -237,7 +237,17 @@ function Invoke-SetupScript { $LicenseFilePath = Join-Path -Path "$PSScriptRoot/.." -ChildPath "$($Properties.ResDirectory)/$($Properties.LicenseFile)" $ConfigureLicenseFile = $true if (Test-Path -Path $LicenseFilePath) { - $LicenseKeys = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) + # Load license keys + try { + $LicenseKeys = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) + } + catch { + Write-Log -Type "ERROR" -Message (Get-PowerShellError) + Write-Log -Type "ERROR" -Message "License keys could not be read" + $SetupProcess = Update-ProcessObject -ProcessObject $SetupProcess -ErrorCount 1 + $LicenseKeys = $null + } + # Check license keys if ($LicenseKeys -notin ($null, "")) { Write-Log -Type "WARN" -Message "License keys have already been configured" $ConfigureLicenseFile = Confirm-Prompt -Prompt "Do you want to overwrite the existing license keys?"