Skip to content

Commit 5af7074

Browse files
committed
fix installer problem, update to 0.3.0
1 parent f90abd8 commit 5af7074

12 files changed

+80
-39
lines changed

.github/workflows/dotnetcore.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ jobs:
1717
with:
1818
dotnet-version: "8.0.300"
1919
- name: archiving dotnet tool
20-
run: "powershell ./build.ps1 --target Archive --configuration Release --runtime \"${{matrix.rid}}\""
21-
- name: upload artifacts
20+
run: "powershell ./build.ps1 --target Archive BuildInstaller --configuration Release --runtime \"${{matrix.rid}}\""
21+
- name: upload archive
2222
uses: actions/upload-artifact@v1
2323
with:
2424
name: "WEventViewer-win-x64"
2525
path: "dist/publish/Release/${{matrix.rid}}/WEventViewer-${{matrix.rid}}.zip"
26+
- name: upload installer
27+
uses: actions/upload-artifact@v1
28+
with:
29+
name: "WEventViewer-win-x64"
30+
path: "dist/installer/Release/en-US/WEventViewer.Installer.msi"

.github/workflows/release.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ jobs:
1717
with:
1818
dotnet-version: "8.0.300"
1919
- name: archiving dotnet tool
20-
run: "powershell ./build.ps1 --target Archive --configuration Release --runtime \"${{matrix.rid}}\""
20+
run: "powershell ./build.ps1 --target Archive BuildInstaller --configuration Release --runtime \"${{matrix.rid}}\""
2121
- name: upload artifacts
2222
uses: actions/upload-artifact@v1
2323
with:
2424
name: "WEventViewer-win-x64"
2525
path: "dist/publish/Release/${{matrix.rid}}/WEventViewer-${{matrix.rid}}.zip"
26+
- name: upload installer
27+
uses: actions/upload-artifact@v1
28+
with:
29+
name: "WEventViewer-installer"
30+
path: "dist/installer/Release/en-US/WEventViewer.Installer.msi"
2631
release:
2732
needs: build
2833
runs-on: "windows-latest"
@@ -31,11 +36,16 @@ jobs:
3136
steps:
3237
- uses: actions/checkout@v1
3338
- name: download WEventViewer.zip
34-
uses: actions/download-artifact@v3
39+
uses: actions/download-artifact@v4
3540
with:
3641
path: artifacts
3742
- name: upload zip to gh release
3843
run: gh release upload ${{github.event.release.tag_name}} artifacts/WEventViewer-win-x64/WEventViewer-win-x64.zip
44+
env:
45+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
46+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
47+
- name: upload msi to gh release
48+
run: gh release upload ${{github.event.release.tag_name}} artifacts/WEventViewer-installer/WEventViewer.Installer.msi
3949
env:
4050
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4151
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Directory.Build.props

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<WEventViewerVersion>0.3.0</WEventViewerVersion>
5+
</PropertyGroup>
6+
</Project>

LICENSE.rtf

1.37 KB
Binary file not shown.

WEventViewer.Installer/Package.wxs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2-
<Package Name="WEventViewer" Manufacturer="itn3000" Version="1.0.0.0" UpgradeCode="61e8e723-2259-43eb-b767-cec8a5b7db1f">
3-
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
2+
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
3+
<Package Name="WEventViewer" Manufacturer="itn3000" Version="$(WEventViewerVersion)" UpgradeCode="61e8e723-2259-43eb-b767-cec8a5b7db1f">
4+
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="yes" />
5+
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER"/>
6+
<WixVariable Id="WixUILicenseRtf" Value="!(bindpath.root)\LICENSE.rtf"/>
47

58
<Feature Id="Main">
69
<ComponentGroupRef Id="WEventViewerComponent" />
710
<ComponentGroupRef Id="WEventViewerShortcutGroup"/>
811

912
</Feature>
13+
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes"/>
1014
</Package>
1115
</Wix>

