Skip to content

Modifications

Weatherlights edited this page Sep 7, 2025 · 7 revisions

Please note that this feature is supported from version 1.04.0000 onwards

What is a modification

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.

How to apply a configuration

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.
    • upgrade or install: 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.

JSON reference

{

Stop process

"StopModsProc" : [{"Process" : "Beginning of Process Name to Stop - optional wildcard (*) after, without .exe."}, {"Process" : "somefile" }],

Wait for process

"WaitModsProc" : [{"Process" : "Beginning of Process Name to Wait for to End - optional wildcard (*) after, without .exe."}, {"Process" : "somefile" }],

Uninstall app

"UninstallModsApp" : [{"App" : "Beginning of App Name string to Silently Uninstall (MSI/NSIS/INNO/EXE with defined silent uninstall in registry)."},{"App" : "App Name 2" }],

Install app from Winget

"InstallWingetID" : [{"wingetid" : "The Id of the Winget app you want to install"},{"App" : "MyApp.MyApp" }],

Uninstall app from Winget

"UninstallWingetID" : [{"App" : "The Id of the Winget app you want to remove"},{"App" : "MyApp.MyApp" }],

Remove Shortcut

"RemoveModsLnk" : [{"Shortcut" : "Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk."}, {"Shortcut" : "somefile" }],

Stop service

"StopModsSvc" : [{"Service" : "The name of the service you want to stop."}, {"Process" : "MyService" }],

Add/Set Registry key value

"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" }],

Remove registry key value

"RemoveModsReg" : [{"DelKey" : "The registry key of the attribute you want to remove.", "DelValue" : "The Attribute you want to remove."}],

Remove file

"RemoveModsFile" : [{"File" : "Path to the file you want to remove."}, {"File" : "c:\Myfile.txt"} ],

Rename file

"RenameModsFile" : [{"RenFile" : "Path to the file you want to rename.", "NewName" : "The new name of the file."}],

Copy file

"CopyModsFile" : [{"CopyFile" : "Path to the file you want to copy.", "CopyTo" : "The path you want to copy the file to."}],

Edit file content

"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."}] }

Sample

The following sample will close the VLC media player before the app is updated:

VideoLan.VLC-preinstall,{"StopModsProc" : [{"Process":"vlc"}]}