Romanitho / Winget-AutoUpdate

WAU daily updates apps as system and notify connected users. (Allowlist and Blocklist support)
MIT License
1.06k stars 132 forks source link

[Bug/Feature Request]: Some Apps need to be closed when updating #302

Closed AcpPasc closed 1 year ago

AcpPasc commented 1 year ago

The problem

I noticed on some Applications that either the Update Freezes or "Updates" and if i check in the App it is still the Old Vserion. In my Case it was on the AppIDs:

Found KeePass [DominikReichl.KeePass] Version 2.53.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.53.1/KeePass-2.53.1-Setup.exe/download -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/

███████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 1024 KB / 4.20 MB ██████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 2.00 MB / 4.20 MB ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 2.20 MB / 4.20 MB ██████████████████████▒▒▒▒▒▒▒▒ 3.20 MB / 4.20 MB ██████████████████████████████ 4.20 MB / 4.20 MB ██████████████████████████████ 4.20 MB / 4.20 MB Successfully verified installer hash Starting package install...



I am using admx via Intune to Set the Update list. 
I would like to set a notification as Popup to the User to Close the related App if it needs to be Closed (if possible with Configurable Time to do so or skip the App for this run)
If i find a way to do so i will post it.

### What version of WAU has the issue?

1.16.4

### What version of Windows are you using (ex. Windows 11 22H2)?

Win11 22H2

### What version of winget are you using?

v1.4.10173

### Log information

_No response_

### Additional information

_No response_
KnifMelti commented 1 year ago

WAU can't possibly know the process name to kill for individual apps. But, you know the process name. Make a mod for KeePass Password Safe (DominikReichl.KeePass-preinstall.ps1 under mods folder) with for example the code from following post (using KeePass process name/excluding the last line): https://github.com/Romanitho/Winget-AutoUpdate/issues/239#issue-1465009147

KnifMelti commented 1 year ago

https://github.com/Romanitho/Winget-AutoUpdate#custom-scripts-mods-feature

AcpPasc commented 1 year ago

https://github.com/Romanitho/Winget-AutoUpdate#custom-scripts-mods-feature

My Issue was also a way to deploy it with intune but I think your idea/solution Helped:

  1. I Used the _APPID-Template.ps1 as Baseline für a preinstall
  2. Utilized the Wait function but that alone would mean it probalby would never Update
  3. Added a Few Lines that use the Start-NotifTask Function to Inform the use to Close the App image

This Preinstaller Script gets Deployed by my Intune Installer and placed to the Mod Folder. Only Issues to note:

  1. Yes you could Kill the Process (not Recommended if Stuff is not Saved).
  2. if the user Ignores the Request/does not close the App/is on DND and does not see the Notification: all fllowing Updates won't be installed (maybe installed on the next run)
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

danielbessler commented 1 year ago

https://github.com/Romanitho/Winget-AutoUpdate#custom-scripts-mods-feature

My Issue was also a way to deploy it with intune but I think your idea/solution Helped:

  1. I Used the _APPID-Template.ps1 as Baseline für a preinstall
  2. Utilized the Wait function but that alone would mean it probalby would never Update
  3. Added a Few Lines that use the Start-NotifTask Function to Inform the use to Close the App image

This Preinstaller Script gets Deployed by my Intune Installer and placed to the Mod Folder. Only Issues to note:

  1. Yes you could Kill the Process (not Recommended if Stuff is not Saved).
  2. if the user Ignores the Request/does not close the App/is on DND and does not see the Notification: all fllowing Updates won't be installed (maybe installed on the next run)

Could you share your few lines with us 😇

AcpPasc commented 1 year ago

It is basically the "C:\ProgramData\Winget-AutoUpdate\mods_AppID-template.ps1" i have edited the following:

  1. $Wait = @("KeePass")
  2. User Notify (in German)
    Write-Log "Notify User to Close $($app.Name)" "Cyan"
    $Title = "{0} wartet auf Update" -f "$($app.Name)"
    $Message = "Bitte speichern und beenden Sie die KeePass Applikation, damit diese Updates installieren kann."
    $MessageType = "warning"
    $Balise = $($app.Name)
    Start-NotifTask -Title $Title -Message $Message -MessageType $MessageType -Balise $Balise -Button1Action $ReleaseNoteURL -Button1Text $Button1Text

    And saved it as 'DominikReichl.KeePass-preinstall.ps1'