WEventViewer.Installer/WEventViewer.Installer.wixproj

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
<PropertyGroup Condition="'$(ExeArch)' == ''">
33
<ExeArch>win-x64</ExeArch>
44
</PropertyGroup>
5+
<PropertyGroup>
6+
<DefineConstants>WEventViewerVersion=$(WEventViewerVersion)</DefineConstants>
7+
</PropertyGroup>
58
<ItemGroup>
69
<BindPath Include="$(MSBuildThisFileDirectory)..\dist\publish\$(Configuration)\$(ExeArch)\WEventViewer">
710
<BindName>bin</BindName>
811
</BindPath>
12+
<BindPath Include="$(MSBuildThisFileDirectory)..\">
13+
<BindName>root</BindName>
14+
</BindPath>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.1" />
918
</ItemGroup>
10-
</Project>
19+
</Project>

WEventViewer.Installer/WEventViewerComponent.wxs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<ComponentGroup Id="WEventViewerComponent" Directory="INSTALLFOLDER">
55
<Component Id="WEventViewerExe" Guid="{2A695591-0376-4A46-8119-0BA0B862D63B}">
66
<File Id="WEventViewer.exe" KeyPath="yes" Source="!(bindpath.bin)\WEventViewer.exe">
7-
<!--<Shortcut Id="WEventViewer.lnk" Name="!(bind.Property.ProductName)" Directory="MyShortcutFolder"/>-->
87
</File>
98
</Component>
109
<Files Include="!(bindpath.bin)\*.dll"/>
10+
<Files Include="!(bindpath.root)\LICENSE*"/>
1111
</ComponentGroup>
1212
<ComponentGroup Id="WEventViewerShortcutGroup" Directory="MyShortcutFolder">
1313
<Component Id="WEventViewerShortcut" Guid="{983A88F9-ECF3-471F-9837-3CAD1F5654C4}">

WEventViewer.sln

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
2+
# 17
33
VisualStudioVersion = 17.0.31903.59
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBEA2004-5AF0-43F4-9B6A-F299056D87B7}"
@@ -16,6 +16,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nukebuild", "build\nukebuil
1616
EndProject
1717
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{230BCF21-9433-4D4B-89C9-87FAAC0657A4}"
1818
ProjectSection(SolutionItems) = preProject
19+
Directory.Build.props = Directory.Build.props
1920
README.md = README.md
2021
EndProjectSection
2122
EndProject
@@ -33,6 +34,22 @@ Global
3334
Release|x86 = Release|x86
3435
EndGlobalSection
3536
GlobalSection(ProjectConfigurationPlatforms) = postSolution
37+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.ActiveCfg = Debug|Any CPU
40+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.Build.0 = Debug|Any CPU
41+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.ActiveCfg = Debug|Any CPU
42+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.Build.0 = Debug|Any CPU
43+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.ActiveCfg = Debug|Any CPU
44+
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.Build.0 = Debug|Any CPU
45+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.Build.0 = Release|Any CPU
47+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.ActiveCfg = Release|Any CPU
48+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.Build.0 = Release|Any CPU
49+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.ActiveCfg = Release|Any CPU
50+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.Build.0 = Release|Any CPU
51+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.ActiveCfg = Release|Any CPU
52+
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.Build.0 = Release|Any CPU
3653
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3754
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|ARM64.ActiveCfg = Debug|Any CPU
3855
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|ARM64.Build.0 = Debug|Any CPU
@@ -63,29 +80,13 @@ Global
6380
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x64.Build.0 = Release|x64
6481
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x86.ActiveCfg = Release|x86
6582
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x86.Build.0 = Release|x86
66-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.Build.0 = Debug|Any CPU
68-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.ActiveCfg = Debug|Any CPU
69-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.Build.0 = Debug|Any CPU
70-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.ActiveCfg = Debug|Any CPU
71-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.Build.0 = Debug|Any CPU
72-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.ActiveCfg = Debug|Any CPU
73-
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.Build.0 = Debug|Any CPU
74-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.ActiveCfg = Release|Any CPU
75-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.Build.0 = Release|Any CPU
76-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.ActiveCfg = Release|Any CPU
77-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.Build.0 = Release|Any CPU
78-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.ActiveCfg = Release|Any CPU
79-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.Build.0 = Release|Any CPU
80-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.ActiveCfg = Release|Any CPU
81-
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.Build.0 = Release|Any CPU
8283
EndGlobalSection
8384
GlobalSection(SolutionProperties) = preSolution
8485
HideSolutionNode = FALSE
8586
EndGlobalSection
8687
GlobalSection(NestedProjects) = preSolution
87-
{61D89AD6-426B-4A48-998D-413309FE3A4D} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
8888
{8341A7C3-A124-45AC-88F3-943943A81854} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
89+
{61D89AD6-426B-4A48-998D-413309FE3A4D} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
8990
EndGlobalSection
9091
GlobalSection(ExtensibilityGlobals) = postSolution
9192
SolutionGuid = {89C2DE27-9B07-431C-B61D-5E6A13475203}

