Skip to content

Commit 19e93dc

Browse files
committed
Added executable alias to allow command line usage via eventlogexpert.exe
1 parent e217506 commit 19e93dc

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

src/EventLogExpert/MainPage.xaml.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,7 @@ await MainThread.InvokeOnMainThreadAsync(() =>
120120
fluxorDispatcher.Dispatch(new FilterCacheAction.LoadFilters());
121121
fluxorDispatcher.Dispatch(new FilterGroupAction.LoadGroups());
122122

123-
var args = Environment.GetCommandLineArgs();
124-
125-
foreach (var arg in args)
126-
{
127-
if (arg.EndsWith(".evtx"))
128-
{
129-
OpenLog(arg, PathType.FilePath).AndForget();
130-
}
131-
}
123+
ProcessCommandLine();
132124
}
133125

134126
public void Dispose()
@@ -449,6 +441,21 @@ private void PopulateOtherLogsMenu()
449441
CreateFlyoutMenu(OpenOtherLogsFlyoutSubitem, names);
450442
}
451443

444+
private void ProcessCommandLine()
445+
{
446+
var args = Environment.GetCommandLineArgs();
447+
448+
foreach (var arg in args)
449+
{
450+
switch (arg)
451+
{
452+
case not null when arg.EndsWith(".evtx"):
453+
OpenLog(arg, PathType.FilePath).AndForget();
454+
break;
455+
}
456+
}
457+
}
458+
452459
private async void ReleaseNotes_Clicked(object sender, EventArgs e) => await _updateService.GetReleaseNotes();
453460

454461
private async void SaveAllFilters_Clicked(object sender, EventArgs e)

src/EventLogExpert/Platforms/Windows/Package.appxmanifest

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<Package
33
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
44
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
5+
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
6+
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
57
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
6-
IgnorableNamespaces="uap rescap">
8+
IgnorableNamespaces="uap uap3 rescap">
79

8-
<Identity Name="eventlogexpert" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="0.9.0.0" />
10+
<Identity Name="EventLogExpert" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="0.9.0.0" />
911

1012
<Properties>
1113
<DisplayName>EventLogExpert</DisplayName>
@@ -33,7 +35,14 @@
3335
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
3436
<uap:SplashScreen Image="$placeholder$.png" />
3537
</uap:VisualElements>
38+
3639
<Extensions>
40+
<uap3:Extension Category="windows.appExecutionAlias" Executable="eventlogexpert.exe" EntryPoint="Windows.FullTrustApplication">
41+
<uap3:AppExecutionAlias>
42+
<desktop:ExecutionAlias Alias="eventlogexpert.exe" />
43+
</uap3:AppExecutionAlias>
44+
</uap3:Extension>
45+
3746
<uap:Extension Category="windows.fileTypeAssociation">
3847
<uap:FileTypeAssociation Name="windowseventlog">
3948
<uap:SupportedFileTypes>

0 commit comments

Comments
 (0)