1 Commits

Author SHA1 Message Date
thomas.hilscher 21dfc5493c Add msi installer 2026-07-31 22:07:54 +02:00
10 changed files with 170 additions and 0 deletions
+1
View File
@@ -4,3 +4,4 @@ bin/
.vs
.idea
*.exe
*.zip
+10
View File
@@ -0,0 +1,10 @@
Pamhagen
========
Source code
C:\Program Files\Pamhagen\src\PamhagenSysCtrl-source.zip
https://git.necronda.net/winzer/pamhagen-sysctrl
Installation folder
C:\Program Files\Pamhagen\
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.ProductName)">
<Directory Id="SourceFolder" Name="src" />
</Directory>
</StandardDirectory>
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" />
</StandardDirectory>
<StandardDirectory Id="DesktopFolder" />
</Fragment>
</Wix>
+46
View File
@@ -0,0 +1,46 @@
<Project Sdk="WixToolset.Sdk/7.0.0">
<PropertyGroup>
<InstallerPlatform>x64</InstallerPlatform>
<OutputName>PamhagenSysCtrl</OutputName>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Cultures>de-AT</Cultures>
<AcceptEula>wix7</AcceptEula>
<SuppressValidation>false</SuppressValidation>
<PublishDirectory>$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\bin\Publish</PublishDirectory>
</PropertyGroup>
<UsingTask TaskName="GetFileVersion"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<AssemblyPath ParameterType="System.String" Required="true" />
<Version ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Using Namespace="System.Diagnostics" />
<Code Type="Fragment" Language="cs"><![CDATA[
Version = FileVersionInfo.GetVersionInfo(AssemblyPath).ProductVersion.Split('+')[0];
]]></Code>
</Task>
</UsingTask>
<Target Name="PublishApplication" BeforeTargets="BeforeBuild">
<RemoveDir Directories="$(PublishDirectory)" Condition="Exists('$(PublishDirectory)')" />
<Exec Command="dotnet publish &quot;$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\PamhagenSysCtrl.csproj&quot; --configuration &quot;$(Configuration)&quot; --runtime win-x64 --self-contained true --output &quot;$(PublishDirectory)&quot; --nologo" />
<GetFileVersion AssemblyPath="$(PublishDirectory)\PamhagenSysCtrl.exe">
<Output TaskParameter="Version" PropertyName="ProductVersion" />
</GetFileVersion>
<PropertyGroup>
<DefineConstants>ProductVersion=$(ProductVersion);BuildPath=$(PublishDirectory)</DefineConstants>
</PropertyGroup>
</Target>
<Target Name="CreateSourceArchive" BeforeTargets="BeforeBuild">
<Exec Command="git -C &quot;$(MSBuildProjectDirectory)\..&quot; archive --format=zip --output &quot;$(MSBuildProjectDirectory)\Files\PamhagenSysCtrl-source.zip&quot; HEAD" />
</Target>
<ItemGroup>
<ProjectReference Include="..\PamhagenSysCtrl\PamhagenSysCtrl.csproj"
ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
+25
View File
@@ -0,0 +1,25 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<ComponentGroup Id="MainComponents">
<Component Directory="INSTALLFOLDER">
<File Source="$(var.BuildPath)\PamhagenSysCtrl.exe"
Id="PamhagenSysCtrl.exe" />
</Component>
<Component Directory="SourceFolder">
<File Source="$(ProjectDir)\Files\PamhagenSysCtrl-source.zip"
Id="PamhagenSysCtrlSource.zip" />
</Component>
<Component Directory="INSTALLFOLDER">
<File Source="$(ProjectDir)\Files\README.txt"
Id="README.txt" />
</Component>
<Files Directory="INSTALLFOLDER" Include="$(var.BuildPath)\**">
<Exclude Files="$(var.BuildPath)\PamhagenSysCtrl.exe" />
<Exclude Files="$(var.BuildPath)\**.pdb" />
</Files>
</ComponentGroup>
</Fragment>
</Wix>
+5
View File
@@ -0,0 +1,5 @@
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl"
Culture="de-AT">
<String Id="DowngradeError"
Value="Eine neuere Version von [ProductName] ist bereits installiert." />
</WixLocalization>
+18
View File
@@ -0,0 +1,18 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Pamhagen"
Manufacturer="Pamhagen"
Version="$(var.ProductVersion)"
Language="3079"
UpgradeCode="f214bfc6-1cd0-4971-807e-a4830e3b82a3"
Scope="perMachine"
Compressed="true">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)"
AllowSameVersionUpgrades="no" />
<MediaTemplate EmbedCab="true" CompressionLevel="high" />
<Feature Id="Main" Title="Pamhagen" Level="1">
<ComponentGroupRef Id="MainComponents" />
<ComponentGroupRef Id="ShortcutComponents" />
</Feature>
</Package>
</Wix>
+39
View File
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<ComponentGroup Id="ShortcutComponents">
<Component Id="StartMenuFolderShortcut"
Directory="StartMenuProgramsFolder"
Guid="6101b33f-9bc8-4d44-aad0-0f3eddc840c6">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="!(bind.Property.ProductName)"
Description="!(bind.Property.ProductName)"
Target="[INSTALLFOLDER]PamhagenSysCtrl.exe"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="StartMenuProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
Name="start_menu_installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
<Component Id="DesktopFolderShortcut"
Directory="DesktopFolder"
Guid="58b61147-4e5c-4581-8593-fc7bcb591048">
<Shortcut Id="DesktopShortcut"
Name="!(bind.Property.ProductName)"
Description="!(bind.Property.ProductName)"
Target="[INSTALLFOLDER]PamhagenSysCtrl.exe"
WorkingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKCU"
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
Name="desktop_installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
+7
View File
@@ -1,3 +1,10 @@
<Solution>
<Configurations>
<Platform Name="Any CPU" />
</Configurations>
<Project Path="Installer/Installer.wixproj">
<Platform Solution="*|Any CPU" Project="x64" />
<Build Solution="*|Any CPU" Project="true" />
</Project>
<Project Path="PamhagenSysCtrl/PamhagenSysCtrl.csproj" />
</Solution>
+3
View File
@@ -3,6 +3,9 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<Version>1.0.0</Version>
<Product>Pamhagen</Product>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>