ynput / ayon-launcher

AYON desktop application launcher
Apache License 2.0
31 stars 13 forks source link

Shim cannot be updated if shim is used as main executable #151

Open iLLiCiTiT opened 3 weeks ago

iLLiCiTiT commented 3 weeks ago

Current Behavior:

It is not really issue at this exact moment. If future version of ayon-launcher should update shim, it can fail because the shim is actually in use.

What might happen:

  1. Launch shim.
  2. Shim launches AYON launcher.
  3. AYON launcher finds out it has to update to newer version of AYON launcher.
  4. Downloads and installs AYON launcher.
  5. Starts new version of AYON launcher.
  6. New AYON launcher has newer version of shim.
  7. It tries to install it, but fails because shim from 1.) is still running.

Expected Behavior:

We might need to find a better way how to handle shim updates?

Only way I can think of is to install shim under versioned folders and the main executable would be writte n in c. So it is really minimalistic, can find latest shim to use and launch it -> shim for a shim?

/shim
    /ayon - executable written in c (on macOs it would not live here but in `/Applications/AYON.app`)
    /versions - folder where the current shim content is, under coresponding version folder
        /1.0.0
            /ayon - shim 1.0.0
        /1.0.1
            /ayon - shim 1.0.1

Alternative solution

We might find out if it's in use by "moving" existing shim folder. If it fails, then copy installer file to desktop/downloads and show/print message to close all AYON instances and install it manually.