Skip to content

Commit

Permalink
README: Add manual instructions for upgrading Pog
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejKafka committed Apr 9, 2024
1 parent fb97108 commit e777ed1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ Alternatively, you can manually install Pog by following these steps:
3. Download and unpack the archive to your preferred directory for portable applications.
4. Run `Pog/setup.cmd`.

### Upgrading an existing installation of Pog

Ideally, I would like Pog to be able to update itself. However, it internally uses a compiled .NET assembly, which gets loaded automatically when Pog is imported and PowerShell provides no way to unload assemblies other than exiting the whole process, meaning that Pog must not be running when it is updated. Before I devise a better solution, do the following steps manually when you want to upgrade:

1. Exit all instances of PowerShell where Pog was invoked.
2. Manually download the target release archive.
3. Enter the `Pog` directory, where Pog is installed.
4. Delete everything except for the `cache` and `data` directory.
5. Copy the contents of the `Pog` directory from the archive into the `Pog` directory from step 3.
6. Run the extracted `setup.cmd` script.

## Basic usage

Install a package (use `Tab` to get a list of matching packages):
Expand Down
13 changes: 13 additions & 0 deletions app/Pog/_knowledge/Pog self-update.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
the `app` directory can be moved while Pog is running from it, it just cannot be deleted
however, the first time we attempt to load something from the app directory (e.g. container Env_*.psm1), it will fail

we could do a custom update system, which
1) ensures that no other PowerShell instance has Pog loaded
2) moves `app` to `app-old`
3) unpacks the new version, WITHOUT loading any pwsh file or dll (must not call the container)
the hard part
4) configures the new Pog version (ideally by running `Enable`, but that's gonna be hard)
5) launches a detached background process which waits until user closes the last loaded Pog instance and then deletes the old directory
6) prompt the user to close the current shell

TODO: still quite wonky, check how other similar software does it

0 comments on commit e777ed1

Please sign in to comment.