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

WebActions: Launcher can handle webactions #121

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jul 1, 2024

Changelog Description

AYON launcher is capable of handling ayon-launcher scheme using shims.

Additional info

AYON launcher is handling ayon-launcher scheme. On all platfrorms is the handling done using shim as startup executable. This way we have only one executable registered for handling of the scheme without being worried about different AYON launcher versions.

On macOs is scheme defined in shim's plist. On linux we use ayon.desktop which is also used for showing shortcut in apps menu. On windows is necessary to register the scheme, for that is necessary to have admin privileges and installation of shims will ask for them. At this moment this happens only on first shim installation, and there is no easy way how to register it afterwards.

We can prepare .reg file for windows admins so they can easily deploy and register shims without huge amount of job (or maybe just add expected content of reg file to README.md).

Testing notes:

  1. Make sure you have AYON server with these branches WebActions backend ayon-backend#183 and Actions: Browser launcher actions ayon-frontend#563 .
  2. If you've already tested Shims for AYON launcher executables #112 then remove existing deployed shim (%LOCALAPPDATA%\Ynput\AYON\shim`).
  3. Remove .poetry, .venv and vendor folders in AYON launcher root.
  4. Run ./tools/manage.ps1 create-env.
  5. Run ./tools/manage.ps1 install-runtime.
  6. Run ./tools/manage.ps1 build-make-installer.
  7. If all successfully finished then upload installer to your AYON server and install it.
  8. Install ayon-applications addon from this PR Define WebActions ayon-applications#1 and restart server.
  9. Use it in your production or develop bundle.
  10. Select a task of your choice.
  11. You should see applications actions (If you have checked Develop mode, then you'll see actions from dev bundle),
  12. Run one of them.

Advanced testing notes:

You don't have to have build AYON launcher for testing webactions on windows. It is possible to point to a powershell script and create schema handler manually. It must be powershell, because .bat file handles & in argument as "execute following string".

Create <ayon-launcher>/tools/ayon_console.ps1 with this content:

$current_dir = Get-Location
$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$repo_root = (Get-Item $script_dir).parent.FullName
$poetry_home = "$repo_root\.poetry"

Set-Location -Path $repo_root

$arguments=@()
for ($i=0; $i -lt $args.Length; $i++)
{
    $arg = $args[$i].Replace("&", "^&")
    $arguments += $arg
}
try {
    & $poetry_home\bin\poetry.exe run python "$( $repo_root )\start.py" $arguments
} finally {
    Set-Location -Path $current_dir
}

Create file ayon-launcher.reg with this content (replace <FILL THIS PATH> with your path) and open the file.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ayon-launcher]
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ayon-launcher\DefaultIcon]
@="<FILL THIS PATH>\\ayon-launcher\\common\\ayon_common\\resources\\AYON.ico"

[HKEY_CLASSES_ROOT\ayon-launcher\shell]

[HKEY_CLASSES_ROOT\ayon-launcher\shell\open]

[HKEY_CLASSES_ROOT\ayon-launcher\shell\open\command]
@="Powershell.exe -File "<FILL THIS PATH>\\ayon-launcher\\tools\\ayon_console.ps1" \"%1\""

@ynbot
Copy link

ynbot commented Jul 1, 2024

@64qam 64qam self-requested a review August 1, 2024 13:54
@iLLiCiTiT iLLiCiTiT merged commit 84c97c3 into feature/AY-5077_AYON-launcher-shims Aug 1, 2024
@iLLiCiTiT iLLiCiTiT deleted the feature/AY-5950_AYON-Launcher-handle-webactions branch August 1, 2024 13:57
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