Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update specific apps #36

Closed
KnifMelti opened this issue Apr 4, 2022 · 22 comments · Fixed by #38
Closed

Only update specific apps #36

KnifMelti opened this issue Apr 4, 2022 · 22 comments · Fixed by #38
Labels
enhancement New feature or request

Comments

@KnifMelti
Copy link
Contributor

KnifMelti commented Apr 4, 2022

As an alternative to the 'excluded_apps.txt' it would be nice to have a 'included_apps.txt' for whitelisting purpose, i.e when specifik apps are installed via SCCM that list could be updated and WAU should only update these, not anything else.

@Romanitho Romanitho added the enhancement New feature or request label Apr 5, 2022
@Romanitho
Copy link
Owner

Hi.
Thanks for your comment. It was in my mind, so thanks to have written it down.
Just thinking about the best way to have white and black list options in install script.

@KnifMelti
Copy link
Contributor Author

My take on this is:
If there exist a white list (populated or unpopulated) then nothing gets updated until the white list gets populated.
I'm saving all our apps that we let the users manage as Available in SCCM in registry as Detection Method under HKEY_LOCAL_MACHINE\SOFTWARE\Winget
InstEd.InstEd=Installed
TimKosse.FileZilla.Client=Uninstalled
etc.

If/when there's a whitelist for WAU I'm gonna populate the list from the registry when users install/uninstall an app from SCCM

@Romanitho
Copy link
Owner

v1.7.0 published as pre-release for testing.

You can now use white list to only maintain app you want.

Juste create an included_apps.txt next to excluded_apps.txt, add the apps in list and run ".\Winget-AutoUpdate-Install.ps1 -UseWhiteList"

@KnifMelti
Copy link
Contributor Author

Nice solution (populated or not)!
#White List or Black List apps if ($UseWhiteList){ if (Test-Path "$PSScriptRoot\included_apps.txt"){ Copy-Item -Path "$PSScriptRoot\included_apps.txt" -Destination $WingetUpdatePath -Recurse -Force -ErrorAction SilentlyContinue } else{ New-Item -Path $WingetUpdatePath -Name "included_apps.txt" -ItemType "file" -ErrorAction SilentlyContinue } } else { Copy-Item -Path "$PSScriptRoot\excluded_apps.txt" -Destination $WingetUpdatePath -Recurse -Force -ErrorAction SilentlyContinue }

@Romanitho
Copy link
Owner

The idea if you use White List is :
if a file exists, keep it
if no file, create empty one

And if you use Winget-Install, you can install apps and use the "-WAUWhiteList" switch to add the app to white list when it's installed

@KnifMelti
Copy link
Contributor Author

Wonderful!
Used your WAU (stripped version) for install/repair (update)/uninstall single apps in SCCM before (because of the non existing whitelist feature in WAU.
In that way users could manually update single apps from Software Center.
Going to abandon my own additions and begin using your Winget-Install + WAU and $WAUWhiteList instead!
Thanks!

@Romanitho
Copy link
Owner

glad it helped ;)

@Romanitho Romanitho linked a pull request Apr 8, 2022 that will close this issue
@kylejericson
Copy link

Need some help with the whitelist file. I'm installing this via Intune and I wrapped my whitelist file inside the win32 app file. I seem to be getting this error. How should I fix existing devices and my new deployments via Intune.

Screenshot-08-13-01-AM

Screenshot-08-13-16-AM

@KnifMelti
Copy link
Contributor Author

KnifMelti commented Jul 26, 2023

Hi!
Don't include ‐Listpath in your install. It will find the list itself (default).
But, you must use the -UseWhiteList parameter!

@kylejericson
Copy link

Ok so for those that were deployed with the ‐Listpath is there a way to fix them after the fact?

@Romanitho
Copy link
Owner

Yes, simply redeploy WAU.

@kylejericson
Copy link

Does this look like it's working?

Screenshot-11-47-18-AM

@kylejericson
Copy link

My folder contents:

Screenshot-11-47-49-AM

@KnifMelti
Copy link
Contributor Author

Could you in a terminal manually run the command winget upgrade --source winget and post the output, please!

@kylejericson
Copy link

Screenshot-12-12-18-AM

@KnifMelti
Copy link
Contributor Author

Strange then...
...there's the string of dashes (when there's not the message of An unusual... pops up).
Are those apps in your white list?

@kylejericson
Copy link

No this is my whitelist.

Google.Chrome
AgileBits.1Password
Perimeter81Ltd.Perimeter81Ltd
SlackTechnologies.Slack
Zoom.Zoom

@KnifMelti
Copy link
Contributor Author

Well, run the same command as before as system in a terminal (psexec or nirsoft advanced run) and post the output.

@KnifMelti
Copy link
Contributor Author

KnifMelti commented Aug 1, 2023

https://www.nirsoft.net/utils/advanced_run.html
But then you must give the path to your system winget too.
I'm not on keyboard at my pc.

@KnifMelti
Copy link
Contributor Author

Your system winget is under C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.20.1881.0_x64__8wekyb3d8bbwe

@Romanitho
Copy link
Owner

I agree, in your case we need to see what winget returns in system context.

@KnifMelti
Copy link
Contributor Author

Or/and the log from after ($upgradeResult is transferred to the log):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants