Skip to content

Commit

Permalink
fix installer problem, update to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
itn3000 committed Aug 20, 2024
1 parent f90abd8 commit 5af7074
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 39 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ jobs:
with:
dotnet-version: "8.0.300"
- name: archiving dotnet tool
run: "powershell ./build.ps1 --target Archive --configuration Release --runtime \"${{matrix.rid}}\""
- name: upload artifacts
run: "powershell ./build.ps1 --target Archive BuildInstaller --configuration Release --runtime \"${{matrix.rid}}\""
- name: upload archive
uses: actions/upload-artifact@v1
with:
name: "WEventViewer-win-x64"
path: "dist/publish/Release/${{matrix.rid}}/WEventViewer-${{matrix.rid}}.zip"
- name: upload installer
uses: actions/upload-artifact@v1
with:
name: "WEventViewer-win-x64"
path: "dist/installer/Release/en-US/WEventViewer.Installer.msi"
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ jobs:
with:
dotnet-version: "8.0.300"
- name: archiving dotnet tool
run: "powershell ./build.ps1 --target Archive --configuration Release --runtime \"${{matrix.rid}}\""
run: "powershell ./build.ps1 --target Archive BuildInstaller --configuration Release --runtime \"${{matrix.rid}}\""
- name: upload artifacts
uses: actions/upload-artifact@v1
with:
name: "WEventViewer-win-x64"
path: "dist/publish/Release/${{matrix.rid}}/WEventViewer-${{matrix.rid}}.zip"
- name: upload installer
uses: actions/upload-artifact@v1
with:
name: "WEventViewer-installer"
path: "dist/installer/Release/en-US/WEventViewer.Installer.msi"
release:
needs: build
runs-on: "windows-latest"
Expand All @@ -31,11 +36,16 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: download WEventViewer.zip
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: upload zip to gh release
run: gh release upload ${{github.event.release.tag_name}} artifacts/WEventViewer-win-x64/WEventViewer-win-x64.zip
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: upload msi to gh release
run: gh release upload ${{github.event.release.tag_name}} artifacts/WEventViewer-installer/WEventViewer.Installer.msi
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<WEventViewerVersion>0.3.0</WEventViewerVersion>
</PropertyGroup>
</Project>
Binary file added LICENSE.rtf
Binary file not shown.
10 changes: 7 additions & 3 deletions WEventViewer.Installer/Package.wxs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="WEventViewer" Manufacturer="itn3000" Version="1.0.0.0" UpgradeCode="61e8e723-2259-43eb-b767-cec8a5b7db1f">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="WEventViewer" Manufacturer="itn3000" Version="$(WEventViewerVersion)" UpgradeCode="61e8e723-2259-43eb-b767-cec8a5b7db1f">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="yes" />
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER"/>
<WixVariable Id="WixUILicenseRtf" Value="!(bindpath.root)\LICENSE.rtf"/>

<Feature Id="Main">
<ComponentGroupRef Id="WEventViewerComponent" />
<ComponentGroupRef Id="WEventViewerShortcutGroup"/>

