Skip to content

Commit ae74291

Browse files
author
Marcus Sonestedt
committed
ServoPidControlSetup: Fix installer, add GPL as RTF
1 parent 35cbb7c commit ae74291

File tree

5 files changed

+303
-60
lines changed

5 files changed

+303
-60
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<Fragment>
4+
<ComponentGroup Id="GeneratedDependencies" Directory="SERVOPIDCONTROL">
5+
<Component Id="Castle.Core">
6+
<File Id="Castle.Core" Name="Castle.Core.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\Castle.Core.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
7+
</Component>
8+
<Component Id="ControlzEx">
9+
<File Id="ControlzEx" Name="ControlzEx.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\ControlzEx.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
10+
</Component>
11+
<Component Id="MahApps.Metro">
12+
<File Id="MahApps.Metro" Name="MahApps.Metro.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\MahApps.Metro.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
13+
</Component>
14+
<Component Id="Microsoft.Maps.MapControl.WPF">
15+
<File Id="Microsoft.Maps.MapControl.WPF" Name="Microsoft.Maps.MapControl.WPF.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\Microsoft.Maps.MapControl.WPF.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
16+
</Component>
17+
<Component Id="Moq">
18+
<File Id="Moq" Name="Moq.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\Moq.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
19+
</Component>
20+
<Component Id="mpolewaczyk.InteractiveDataDisplay.WPF">
21+
<File Id="mpolewaczyk.InteractiveDataDisplay.WPF" Name="mpolewaczyk.InteractiveDataDisplay.WPF.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\mpolewaczyk.InteractiveDataDisplay.WPF.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
22+
</Component>
23+
<Component Id="NLog">
24+
<File Id="NLog" Name="NLog.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\NLog.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
25+
</Component>
26+
<Component Id="System.Reactive">
27+
<File Id="System.Reactive" Name="System.Reactive.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\System.Reactive.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
28+
</Component>
29+
<Component Id="System.Runtime.CompilerServices.Unsafe">
30+
<File Id="System.Runtime.CompilerServices.Unsafe" Name="System.Runtime.CompilerServices.Unsafe.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\System.Runtime.CompilerServices.Unsafe.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
31+
</Component>
32+
<Component Id="System.Threading.Tasks.Extensions">
33+
<File Id="System.Threading.Tasks.Extensions" Name="System.Threading.Tasks.Extensions.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\System.Threading.Tasks.Extensions.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
34+
</Component>
35+
<Component Id="System.Windows.Interactivity">
36+
<File Id="System.Windows.Interactivity" Name="System.Windows.Interactivity.dll" Source="C:\Users\marcu\source\repos\marcusl\ServoPID\ServoPIDControl\bin\Release\System.Windows.Interactivity.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
37+
</Component>
38+
</ComponentGroup>
39+
</Fragment>
40+
</Wix>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@echo off
2+
REM FROM: https://stackoverflow.com/questions/302393/including-all-dependencies
3+
setlocal
4+
5+
set SEARCHDIR=%1
6+
set OUTPUTFILE=%2
7+
set TARGETINSTALLDIR=%3
8+
9+
echo Starting Dependency check...
10+
echo ^<?xml version="1.0" encoding="UTF-8"?^> > %OUTPUTFILE%
11+
echo ^<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"^> >> %OUTPUTFILE%
12+
echo ^<Fragment^> >> %OUTPUTFILE%
13+
echo ^<ComponentGroup Id="GeneratedDependencies" Directory="%TARGETINSTALLDIR%"^> >> %OUTPUTFILE%
14+
15+
for %%F in (%SEARCHDIR%\*.dll) do (
16+
echo "-- Adding %%~nxF"
17+
echo ^<Component Id="%%~nF"^> >> %OUTPUTFILE%
18+
echo ^<File Id="%%~nF" Name="%%~nxF" Source="%%~dpnxF" Vital="yes" KeyPath="yes" DiskId="1"/^> >> %OUTPUTFILE%
19+
echo ^</Component^> >> %OUTPUTFILE%
20+
)
21+
echo ^</ComponentGroup^> >> %OUTPUTFILE%
22+
echo ^</Fragment^> >> %OUTPUTFILE%
23+
echo ^</Wix^> >> %OUTPUTFILE%
24+
echo Dependency check done.

ServoPidControlSetup/Product.wxs

Lines changed: 67 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,80 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
3-
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
42

5-
<?define ServoPidControl_TargetDir = $(var.ServoPidControl.TargetDir)?>
3+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
4+
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
65

7-
<!-- Product name as you want it to appear in Add/Remove Programs-->
8-
<?if $(var.Platform) = x64 ?>
9-
<?define ProductName = "Arduino ServoPID Control (64 bit)" ?>
10-
<?define Win64 = "yes" ?>
11-
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
12-
<?else ?>
13-
<?define ProductName = "Arduino ServoPID Control" ?>
14-
<?define Win64 = "no" ?>
15-
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
16-
<?endif ?>
6+
<?define ServoPidControl_TargetDir = $(var.ServoPidControl.TargetDir)?>
7+
<?define ServoPid_ProjectDir = $(var.ServoPid.ProjectDir)?>
178

