Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/uninstall script #285

Merged
merged 21 commits into from
Nov 18, 2024
Merged

Conversation

calvinhzy
Copy link
Contributor

@calvinhzy calvinhzy commented Nov 11, 2024

PR Summary

Add the installation script to facilitate the AIShell installation and uninstallation.

image

image

…e with import-module locking local dll files
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved
tools/scripts/script.ps1 Outdated Show resolved Hide resolved

function Get-PowerShellVersion {
if ([version]$PSVersionTable.PSVersion -lt [version]"7.4.6") {
Write-Warning "[PowerShell version 7.4.6 is the minimum requirement for AIShell module, exiting...]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Write-Warning "[PowerShell version 7.4.6 is the minimum requirement for AIShell module, exiting...]"
Write-Error "PowerShell v7.4.6 is required for using the AIShell module."

I think we should add more content to the message about where to get v7.4.6 PowerShell. Maybe point to the release page https://aka.ms/PowerShell-Release?tag=v7.4.6? /cc @StevenBucher98, thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed we should add where they can install PS 7.4.6

tools/scripts/script.ps1 Outdated Show resolved Hide resolved
elseif ($osArchitecture -eq "Arm64") {
$buildUrl = $osxArm64Url
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no error handling for unsupported architectures

}

# Download AIShell Module
$tempFilesDirectory = Join-Path $destinationDirectory "temp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module will be installed from PowerShellGallery with Install-Module.

Copy link
Member

@daxian-dbw daxian-dbw Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The macOS package is a .tar.gz file, and Expand-Archive doesn't work for it.

@daxian-dbw

This comment was marked as outdated.

$processPath += ";"
}
$aishPath = Get-InstallDirectoryForCurrentOS
[Environment]::SetEnvironmentVariable("PATH", $processPath + $aishPath, "Process")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adding to the process-scope Path doesn't persist the setting. Running aish won't work from a different PowerShell session.
On Unix platform, we don't manipulate the Path environment variable directly, but instead create a symbolic link in a well-known folder that's already in the Path. Think about how Az CLI does it when installing on mac and Linux.

@daxian-dbw
Copy link
Member

@calvinhzy @StevenBucher98 Given the issues with the script and the tight timeline, I rewrote some of the install script to get it ready for try-out and iterative updates. Make sure you sync this branch if you are making code updates.
@calvinhzy Note that I haven't get a chance to test the new implementation yet, so please go-ahead testing and fixing issues that you might find.

if ($Uninstall) {
Uninstall-AIShellModule
} else {
Install-AIShellModule
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Mac, "Currently the AIShell PowerShell module will only work in iTerm2 terminal and still has limited support but if you would like to test it, you can install it with Install-PSResource -Name AIShell -Repository PSGallery -Prerelease. The aish executable is added to your path, please run aish to use the standalone experience"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, but not tested.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed working

@daxian-dbw daxian-dbw merged commit 36563c0 into PowerShell:main Nov 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants