Skip to content

Commit 30c8a6f

Browse files
committed
add bowl sample
1 parent ebb2c54 commit 30c8a6f

File tree

7 files changed

+82
-0
lines changed

7 files changed

+82
-0
lines changed

src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="GeneralUpdate.Bowl" Version="9.0.0" />
12+
</ItemGroup>
13+
14+
</Project>

src/Bowl/BowlSample/BowlSample.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BowlSample", "BowlSample.csproj", "{41B86DF6-FEFF-4826-84CB-41873FAA2C8C}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{41B86DF6-FEFF-4826-84CB-41873FAA2C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{41B86DF6-FEFF-4826-84CB-41873FAA2C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{41B86DF6-FEFF-4826-84CB-41873FAA2C8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{41B86DF6-FEFF-4826-84CB-41873FAA2C8C}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

src/Bowl/BowlSample/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using GeneralUpdate.Bowl;
2+
using GeneralUpdate.Bowl.Strategys;
3+
4+
/*
5+
* Bowl is used to monitor your client program. If it detects that the client process has crashed, it will help you export the relevant information to the "fail" directory.
6+
*
7+
* ref: https://www.bilibili.com/video/BV1c8iyYZE7P?spm_id_from=333.788.videopod.episodes&vd_source=5b84edd8fee7635c1c999c7962c04602&p=7
8+
*/
9+
var installPath = AppDomain.CurrentDomain.BaseDirectory;
10+
var lastVersion = "1.0.0.3";
11+
var processInfo = new MonitorParameter
12+
{
13+
ProcessNameOrId = "ThrowApp.exe",
14+
DumpFileName = $"{lastVersion}_fail.dmp",
15+
FailFileName = $"{lastVersion}_fail.json",
16+
TargetPath = installPath,
17+
FailDirectory = Path.Combine(installPath, "fail", lastVersion),
18+
BackupDirectory = Path.Combine(installPath, lastVersion),
19+
WorkModel = "Normal"
20+
};
21+
Bowl.Launch(processInfo);

0 commit comments

Comments
 (0)