$MissingComponents returns $false if any prereq is already installed
Closed this issue · 3 comments
Describe the bug
Issue in:
https://github.com/VeeamHub/powershell/blob/master/BR-UnattendedInstall-v10/Install_Veeam.ps1
On line 142
The script checks for any missing Components and missing Prerequisites.
If any of the Prerequisites ISN'T missing, then none of Components and Prerequisites are installed.
Erroneous code snippet:
$MissingComponents = [bool]($Script:dotNETRequired -AND $Script:LicenseFileMissing -AND $Script:SQL2014_CLR_Missing -AND $Script:SQL2014_SMO_Missing -AND $Script:MSReportViewer2015_Missing)
To Reproduce
Steps to reproduce the behavior:
[bool]$dotNETRequired = $false
[bool]$SQL2014_CLR_Missing = $true
[bool]$SQL2014_SMO_Missing = $true
[bool]$MSReportViewer2015_Missing = $true
[bool]$LicenseFileMissing = $true
$MissingComponents = [bool]($dotNETRequired -AND $SQL2014_CLR_Missing -AND $SQL2014_SMO_Missing -AND $MSReportViewer2015_Missing)
$MissingComponents
Expected behavior
$MissingComponents should be $true if any Components or Prerequisites is missing.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [Windows Server 2019]
- Version [Veeam VBR 10a]
Additional context
Not exactly sure how to handle this logic.
Looks like a logic error.
Changing from:
$MissingComponents = [bool]($Script:dotNETRequired -AND $Script:LicenseFileMissing -AND $Script:SQL2014_CLR_Missing -AND $Script:SQL2014_SMO_Missing -AND $Script:MSReportViewer2015_Missing)
To:
$MissingComponents = [bool]($Script:dotNETRequired -OR $Script:LicenseFileMissing -OR $Script:SQL2014_CLR_Missing -OR $Script:SQL2014_SMO_Missing -OR $Script:MSReportViewer2015_Missing)
Please test and follow-up. If it works for you, please submit a PR for the change.
Awesome! I'm OOO this week. I'll review this next week.