18-
<?define InstallName = "$(var.ProductName) Setup" ?>
9+
<?define InstallName = "Arduino ServoPID Control" ?>
1910

20-
<Product Id="*" Name="ServoPidControlSetup" Language="1033" Version="!(bind.fileVersion.fil98E434A3D16D3BA191E09BFF8689F70E)" Manufacturer="Marcus Sonestedt" UpgradeCode="2e6a5032-2d70-4ecd-9af1-66c9a3ce4e4b">
21-
<Package InstallerVersion="200" InstallPrivileges="elevated" InstallScope="perMachine" Platform="$(var.Platform)" Compressed="yes" Description="$(var.ProductName)" />
11+
<!-- Product name as you want it to appear in Add/Remove Programs-->
12+
<?if $(var.Platform) = x64 ?>
13+
<?define ProductName = "$(var.InstallName) (64 bit)" ?>
14+
<?define Win64 = "yes" ?>
15+
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
16+
<?else ?>
17+
<?define ProductName = "$(var.InstallName)" ?>
18+
<?define Win64 = "no" ?>
19+
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
20+
<?endif ?>
2221

23-
<MajorUpgrade AllowDowngrades="yes" Schedule="afterInstallInitialize" />
24-
<MediaTemplate EmbedCab="yes" />
22+
<Product Id="*" Name="ServoPidControlSetup" Language="1033"
23+
Version="!(bind.fileVersion.fil98E434A3D16D3BA191E09BFF8689F70E)" Manufacturer="Marcus Sonestedt"
24+
UpgradeCode="2e6a5032-2d70-4ecd-9af1-66c9a3ce4e4b">
25+
<Package InstallerVersion="200" InstallScope="perMachine" Platform="$(var.Platform)" InstallPrivileges="elevated"
26+
Compressed="yes" Description="$(var.ProductName)" />
2527

26-
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
27-
<UIRef Id="WixUI_InstallDir" />
28+
<MajorUpgrade AllowDowngrades="no" Schedule="afterInstallInitialize"
29+
DowngradeErrorMessage="Newer version detected. Uninstall first before downgrading."
30+
AllowSameVersionUpgrades="yes"/>
31+
<MediaTemplate EmbedCab="yes" />
2832

29-
<Property Id="INSTALLLOCATION">
30-
<RegistrySearch Id="RegistrySearch" Type="raw" Root="HKLM" Win64="$(var.Win64)" Key="Software\Company\Product" Name="InstallLocation" />
31-
</Property>
33+
<WixVariable Id="WixUILicenseRtf" Value="gpl-3.0.rtf" />
3234

33-
<Property Id="ARPHELPLINK" Value="https://github.com/marcusl/ArduinoServoPID" />
35+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
36+
<UIRef Id="WixUI_InstallDir" />
3437

35-
<Feature Id="ProductFeature" Title="ServoPidControlSetup" Level="1">
36-
<ComponentGroupRef Id="ServoPidControl.Binaries" />
37-
<ComponentGroupRef Id="ServoPidControl.Content" />
38-
<ComponentGroupRef Id="ServoPidControl.Satellites" />
39-
<Component Directory='INSTALLLOCATION'>
40-
<RegistryValue Root='HKCU' Key='SOFTWARE\ServoPidControl' Name='InstallLocation' Value='[INSTALLLOCATION]' Type='string' />
41-
<RemoveFolder Id='CleanupApplicationFolder' On='uninstall' />
42-
</Component>
43-
</Feature>
38+
<Property Id="ARPHELPLINK" Value="https://github.com/marcusl/ArduinoServoPID" />
4439

45-
<!-- Not supported yet? https://github.com/wixtoolset/issues/issues/5575
46-
<PropertyRef Id="NETFRAMEWORK471" />
47-
<Condition Message="You must install Microsoft .NET 4.7.1">
48-
<![CDATA[Installed OR NETFRAMEWORK471]]>
49-
</Condition>
50-
-->
51-
<PropertyRef Id="NETFRAMEWORK45" />
52-
<Condition Message="[ProductName] Requires .NET Framework 4.7.2 or later to be installed">
53-
<![CDATA[Installed OR (NETFRAMEWORK45 AND NETFRAMEWORK45 >= "#461814")]]> <!-- see https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed -->
54-
</Condition>
40+
<Feature Id="ProductFeature" Title="ServoPidControlSetup" Level="1">
41+
<ComponentGroupRef Id="ServoPidControl.Binaries" />
42+
<ComponentGroupRef Id="ServoPidControl.Content" />
43+
<ComponentGroupRef Id="ServoPidControl.Satellites" />
44+
<ComponentGroupRef Id="ServoPidControl.Sources" />
45+
46+
<ComponentGroupRef Id="GeneratedDependencies"/>
5547

