Skip to content

Commit b1d4624

Browse files
committed
修复启动前任务无法删除的错误
1 parent cb3a945 commit b1d4624

File tree

9 files changed

+47
-17
lines changed

9 files changed

+47
-17
lines changed

PreLaunchTaskr.Core/PreLaunchTaskr.Core.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.3" />
9+
<Compile Remove="Dao\Implementations\**" />
10+
<Compile Remove="Dao\Interfaces\**" />
11+
<EmbeddedResource Remove="Dao\Implementations\**" />
12+
<EmbeddedResource Remove="Dao\Interfaces\**" />
13+
<None Remove="Dao\Implementations\**" />
14+
<None Remove="Dao\Interfaces\**" />
1015
</ItemGroup>
1116

1217
<ItemGroup>
13-
<ProjectReference Include="..\PreLaunchTaskr.Common\PreLaunchTaskr.Common.csproj" />
18+
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.3" />
1419
</ItemGroup>
1520

1621
<ItemGroup>
17-
<Folder Include="Dao\Interfaces\" />
18-
<Folder Include="Dao\Implementations\" />
22+
<ProjectReference Include="..\PreLaunchTaskr.Common\PreLaunchTaskr.Common.csproj" />
1923
</ItemGroup>
2024

2125
</Project>

PreLaunchTaskr.Core/Services/Launcher.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,17 @@ public bool Launch(
215215
}
216216
}
217217
}
218-
taskProcess.Start();
219-
taskProcess.WaitForExit();
218+
try
219+
{
220+
if (!taskProcess.Start())
221+
continue;
222+
223+
taskProcess.WaitForExit();
224+
}
225+
catch (Exception)
226+
{
227+
continue;
228+
}
220229
}
221230

222231
// 带上处理后的启动参数、专属环境变量,去启动程序

PreLaunchTaskr.GUI.WinUI3/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public partial class App : Application
2323
{
2424
public static string DisplayVersion =>
2525
#if DEBUG
26-
"1.4.4 DEBUG";
26+
"1.4.5 DEBUG";
2727
#else
28-
"1.4.4";
28+
"1.4.5";
2929
#endif
3030

3131
/// <summary>
1.77 KB
Loading
-426 KB
Binary file not shown.

PreLaunchTaskr.GUI.WinUI3/PreLaunchTaskr.GUI.WinUI3.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
<WindowsPackageType>None</WindowsPackageType>
1515
<LangVersion>preview</LangVersion>
1616
</PropertyGroup>
17+
<ItemGroup>
18+
<Compile Remove="Services\**" />
19+
<EmbeddedResource Remove="Services\**" />
20+
<None Remove="Services\**" />
21+
<Page Remove="Services\**" />
22+
</ItemGroup>
1723
<ItemGroup>
1824
<Content Remove="Assets\DefaultProgramIcon.png" />
1925
<Content Remove="Assets\PreLaunchTaskrBannerSmallText.png" />
@@ -159,10 +165,6 @@
159165
<Generator>MSBuild:Compile</Generator>
160166
</Page>
161167
</ItemGroup>
162-
<ItemGroup>
163-
<Folder Include="Dao\" />
164-
<Folder Include="Services\" />
165-
</ItemGroup>
166168

167169
<!--
168170
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
@@ -185,4 +187,7 @@
185187
<AssemblyVersion>1.4.2</AssemblyVersion>
186188
<FileVersion>1.4.2</FileVersion>
187189
</PropertyGroup>
190+
<ItemGroup>
191+
<PRIResource Remove="Services\**" />
192+
</ItemGroup>
188193
</Project>

PreLaunchTaskr.GUI.WinUI3/ViewModels/ItemModels/PreLaunchTaskListItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public bool Remove()
7171
if (preLaunchTask.Id == -1)
7272
return false;
7373

74-
return App.Current.Configurator.RemoveAttachedArgument(preLaunchTask.Id);
74+
return App.Current.Configurator.RemovePreLaunchTask(preLaunchTask.Id);
7575
}
7676

7777
private readonly PreLaunchTask preLaunchTask;

PreLaunchTaskr.GUI.WinUI3/Views/AboutPage.xaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
Margin="36,0"
3636
Spacing="16">
3737

38-
<StackPanel Margin="0,36,0,0">
38+
<Border Height="20" />
39+
40+
<StackPanel>
3941
<TextBlock Style="{ThemeResource TitleTextBlockStyle}" Text="关于此应用" />
4042
<Image MaxHeight="360" Source="/Assets/PreLaunchTaskrBannerSmallText.png" />
4143
</StackPanel>
@@ -66,9 +68,7 @@
6668

6769
<Expander Header="Segoe Fluent 图标字体" IsExpanded="False">
6870
<StackPanel>
69-
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="随着 Windows 11 的发布,符号图标字体已从 Segoe MDL2 Assets 替换为 Segoe Fluent Icons 字体。" />
70-
71-
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="在 Windows 10 电脑上可能部分图标不能正常显示,例如显示为一个矩形框。如有需要可以下载,然后在右键菜单中为所有用户安装。" />
71+
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind AboutFontIcon}" />
7272

7373
<my:IconHyperlinkButton
7474
Padding="8"
@@ -138,6 +138,8 @@
138138
</my:IconHyperlinkButton>
139139
</StackPanel>
140140
</Expander>
141+
142+
<Border Height="20" />
141143
</StackPanel>
142144
</ScrollView>
143145
</Page>

PreLaunchTaskr.GUI.WinUI3/Views/AboutPage.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,15 @@ private string ReadMe
2121
}
2222
}
2323

24+
private string AboutFontIcon
25+
{
26+
get => aboutFontIcon;
27+
}
28+
2429
private static string readme = null!;
30+
31+
private const string aboutFontIcon =
32+
@"随着 Windows 11 的发布,符号图标字体已从 Segoe MDL2 Assets 替换为 Segoe Fluent Icons 字体。
33+
34+
在 Windows 10 电脑上可能部分图标不能正常显示,例如显示为一个矩形框。如有需要可以下载,然后在右键菜单中为所有用户安装。";
2535
}

0 commit comments

Comments
 (0)