Skip to content

Commit

Permalink
Merge pull request #28 from Romanitho/Mods
Browse files Browse the repository at this point in the history
Mods feature in readme
  • Loading branch information
Romanitho authored Apr 23, 2022
2 parents bc7be93 + 554ea43 commit 89dbd9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Powershell scripts to install Winget Packages with SCCM/Intune (or similar) or e
### SCCM
- Create an application and put the "winget-install.ps1" script as sources
- For install command, put this command line:
>powershell.exe -ExecutionPolicy bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++
> powershell.exe -ExecutionPolicy bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++
![image](https://user-images.githubusercontent.com/96626929/152222570-da527307-ecc9-4fc2-b83e-7891ffae36ee.png)

### Intune
- Create Intunewin with the "winget-install.ps1" script
- Create a Win32 application in Intune
- Put this command line as Install Cmd
>powershell.exe -ExecutionPolicy Bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++
> powershell.exe -ExecutionPolicy Bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++
### Use Winget native parameters
You can add custom parameter in your `AppIDs` argument. Don't forget to escape the quote:
Expand All @@ -27,21 +27,33 @@ Details: https://github.com/Romanitho/Winget-Install/discussions/20
## Detection method
- Use the "winget-detect.ps1" with SCCM or Intune as detection method.
- Replace "$AppToDetect" value by your App ID
>$AppToDetect = "Notepad++.Notepad++"
> $AppToDetect = "Notepad++.Notepad++"
## Updates
https://github.com/Romanitho/Winget-autoupdate

## Uninstall
- To uninstall an app, you can use:
>powershell.exe -ExecutionPolicy bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++ -Uninstall
> powershell.exe -ExecutionPolicy bypass -File winget-install.ps1 -AppIDs Notepad++.Notepad++ -Uninstall
but most of the time, winget does not manage silent uninstall correcty.
- I would suggest to use the original application uninstaller method, something like this:
>C:\Program Files\Notepad++\uninstall.exe /S
> C:\Program Files\Notepad++\uninstall.exe /S
## Custom
See Mods folder
## Custom (Mods)

The Mod feature allows you to run an additional script when installing or uninstalling an app.
Just put the script with the App ID followed by the "-install-once", "-install" or "-uninstall" suffix to be considered.
`AppID-install-once.ps1`, `AppID-install.ps1` or `AppID-uninstall.ps1`
and put this in the Mods directory (`AppID-install-once.ps1` overrides `AppID-install.ps1`)
> Example:
> If you want to run a script just after uninstalling FileZilla, call your script like this:
> `TimKosse.FileZilla.Client-uninstall.ps1`
In the case of FileZilla it spawns a process "Un_A.exe" (NullSoft) as a graphical uninstallation and this we will have to wait for completion of before moving on to checking if the uninstallation suceeded or not.

If your using WAU (Winget-AutoUpdate) `AppID-install.ps1` and `AppID-upgrade.ps1` gets copied to the WAU mods directory and runs when upgrading apps.
They are deleted on an uninstall.

## Other ideas and approaches
https://github.com/o-l-a-v/winget-intune-win32
16 changes: 0 additions & 16 deletions mods/README.md

This file was deleted.

0 comments on commit 89dbd9c

Please sign in to comment.