From adea4a44fcc24c8dec8d5aa695bbe5704a7c5f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Sun, 22 Jan 2023 01:51:09 +0100 Subject: [PATCH 01/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 656218d..11357e5 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Just put the script with the **AppID** followed by the suffix to be considered i > Runs during uninstall (before uninstall check): `AppID-uninstall.ps1` > Runs after uninstall has been confirmed: `AppID-uninstalled.ps1` -If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1` and `-uninstall.ps1`) and also runs when upgrading apps in **WAU**. +If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1` and `-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. `AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install** and doesn't get copied to the **WAU mods** directory. From 72e5aabbd684ec6e2db3e7b8d51aacdfc8f6d729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Sun, 22 Jan 2023 02:04:25 +0100 Subject: [PATCH 02/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11357e5..884dc1c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Just put the script with the **AppID** followed by the suffix to be considered i > Runs during uninstall (before uninstall check): `AppID-uninstall.ps1` > Runs after uninstall has been confirmed: `AppID-uninstalled.ps1` -If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1` and `-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. +If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1` and `-preuninstall.ps1/-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. `AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install** and doesn't get copied to the **WAU mods** directory. From 92a75c602045f066983554b630eaade618315ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Sun, 22 Jan 2023 02:06:42 +0100 Subject: [PATCH 03/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 884dc1c..b04de33 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Just put the script with the **AppID** followed by the suffix to be considered i > Runs during uninstall (before uninstall check): `AppID-uninstall.ps1` > Runs after uninstall has been confirmed: `AppID-uninstalled.ps1` -If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1` and `-preuninstall.ps1/-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. +If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1/-preuninstall.ps1/-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. `AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install** and doesn't get copied to the **WAU mods** directory. From d137f9ea11420cf97981a4625a832d3b5ebfc954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Sun, 22 Jan 2023 02:12:52 +0100 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b04de33..76cb2fb 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Just put the script with the **AppID** followed by the suffix to be considered i If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1/-preuninstall.ps1/-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. -`AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install** and doesn't get copied to the **WAU mods** directory. +`AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install**-. They are deleted from **WAU** on an uninstall (if deployed from **Winget-Install**) From fc009c0e68955f0585f3362f0e5d0c54483752fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Sun, 22 Jan 2023 02:15:17 +0100 Subject: [PATCH 05/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76cb2fb..60a0ebb 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Just put the script with the **AppID** followed by the suffix to be considered i If you're using [**WAU** (Winget-AutoUpdate)](https://github.com/Romanitho/Winget-AutoUpdate) they get copied to the **WAU mods** directory (except `-installed-once.ps1/-preuninstall.ps1/-uninstall.ps1/-uninstalled.ps1`) and also runs when upgrading apps in **WAU**. -`AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install**-. +`AppID-installed-once.ps1` runs instead of `AppID-installed.ps1` from **Winget-Install**. They are deleted from **WAU** on an uninstall (if deployed from **Winget-Install**) From 3c4d1270f0fd1379c1e9b54f546c019efcd7421b Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Mon, 23 Jan 2023 23:35:55 +0100 Subject: [PATCH 06/11] Fix in _Mods-Functions --- mods/_Mods-Functions.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/_Mods-Functions.ps1 b/mods/_Mods-Functions.ps1 index 40ecf98..ec00209 100644 --- a/mods/_Mods-Functions.ps1 +++ b/mods/_Mods-Functions.ps1 @@ -162,7 +162,10 @@ function Remove-ModsLnk ($Lnk) { } function Add-ModsReg ($AddKey, $AddValue, $AddTypeData, $AddType) { - if (!Test-Path "$AddKey") { + if ($AddKey -like "HKEY_LOCAL_MACHINE*") { + $AddKey = $AddKey.replace("HKEY_LOCAL_MACHINE","HKLM:") + } + if (!(Test-Path "$AddKey")) { New-Item $AddKey -Force -ErrorAction SilentlyContinue | Out-Null } New-ItemProperty $AddKey -Name $AddValue -Value $AddTypeData -PropertyType $AddType -Force | Out-Null @@ -170,6 +173,9 @@ function Add-ModsReg ($AddKey, $AddValue, $AddTypeData, $AddType) { } function Remove-ModsReg ($DelKey, $DelValue) { + if ("$DelKey" -like "HKEY_LOCAL_MACHINE*") { + $DelKey = $DelKey.replace("HKEY_LOCAL_MACHINE","HKLM:") + } if (Test-Path "$DelKey") { if (!$DelValue) { Remove-Item $DelKey -Recurse -Force -ErrorAction SilentlyContinue | Out-Null From c19a8192a15bd9ab103c11c368efa54b8f8cca14 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Mon, 23 Jan 2023 23:58:33 +0100 Subject: [PATCH 07/11] Forgot --- mods/_Mods-Functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/_Mods-Functions.ps1 b/mods/_Mods-Functions.ps1 index ec00209..607d3d0 100644 --- a/mods/_Mods-Functions.ps1 +++ b/mods/_Mods-Functions.ps1 @@ -173,7 +173,7 @@ function Add-ModsReg ($AddKey, $AddValue, $AddTypeData, $AddType) { } function Remove-ModsReg ($DelKey, $DelValue) { - if ("$DelKey" -like "HKEY_LOCAL_MACHINE*") { + if ($DelKey -like "HKEY_LOCAL_MACHINE*") { $DelKey = $DelKey.replace("HKEY_LOCAL_MACHINE","HKLM:") } if (Test-Path "$DelKey") { From 61ffe139dd41125062510f714a898455ee35630e Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 24 Jan 2023 02:32:23 +0100 Subject: [PATCH 08/11] MsiZap example in Template --- mods/_AppID-template.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/_AppID-template.ps1 b/mods/_AppID-template.ps1 index bfbcca6..54fe794 100644 --- a/mods/_AppID-template.ps1 +++ b/mods/_AppID-template.ps1 @@ -1,6 +1,8 @@ <# ARRAYS/VARIABLES #> #App to Run (as SYSTEM) -#$RunWait = $False if it shouldn't be waited for completion +#$RunWait = $False if it shouldn't be waited for completion. Example: +#$RunSystem = "C:\ProgramData\Winget-AutoUpdate\mods\bins\MsiZap.exe" +#$RunSwitch = "tw! {GUID}" $RunSystem = "" $RunSwitch = "" $RunWait = $True From 72f4a3a6150522aa9a73198c45d261d80042b1cd Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 24 Jan 2023 03:10:34 +0100 Subject: [PATCH 09/11] $PSScriptRoot\bins\MsiZap.exe for Readme/Template --- mods/_AppID-template.ps1 | 2 +- mods/bins/README.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 mods/bins/README.md diff --git a/mods/_AppID-template.ps1 b/mods/_AppID-template.ps1 index 54fe794..4bbd952 100644 --- a/mods/_AppID-template.ps1 +++ b/mods/_AppID-template.ps1 @@ -1,7 +1,7 @@ <# ARRAYS/VARIABLES #> #App to Run (as SYSTEM) #$RunWait = $False if it shouldn't be waited for completion. Example: -#$RunSystem = "C:\ProgramData\Winget-AutoUpdate\mods\bins\MsiZap.exe" +#$RunSystem = "$PSScriptRoot\bins\MsiZap.exe" #$RunSwitch = "tw! {GUID}" $RunSystem = "" $RunSwitch = "" diff --git a/mods/bins/README.md b/mods/bins/README.md new file mode 100644 index 0000000..dadb40c --- /dev/null +++ b/mods/bins/README.md @@ -0,0 +1,8 @@ +A Directory for placing useful **bins** (**MsiZap.exe** as a really good example) for running via the **Template Function** (https://support.microfocus.com/kb/doc.php?id=7023386): + +#$RunWait = $False if it shouldn't be waited for completion. Example: +#$RunSystem = "$PSScriptRoot\bins\MsiZap.exe" +#$RunSwitch = "tw! {GUID}" +$Run = "" +$RunSwitch = "" +$RunWait = $True From a5b3f6518da1ebf505e99251429f03c2d7160393 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 24 Jan 2023 03:36:56 +0100 Subject: [PATCH 10/11] Readme fix --- mods/bins/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/bins/README.md b/mods/bins/README.md index dadb40c..3d21361 100644 --- a/mods/bins/README.md +++ b/mods/bins/README.md @@ -2,7 +2,7 @@ A Directory for placing useful **bins** (**MsiZap.exe** as a really good example #$RunWait = $False if it shouldn't be waited for completion. Example: #$RunSystem = "$PSScriptRoot\bins\MsiZap.exe" -#$RunSwitch = "tw! {GUID}" +#$RunSwitch = "tw! `{GUID}`" $Run = "" $RunSwitch = "" $RunWait = $True From 13f2c5563328d73b53823a03adbcf1837ac0dcbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Axel=20Johannesson?= <102996177+KnifMelti@users.noreply.github.com> Date: Tue, 24 Jan 2023 16:59:59 +0100 Subject: [PATCH 11/11] Update README.md --- mods/bins/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/bins/README.md b/mods/bins/README.md index 3d21361..810266a 100644 --- a/mods/bins/README.md +++ b/mods/bins/README.md @@ -1,8 +1,8 @@ A Directory for placing useful **bins** (**MsiZap.exe** as a really good example) for running via the **Template Function** (https://support.microfocus.com/kb/doc.php?id=7023386): -#$RunWait = $False if it shouldn't be waited for completion. Example: -#$RunSystem = "$PSScriptRoot\bins\MsiZap.exe" -#$RunSwitch = "tw! `{GUID}`" +#$RunWait = $False if it shouldn't be waited for completion. Example: +#$RunSystem = "$PSScriptRoot\bins\MsiZap.exe" +#$RunSwitch = "tw! `{GUID}`" $Run = "" $RunSwitch = "" $RunWait = $True