</Feature>
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes"/>
</Package>
</Wix>
11 changes: 10 additions & 1 deletion WEventViewer.Installer/WEventViewer.Installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
<PropertyGroup Condition="'$(ExeArch)' == ''">
<ExeArch>win-x64</ExeArch>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>WEventViewerVersion=$(WEventViewerVersion)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<BindPath Include="$(MSBuildThisFileDirectory)..\dist\publish\$(Configuration)\$(ExeArch)\WEventViewer">
<BindName>bin</BindName>
</BindPath>
<BindPath Include="$(MSBuildThisFileDirectory)..\">
<BindName>root</BindName>
</BindPath>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.1" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion WEventViewer.Installer/WEventViewerComponent.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<ComponentGroup Id="WEventViewerComponent" Directory="INSTALLFOLDER">
<Component Id="WEventViewerExe" Guid="{2A695591-0376-4A46-8119-0BA0B862D63B}">
<File Id="WEventViewer.exe" KeyPath="yes" Source="!(bindpath.bin)\WEventViewer.exe">
<!--<Shortcut Id="WEventViewer.lnk" Name="!(bind.Property.ProductName)" Directory="MyShortcutFolder"/>-->
</File>
</Component>
<Files Include="!(bindpath.bin)\*.dll"/>
<Files Include="!(bindpath.root)\LICENSE*"/>
</ComponentGroup>
<ComponentGroup Id="WEventViewerShortcutGroup" Directory="MyShortcutFolder">
<Component Id="WEventViewerShortcut" Guid="{983A88F9-ECF3-471F-9837-3CAD1F5654C4}">
Expand Down
37 changes: 19 additions & 18 deletions WEventViewer.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
# 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBEA2004-5AF0-43F4-9B6A-F299056D87B7}"
Expand All @@ -16,6 +16,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nukebuild", "build\nukebuil
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{230BCF21-9433-4D4B-89C9-87FAAC0657A4}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
README.md = README.md
EndProjectSection
EndProject
Expand All @@ -33,6 +34,22 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.Build.0 = Release|Any CPU
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{4A68C488-E8DA-4D4E-A299-CC0C78EC5590}.Debug|ARM64.Build.0 = Debug|Any CPU
Expand Down Expand Up @@ -63,29 +80,13 @@ Global
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x64.Build.0 = Release|x64
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x86.ActiveCfg = Release|x86
{61D89AD6-426B-4A48-998D-413309FE3A4D}.Release|x86.Build.0 = Release|x86
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|ARM64.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x64.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.ActiveCfg = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Debug|x86.Build.0 = Debug|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|Any CPU.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|ARM64.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x64.Build.0 = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.ActiveCfg = Release|Any CPU
{8341A7C3-A124-45AC-88F3-943943A81854}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{61D89AD6-426B-4A48-998D-413309FE3A4D} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
{8341A7C3-A124-45AC-88F3-943943A81854} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
{61D89AD6-426B-4A48-998D-413309FE3A4D} = {DBEA2004-5AF0-43F4-9B6A-F299056D87B7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {89C2DE27-9B07-431C-B61D-5E6A13475203}
Expand Down
15 changes: 13 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ partial class Build : NukeBuild, NativeBuild, Installer

Target Clean => _ => _
.Before(Restore)
.Before(Publish, BuildInstaller)
.Executes(() =>
{
});
Expand Down Expand Up @@ -68,9 +69,19 @@ partial class Build : NukeBuild, NativeBuild, Installer
outdir.ZipTo(outdir.Parent / $"WEventViewer-{Runtime}.zip", fileMode: System.IO.FileMode.Create);
});
Target BuildInstaller => _ => _
.DependsOn(Publish, ((Installer)this).BuildInstallerBinary)
.DependsOn(Publish, BuildInstallerBinary)
;

Target BuildInstallerBinary => _ => _
.After(Publish)
.Executes(() =>
{
var project = RootDirectory / "WEventViewer.Installer" / "WEventViewer.Installer.wixproj";
var outputdir = RootDirectory / "dist" / "installer" / Configuration;
DotNetBuild(cfg => cfg.SetProjectFile(project)
.SetProcessWorkingDirectory(project.Parent)
.SetConfiguration(Configuration)
.SetOutputDirectory(outputdir));
});
AbsolutePath GetPublishOutputDirectory()
{
return RootDirectory / "dist" / "publish" / Configuration / Runtime / "WEventViewer";
Expand Down
8 changes: 0 additions & 8 deletions build/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ interface Installer : INukeBuild
{
[Parameter]
public string Configuration => TryGetValue(() => Configuration) ?? "Release";
Target BuildInstallerBinary => _ => _
.Executes(() =>
{
var project = RootDirectory / "WEventViewer.Installer" / "WEventViewer.Installer.wixproj";
DotNetBuild(cfg => cfg.SetProjectFile(project)
.SetProcessWorkingDirectory(project.Parent)
.SetConfiguration(Configuration));
});
}
}
5 changes: 4 additions & 1 deletion src/WEventViewer/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ private async void CopyAsXmlClicked(object? sender, Avalonia.Interactivity.Route
rootelem.Add(XElement.Parse(item.XmlString));
}
var xmlstr = rootelem.ToString(SaveOptions.None);
await Clipboard.SetTextAsync(xmlstr);
if (Clipboard != null)
{
await Clipboard.SetTextAsync(xmlstr);
}
}
}
2 changes: 1 addition & 1 deletion src/WEventViewer/WEventViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>0.2.0</Version>
<Version>$(WEventViewerVersion)</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5af7074

Please sign in to comment.