-
Notifications
You must be signed in to change notification settings - Fork 18
Modifications
Please note that this feature is supported from version 1.04.0000 onwards
With a modification you can change the behavior of an app before or after it is updated. Winget-AutoUpdate-Configurator provides an easy way to access the Winget-AutoUpdate mode feature by providing a simple JSON notation that can be provided using the Modification Configuration policy.
You can add a modification step by enabling the Modification Configuration policy and add a new entry. A entry looks as follows:
- Name
<AppId>-<ModificationPhase>: The Name field consists out of the AppId of the app during which you want to run your modification step and the phase during which the modification is run. Valid values for ModificationPhase-
preinstall: Runs before upgrade/install. -
upgradeorinstall: Runs during upgrade/install (before install check). -
installed: Runs after upgrade/install has been confirmed.
-
- Value: This is a single line JSON string with the corresponding modifications that should be run.
{
"StopModsProc" : [{"Process" : "Beginning of Process Name to Stop - optional wildcard (*) after, without .exe."}, {"Process" : "somefile" }],
"WaitModsProc" : [{"Process" : "Beginning of Process Name to Wait for to End - optional wildcard (*) after, without .exe."}, {"Process" : "somefile" }],
"UninstallModsApp" : [{"App" : "Beginning of App Name string to Silently Uninstall (MSI/NSIS/INNO/EXE with defined silent uninstall in registry)."},{"App" : "App Name 2" }],
"InstallWingetID" : [{"wingetid" : "The Id of the Winget app you want to install"},{"App" : "MyApp.MyApp" }],
"UninstallWingetID" : [{"App" : "The Id of the Winget app you want to remove"},{"App" : "MyApp.MyApp" }],
"RemoveModsLnk" : [{"Shortcut" : "Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk."}, {"Shortcut" : "somefile" }],
"StopModsSvc" : [{"Service" : "The name of the service you want to stop."}, {"Process" : "MyService" }],
"AddModsReg" : [{"AddKey" : "The registry key you want to set. Like HKLM:\SOFTWARE\App\Feature", "AddValue" : "The Attribute you want to set.", "AddTypeData" : "The value for the Attribute you want to set.", "AddType" : "The datatype of the attribute." }, {"AddKey" : "HKLM:\SOFTWARE\App\Feature", "AddValue" : "MyAttribute", "AddTypeData" : "MyValue", "AddType" : "string" }],
"RemoveModsReg" : [{"DelKey" : "The registry key of the attribute you want to remove.", "DelValue" : "The Attribute you want to remove."}],
"RemoveModsFile" : [{"File" : "Path to the file you want to remove."}, {"File" : "c:\Myfile.txt"} ],
"RenameModsFile" : [{"RenFile" : "Path to the file you want to rename.", "NewName" : "The new name of the file."}],
"CopyModsFile" : [{"CopyFile" : "Path to the file you want to copy.", "CopyTo" : "The path you want to copy the file to."}],
"EditModsFile" : [{"File" : "Path to the file you want edit.", "FindText" : "A string value of the text that you want to replace within the target file.", "ReplaceText" : "The string value you want insert."}] }
The following sample will close the VLC media player before the app is updated:
VideoLan.VLC-preinstall,{"StopModsProc" : [{"Process":"vlc"}]}