Skip to content

install.ps1 fails - Directory test not sufficient if key exists but is empty.  #43

@EscVector

Description

@EscVector

Directory test not sufficient if key is empty.

Certain programs like Anaconda or other Python installs that might have installed into the HKLM, if removed, my leave that path blank. Likewise, with HKCU. If either of these directory checks returns TRUE, but returns zero child objects, the script fails with

You cannot call a method on a null-valued expression.
At C:\Users\admin72014\Projects\oci\oci-cli\scripts\install\install.ps1:108 char:44

  •         If ($installation.Name.EndsWith <<<< ("\InstallPath")) {
    
    • CategoryInfo : InvalidOperation: (EndsWith:String) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

image

Commenting out the empty key allows installation to proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions