Skip to content

Commit

Permalink
Merge pull request #78 from KnifMelti/main
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
Romanitho committed Jan 27, 2023
2 parents cffc13d + 13f2c55 commit f250363
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ 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/-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**)

Expand Down
4 changes: 3 additions & 1 deletion mods/_AppID-template.ps1
Original file line number Diff line number Diff line change
@@ -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 = "$PSScriptRoot\bins\MsiZap.exe"
#$RunSwitch = "tw! {GUID}"
$RunSystem = ""
$RunSwitch = ""
$RunWait = $True
Expand Down
8 changes: 7 additions & 1 deletion mods/_Mods-Functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,20 @@ 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
Return
}

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
Expand Down
8 changes: 8 additions & 0 deletions mods/bins/README.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f250363

Please sign in to comment.