Skip to content

Commit 3324af3

Browse files
authored
Merge pull request #2 from dorssel/versioning-and-upgrades
fix versioning and upgrades add code of conduct
2 parents 992d880 + ddd78da commit 3324af3

File tree

9 files changed

+72
-6
lines changed

9 files changed

+72
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ obj/
33
.vs/
44
*.user
55
launchSettings.json
6-
/local/
76
.vscode

CODE_OF_CONDUCT.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Minimalist Code of Conduct
2+
3+
We believe that an elaborate code of conduct invites a lot of fighting
4+
over intricate details, much like law, and we do not have the resources
5+
to build up the equivalent of a legal system. Therefore we prefer keeping
6+
our rules as short as possible and filling the gaps with the mortar of
7+
human interaction: empathy.
8+
9+
All we ask of members of this project is this:
10+
11+
1. Please treat each other with respect and understanding.
12+
2. Please respect our wish to not serve as a stage for disputes about
13+
fairness or personal differences.
14+
15+
If you can agree to these conditions, your contributions are welcome.
16+
If you cannot, please don’t spoil it for the rest of us.

GitVersion.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:GITHUB_RUN_NUMBER ?? 0}'

Installer/HarvestTransform.xslt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
version="1.0"
2424
exclude-result-prefixes="xsl">
2525

26+
<!-- copy everything -->
2627
<xsl:template match="@*|node()">
2728
<xsl:copy>
2829
<xsl:apply-templates select="@*|node()"/>

Installer/Installer.wixproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,25 @@
2626
<OutputName>usbipd-win</OutputName>
2727
<DefineSolutionProperties>false</DefineSolutionProperties>
2828
<PublishDir>..\UsbIpServer\bin\publish</PublishDir>
29+
<!--
30+
This ensures that each x.y.z version has a different product, so every upgrade is a MajorUpgrade.
31+
It also ensures that 2 builds of the same x.y.z version will never be installed simultaneously.
32+
The alternative (WiX AllowSameVersionUpgrades) causes ICE61.
33+
34+
The chance of a hash-collision is much smaller than the chance of forgetting to update ProductId manually.
35+
-->
36+
<ProductId>EA1D5623-E6A7-4E4A-9259-E397$(GitVersion_MajorMinorPatch.GetHashCode().ToString(X8))</ProductId>
2937
</PropertyGroup>
3038
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
3139
<OutputPath>bin\$(Configuration)\</OutputPath>
3240
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
33-
<DefineConstants>Debug;PublishDir=$(PublishDir);DriversDir=$(ProjectDir)..\Drivers</DefineConstants>
41+
<DefineConstants>Debug;PublishDir=$(PublishDir);DriversDir=$(ProjectDir)..\Drivers;ProductId=$(ProductId)</DefineConstants>
3442
<Cultures>en-US</Cultures>
3543
</PropertyGroup>
3644
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
3745
<OutputPath>bin\$(Configuration)\</OutputPath>
3846
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
39-
<DefineConstants>PublishDir=$(PublishDir);DriversDir=$(ProjectDir)..\Drivers</DefineConstants>
47+
<DefineConstants>PublishDir=$(PublishDir);DriversDir=$(ProjectDir)..\Drivers;ProductId=$(ProductId)</DefineConstants>
4048
<Cultures>en-US</Cultures>
4149
</PropertyGroup>
4250
<ItemGroup>

Installer/Product.wxs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
-->
1919
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
2020
<Product
21-
Id="{682E2D7D-3238-4FAC-A247-8EB306BF1C3C}"
21+
Id="$(var.ProductId)"
2222
Name="usbipd-win"
2323
Language="1033"
2424
Version="$(var.GitVersion_MajorMinorPatch)"
@@ -33,7 +33,17 @@
3333
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
3434
<?endif?>
3535

36-
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
36+
<!--
37+
We guarantee that two different x.y.z versions will have a different ProductId, so
38+
everything is always a MajorUpgrade. MinorUpdates and Patches have many requirements
39+
for Feature and Component changes, which we will no doubt forget about in the future.
40+
This being a small product, a MajorUpgrade is a small price to pay to prevent any mishaps.
41+
Since we strictly follow component rules, we use afterInstallExecute to speed things up a bit.
42+
-->
43+
<MajorUpgrade
44+
Schedule="afterInstallExecute"
45+
DowngradeErrorMessage="A newer version of [ProductName] is already installed."
46+
/>
3747

3848
<Property Id="ARPURLINFOABOUT">https://github.com/dorssel/usbipd-win</Property>
3949
<Property Id="ARPURLUPDATEINFO">https://github.com/dorssel/usbipd-win/releases</Property>

UsbIpServer/UsbIpServer.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
2626
<Platforms>x64</Platforms>
2727
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
28+
<ApplicationManifest>app.manifest</ApplicationManifest>
2829

2930
<!-- defaults (used by: dotnet build) -->
3031
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -40,7 +41,7 @@
4041
<Copyright>Copyright (C) $([System.DateTime]::UtcNow.ToString("yyyy")) $(Company)</Copyright>
4142

4243
<PublishProfile>Properties\PublishProfiles\InputForInstaller.pubxml</PublishProfile>
43-
</PropertyGroup>
44+
</PropertyGroup>
4445

4546
<ItemGroup>
4647
<Content Include="..\COPYING.md" Link="COPYING.md" CopyToOutputDirectory="PreserveNewest" />

UsbIpServer/app.manifest

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
8+
</requestedPrivileges>
9+
</security>
10+
</trustInfo>
11+
12+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
13+
<application>
14+
<!-- Windows 8 -->
15+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
16+
<!-- Windows 8.1 -->
17+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
18+
<!-- Windows 10 -->
19+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
20+
</application>
21+
</compatibility>
22+
23+
</assembly>

usbipd-win.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4DF1A44E-CAFC-4543-AB76-76239FBEDF03}"
99
ProjectSection(SolutionItems) = preProject
1010
.editorconfig = .editorconfig
11+
.gitattributes = .gitattributes
12+
.gitignore = .gitignore
13+
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
14+
COPYING.md = COPYING.md
15+
GitVersion.yml = GitVersion.yml
16+
README.md = README.md
17+
SECURITY.md = SECURITY.md
1118
EndProjectSection
1219
EndProject
1320
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "Installer\Installer.wixproj", "{080EF94C-A8EC-4975-A697-BBF8C1A56055}"

0 commit comments

Comments
 (0)