wingetautoupdate/Sources/Winget-AutoUpdate/mods/README.md

32 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2023-09-03 22:47:31 +00:00
### Mods for WAU (if Network is active/any Winget is installed/running as SYSTEM):
Custom script should be placed here.
A script **Template** `_WAU-mods-template.ps1` is included to get you started.
Rename it to `_WAU-mods.ps1` if you want to activate/run it via `Winget-Upgrade.ps1`.
2023-11-25 21:39:37 +00:00
### AppID Pre/During/Post install/uninstall:
2023-01-29 01:45:15 +00:00
Custom scripts should be placed here.
A script **Template** and **Mods Functions** are included as an **example** to get you started...
2022-12-20 01:50:11 +00:00
2022-12-20 02:19:46 +00:00
Scripts that are considered:
2023-11-24 18:33:35 +00:00
**AppID**`-preinstall.ps1`, `-upgrade.ps1`, `-install.ps1`, `-installed.ps1` or `-notinstalled.ps1`.
2023-01-29 01:45:15 +00:00
(`-preuninstall.ps1`, `-uninstall.ps1` or `-uninstalled.ps1` - if used together with [Winget-Install](https://github.com/Romanitho/Winget-Install)).
2023-11-25 21:39:37 +00:00
>- Runs before upgrade/install: `AppID-preinstall.ps1`
>- Runs during upgrade/install (before install check): `AppID-upgrade.ps1`/`AppID-install.ps1`
>- Runs after upgrade/install has been confirmed: `AppID-installed.ps1`
>- Runs after a failed upgrade/install: `AppID-notinstalled.ps1`
>- Runs after a failed upgrade/install: `_WAU-notinstalled.ps1` (any individual `AppID-notinstalled.ps1` overrides this global one)
2023-01-06 23:53:53 +00:00
2023-01-06 23:55:20 +00:00
The **-install** mod will be used for upgrades too if **-upgrade** doesn't exist (**WAU** first tries `& $Winget upgrade --id` and if the app isn't detected after that `& $Winget install --id` is tried).
2023-01-29 01:45:15 +00:00
2023-01-06 23:53:53 +00:00
`AppID-install.ps1` is recommended because it's used in **both** scenarios.
2022-12-20 02:19:46 +00:00
2023-11-25 21:39:37 +00:00
A script **Template** for an all-purpose mod (`_WAU-notinstalled-template.ps1`) is included in which actions can be taken if an upgrade/install fails for any **AppID** (any individual `AppID-notinstalled.ps1` overrides this global one)
Name it `_WAU-notinstalled.ps1` for activation
2023-01-29 01:45:15 +00:00
### Winget native parameters:
Another finess is the **AppID** followed by the `-override` suffix as a **text file** (**.txt**).
> Example:
> **Canneverbe.CDBurnerXP-override.txt** with the content `ADDLOCAL=All REMOVE=Desktop_Shortcut /qn`
This will use the **content** of the text file as a native **winget --override** parameter in **WAU upgrading**.