Skip to content

Commit

Permalink
Feature: MSI Installer with Wix Toolset v5
Browse files Browse the repository at this point in the history
  • Loading branch information
BornToBeRoot committed May 3, 2024
1 parent 2eeb15d commit 8c716f3
Show file tree
Hide file tree
Showing 7 changed files with 373 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Source/NETworkManager.Setup/Components.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<ComponentGroup Id="Components" Directory="INSTALLFOLDER">
<Files Include="$(var.NETworkManager.TargetDir)**">
<Exclude Files="$(var.NETworkManager.TargetDir)**\*.pdb" />
<Exclude Files="$(var.NETworkManager.TargetDir)NETworkManager.exe" />
</Files>

<!-- Main content -->
<Component>
<File Id="NETworkManagerExecutable"
Source="$(var.NETworkManager.TargetDir)NETworkManager.exe">
<Shortcut Name="NETworkManager"
Directory="ProgramMenuFolder"
Advertise="true"
Icon="icon.ico"
Description="A powerful tool for managing networks and troubleshoot network problems!" />
</File>
</Component>

<!-- Desktop shortcut -->
<Component Directory="DesktopFolder" Condition="DESKTOPSHORTCUTENABLED=1">
<RegistryValue Root="HKCU" Key="SOFTWARE\NETworkManager" Name="DesktopShortcutEnabled" Value="1" />
<Shortcut Name="NETworkManager"
Directory="DesktopFolder"
Target="[#NETworkManagerExecutable]"
Icon="icon.ico"
Description="A powerful tool for managing networks and troubleshoot network problems!" />
</Component>

</ComponentGroup>
</Fragment>
</Wix>
7 changes: 7 additions & 0 deletions Source/NETworkManager.Setup/Folders.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="NETworkManager" />
</StandardDirectory>
</Fragment>
</Wix>
265 changes: 265 additions & 0 deletions Source/NETworkManager.Setup/LICENSE.rtf

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions Source/NETworkManager.Setup/NETworkManager.Setup.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="WixToolset.Sdk/5.0.0">
<ItemGroup>
<None Include="LICENSE.rtf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.0" />
<ProjectReference Include="..\NETworkManager\NETworkManager.csproj" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions Source/NETworkManager.Setup/Package.en-us.wxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
This file contains the declaration of all the localizable strings.
-->
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">

<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." />

</WixLocalization>
29 changes: 29 additions & 0 deletions Source/NETworkManager.Setup/Package.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?define ProductVersion="0.0.0" ?>

<Package Name="NETworkManager 20$(var.ProductVersion).0"
Manufacturer="BornToBeRoot"
Version="$(var.ProductVersion)"
UpgradeCode="e343d8ab-ed71-41d1-9784-6f6860bda078">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />

<!-- Include CAB file in MSI -->
<MediaTemplate EmbedCab="true" />

<!-- Icon -->
<Icon Id="icon.ico" SourceFile="$(var.NETworkManager.ProjectDir)NETworkManager.ico" />
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

<!-- UI -->
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)LICENSE.rtf" />
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" >
</ui:WixUI>

<!-- Features -->
<Feature Id="Main" Title="NETworkManager">
<ComponentGroupRef Id="Components" />
</Feature>
</Package>

</Wix>
22 changes: 22 additions & 0 deletions Source/NETworkManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdparty", "3rdparty", "{B4
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dragablz", "3rdparty\Dragablz\Dragablz\Dragablz.csproj", "{6178E008-0BAB-4B83-9FBA-BAF897D51E9D}"
EndProject
Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "NETworkManager.Setup", "NETworkManager.Setup\NETworkManager.Setup.wixproj", "{B474758D-E657-4DA6-AB2B-63764C5FBAF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -315,6 +317,26 @@ Global
{6178E008-0BAB-4B83-9FBA-BAF897D51E9D}.Release|x64.Build.0 = Release|Any CPU
{6178E008-0BAB-4B83-9FBA-BAF897D51E9D}.Release|x86.ActiveCfg = Release|Any CPU
{6178E008-0BAB-4B83-9FBA-BAF897D51E9D}.Release|x86.Build.0 = Release|Any CPU
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|Any CPU.ActiveCfg = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|Any CPU.Build.0 = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|ARM.ActiveCfg = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|ARM.Build.0 = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|ARM64.Build.0 = Debug|ARM64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|x64.ActiveCfg = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|x64.Build.0 = Debug|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|x86.ActiveCfg = Debug|x86
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Debug|x86.Build.0 = Debug|x86
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|Any CPU.ActiveCfg = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|Any CPU.Build.0 = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|ARM.ActiveCfg = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|ARM.Build.0 = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|ARM64.ActiveCfg = Release|ARM64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|ARM64.Build.0 = Release|ARM64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|x64.ActiveCfg = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|x64.Build.0 = Release|x64
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|x86.ActiveCfg = Release|x86
{B474758D-E657-4DA6-AB2B-63764C5FBAF1}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 8c716f3

Please sign in to comment.