56-
<InstallExecuteSequence>
57-
<InstallExecute After="RemoveExistingProducts" />
58-
</InstallExecuteSequence>
59-
</Product>
48+
<ComponentGroupRef Id="ServoPid.Sources" />
49+
</Feature>
6050

61-
<Fragment>
62-
<Directory Id="TARGETDIR" Name="SourceDir">
63-
<Directory Id="ProgramFilesFolder">
64-
<Directory Id="INSTALLLOCATION" Name="$(var.InstallName)"/>
65-
</Directory>
66-
</Directory>
67-
</Fragment>
68-
</Wix>
51+
<!-- v4.7.2 not supported yet? https://github.com/wixtoolset/issues/issues/5575 -->
52+
<PropertyRef Id="NETFRAMEWORK45" />
53+
<Condition Message="[ProductName] Requires .NET Framework 4.7.2 or later to be installed">
54+
<![CDATA[Installed OR (NETFRAMEWORK45 AND NETFRAMEWORK45 >= "#461814")]]> <!-- see https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed -->
55+
</Condition>
56+
57+
<InstallExecuteSequence>
58+
<InstallExecute After="RemoveExistingProducts" />
59+
</InstallExecuteSequence>
60+
</Product>
61+
62+
<Fragment>
63+
<Directory Id="TARGETDIR" Name="SourceDir">
64+
<Directory Id="ProgramFilesFolder">
65+
<Directory Id="INSTALLFOLDER" Name="$(var.InstallName)">
66+
<Directory Id="SERVOPID" Name="ServoPid" />
67+
<Directory Id="SERVOPIDCONTROL" Name="ServoPidControl" />
68+
</Directory>
69+
</Directory>
70+
</Directory>
71+
</Fragment>
72+
73+
<Fragment>
74+
<ComponentGroup Id="ServoPid.Sources">
75+
<Component Directory="SERVOPID">
76+
<File Source="$(var.ServoPid_ProjectDir)/servopid.ino" />
77+
</Component>
78+
</ComponentGroup>
79+
</Fragment>
80+
</Wix>

ServoPidControlSetup/ServoPidControlSetup.wixproj

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
2020
</PropertyGroup>
2121
<ItemGroup>
22+
<Compile Include="Dependencies.wxs" />
2223
<Compile Include="Product.wxs" />
2324
</ItemGroup>
2425
<ItemGroup>
@@ -28,8 +29,16 @@
2829
<Private>True</Private>
2930
<DoNotHarvest>
3031
</DoNotHarvest>
31-
<RefProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</RefProjectOutputGroups>
32-
<RefTargetDir>INSTALLLOCATION</RefTargetDir>
32+
<RefProjectOutputGroups>Binaries;Symbols;Sources;Content</RefProjectOutputGroups>
33+
<RefTargetDir>SERVOPIDCONTROL</RefTargetDir>
34+
</ProjectReference>
35+
<ProjectReference Include="..\ServoPid\ServoPid.vcxproj">
36+
<Name>ServoPid</Name>
37+
<Project>{1fd10ce4-f14c-4475-ae3c-e64a7e7ff78b}</Project>
38+
<Private>True</Private>
39+
<DoNotHarvest>True</DoNotHarvest>
40+
<RefProjectOutputGroups>Sources</RefProjectOutputGroups>
41+
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
3342
</ProjectReference>
3443
</ItemGroup>
3544
<ItemGroup>
@@ -49,6 +58,10 @@
4958
<ItemGroup>
5059
<EmbeddedResource Include="Strings.wxl" />
5160
</ItemGroup>
61+
<ItemGroup>
62+
<Content Include="GenerateDependencies.bat" />
63+
<Content Include="gpl-3.0.rtf" />
64+
</ItemGroup>
5265
<PropertyGroup>
5366
<EnableProjectHarvesting>True</EnableProjectHarvesting>
5467
</PropertyGroup>
@@ -57,15 +70,17 @@
5770
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
5871
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
5972
</Target>
60-
61-
<Target Name="BeforeBuild">
73+
<Target Name="BeforeBuild">
6274
<GetAssemblyIdentity AssemblyFiles="..\ServoPidControl\bin\$(Configuration)\ServoPidControl.exe">
6375
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
6476
</GetAssemblyIdentity>
6577
<CreateProperty Value="ServoPidControl Setup %(AsmInfo.Version) $(Platform) $(Configuration)">
6678
<Output TaskParameter="Value" PropertyName="TargetName" />
6779
</CreateProperty>
68-
</Target>
80+
</Target>
81+
<PropertyGroup>
82+
<PreBuildEvent>call "$(ProjectDir)GenerateDependencies.bat" "$(SolutionDir)\ServoPidControl\bin\$(Configuration)\" "$(ProjectDir)Dependencies.wxs" SERVOPIDCONTROL</PreBuildEvent>
83+
</PropertyGroup>
6984
<!--
7085
To modify your build process, add your task inside one of the targets below and uncomment it.
7186
Other similar extension points exist, see Wix.targets.

0 commit comments

Comments
 (0)