Skip to content

Commit ab1a10d

Browse files
committed
Add option to restart explorer.exe after ‘UserOnce’ scripts have run
1 parent b376e7a commit ab1a10d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ CompactOsModes CompactOsMode
359359
Components: ImmutableDictionary.Create<string, ImmutableSortedSet<Pass>>(),
360360
Bloatwares: [],
361361
ExpressSettings: ExpressSettingsMode.DisableAll,
362-
ScriptSettings: new ScriptSettings([]),
362+
ScriptSettings: new ScriptSettings(Scripts: [], RestartExplorer: false),
363363
KeySettings: new SkipKeySettings(),
364364
WallpaperSettings: new DefaultWallpaperSettings(),
365365
ColorSettings: new DefaultColorSettings(),

modifier/Script.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public static string FileExtension(this ScriptType type)
6666
}
6767

6868
public record class ScriptSettings(
69-
IEnumerable<Script> Scripts
69+
IEnumerable<Script> Scripts,
70+
bool RestartExplorer
7071
);
7172

7273
public class Script
@@ -119,6 +120,11 @@ class ScriptModifier(ModifierContext context) : Modifier(context)
119120
{
120121
public override void Process()
121122
{
123+
if (Configuration.ScriptSettings.RestartExplorer)
124+
{
125+
UserOnceScript.RestartExplorer();
126+
}
127+
122128
var infos = Configuration.ScriptSettings.Scripts.Select(ScriptInfo.Create).ToImmutableList();
123129
if (infos.IsEmpty)
124130
{

0 commit comments

Comments
 (0)