build/Build.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ partial class Build : NukeBuild, NativeBuild, Installer
3030

3131
Target Clean => _ => _
3232
.Before(Restore)
33+
.Before(Publish, BuildInstaller)
3334
.Executes(() =>
3435
{
3536
});
@@ -68,9 +69,19 @@ partial class Build : NukeBuild, NativeBuild, Installer
6869
outdir.ZipTo(outdir.Parent / $"WEventViewer-{Runtime}.zip", fileMode: System.IO.FileMode.Create);
6970
});
7071
Target BuildInstaller => _ => _
71-
.DependsOn(Publish, ((Installer)this).BuildInstallerBinary)
72+
.DependsOn(Publish, BuildInstallerBinary)
7273
;
73-
74+
Target BuildInstallerBinary => _ => _
75+
.After(Publish)
76+
.Executes(() =>
77+
{
78+
var project = RootDirectory / "WEventViewer.Installer" / "WEventViewer.Installer.wixproj";
79+
var outputdir = RootDirectory / "dist" / "installer" / Configuration;
80+
DotNetBuild(cfg => cfg.SetProjectFile(project)
81+
.SetProcessWorkingDirectory(project.Parent)
82+
.SetConfiguration(Configuration)
83+
.SetOutputDirectory(outputdir));
84+
});
7485
AbsolutePath GetPublishOutputDirectory()
7586
{
7687
return RootDirectory / "dist" / "publish" / Configuration / Runtime / "WEventViewer";

build/Installer.cs

-8
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,5 @@ interface Installer : INukeBuild
1414
{
1515
[Parameter]
1616
public string Configuration => TryGetValue(() => Configuration) ?? "Release";
17-
Target BuildInstallerBinary => _ => _
18-
.Executes(() =>
19-
{
20-
var project = RootDirectory / "WEventViewer.Installer" / "WEventViewer.Installer.wixproj";
21-
DotNetBuild(cfg => cfg.SetProjectFile(project)
22-
.SetProcessWorkingDirectory(project.Parent)
23-
.SetConfiguration(Configuration));
24-
});
2517
}
2618
}

src/WEventViewer/MainWindow.axaml.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ private async void CopyAsXmlClicked(object? sender, Avalonia.Interactivity.Route
115115
rootelem.Add(XElement.Parse(item.XmlString));
116116
}
117117
var xmlstr = rootelem.ToString(SaveOptions.None);
118-
await Clipboard.SetTextAsync(xmlstr);
118+
if (Clipboard != null)
119+
{
120+
await Clipboard.SetTextAsync(xmlstr);
121+
}
119122
}
120123
}

src/WEventViewer/WEventViewer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9-
<Version>0.2.0</Version>
9+
<Version>$(WEventViewerVersion)</Version>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)