TakataSanshiro / Chocolatey-Packages

Some packages that can be installed via chocolatey.org
MIT License
15 stars 29 forks source link

AutoHotKey error on PIA clean install Win11 x64 - "line does not contain a recognized action" #87

Closed timkatje closed 12 months ago

timkatje commented 1 year ago

I just ran a clean install of PIA on my Win11 x64 system and received an error message from AutoHotKey during the installation. It does not appear to block the installation, as PIA installed and automatically started.

Side-note, it would be much better if it didn't auto-start as that can interfere with bulk package updates (like when running choco update all). Any packages that attempt to download while the VPN is being established will fail, then any other after tunnel is established will be at lower speeds.

image

Text of error message in case image doesn't upload:

piaInstall.ahk Error: This line does not contain a recognized action.

Text: #NoEnv Line: 1 File: C:\ProgramData\chocolatey\lib\pia\tools\piaInstall.ahk

The program will exit.

TakataSanshiro commented 1 year ago

I have not tried Win11 yet. Your side-note makes sense. But, I don't have a good idea. If someone has any idea, I'll add you as a co-maintainer of the pia package.

slycordinator commented 1 year ago

The package depends on autohotkey-portable, which is currently at version 2.0.2 but the AHK script the package uses has syntax for AHK version 1.

TakataSanshiro commented 1 year ago

@slycordinator Thanks for your information. I’ll try to investigate.

TakataSanshiro commented 1 year ago

I updated the AHK script to v2. I made a prerelease package for testing purposes. https://community.chocolatey.org/packages/pia/290.3.3.120230717-preview01

choco install pia --pre

Installing it automatically in 5 minutes. Please wait. We need more testers.

slycordinator commented 1 year ago

A potential issue is that version 290.3.3.120230717-preview01 depends simply on autohotkey.portable, when it seems like it should depend on autohotkey.portable with version set to ">= 2" or similar.

slycordinator commented 1 year ago

Also, when I uninstall, I get:

Unable to move directory 'C:\ProgramData\chocolatey\lib\pia':
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bkp\pia\290.3.3.120230717-preview01]
Retrying by moving individual files
 Running auto uninstaller...

  Did you know licensed versions of Chocolatey are 95% effective with
   Automatic Uninstaller due to licensed enhancements and Package
   Synchronizer?

For the question below, you have 30 seconds to make a selection.
Uninstall may not be silent (could not detect). Proceed?([Y]es/[[N]o]):

I think the lines with

Run A_ComSpec ' /c "taskkill /F /T /IM pia-service.exe" '
Run A_ComSpec ' /c "taskkill /F /T /IM pia-client.exe" '

may not adequately kill everything.

TakataSanshiro commented 1 year ago

@slycordinator That's right. I've fixed it. added the dependency version. added chocolateyUninstall.ps1 so piaInstall.ahk will not run when choco uninstall pia. https://community.chocolatey.org/packages/pia/290.3.3.120230717-preview02

TakataSanshiro commented 1 year ago

Verification Testing Passed https://community.chocolatey.org/packages/pia/290.3.3.120230717-preview03

TakataSanshiro commented 12 months ago

It looks good. https://community.chocolatey.org/packages/pia/290.3.3.120230717