-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Windows x64 and arm64 builds #1846
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<Project> | ||
<Project> | ||
<!-- Implicit SDK props import --> | ||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net472</TargetFramework> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
<EnableDefaultItems>false</EnableDefaultItems> | ||
<PayloadPath>$(PlatformOutPath)Installer.Windows\bin\$(Configuration)\net472\win-x86</PayloadPath> | ||
<PayloadPath>$(PlatformOutPath)Installer.Windows\bin\$(Configuration)\net472\$(RuntimeIdentifier)</PayloadPath> | ||
<InnoSetupVersion>6.3.1</InnoSetupVersion> | ||
</PropertyGroup> | ||
|
||
|
@@ -27,12 +27,20 @@ | |
|
||
<Target Name="CoreCompile" Condition="'$(OSPlatform)'=='windows'"> | ||
<PropertyGroup> | ||
<InnoSetupCommandSystem>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=system "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandSystem> | ||
<InnoSetupCommandUser>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=user "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandUser> | ||
<InnoSetupCommandSystem>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=system /DGcmRuntimeIdentifier="$(RuntimeIdentifier)" "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandSystem> | ||
<InnoSetupCommandUser>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=user /DGcmRuntimeIdentifier="$(RuntimeIdentifier)" "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandUser> | ||
</PropertyGroup> | ||
|
||
<Message Text="Lay Out" Importance="High" /> | ||
<Exec Condition="'$(NoLayout)'!='true'" Command="powershell.exe –NonInteractive –ExecutionPolicy Unrestricted -Command "& {&'$(MSBuildProjectDirectory)\layout.ps1' -Configuration '$(Configuration)' -Output '$(PayloadPath)'}"" /> | ||
<Exec Condition="'$(NoLayout)'!='true'" | ||
ConsoleToMSBuild="true" | ||
Command="powershell.exe –NonInteractive –ExecutionPolicy Unrestricted -Command "& {&'$(MSBuildProjectDirectory)\layout.ps1' -Configuration '$(Configuration)' -Output '$(PayloadPath)' -RuntimeIdentifier '$(RuntimeIdentifier)'; if ($?) { exit 0 } else { exit 1 }}"" | ||
IgnoreExitCode="true"> | ||
<!-- If we want to display the console output if the exit code is not 0, we need to capture it and then output it using the <Error /> below --> | ||
<Output TaskParameter="ExitCode" PropertyName="ExitCodeOfExec" /> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" /> | ||
</Exec> | ||
<Error Condition="'$(NoLayout)'!='true' AND '$(ExitCodeOfExec)' != '0'" Text="Layout script failed with exit code $(ExitCodeOfExec) and message $(OutputOfExec)" /> | ||
Comment on lines
-35
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While updating |
||
<Message Text="$(InnoSetupCommandSystem)" Importance="High" /> | ||
<Exec Command="$(InnoSetupCommandSystem)" /> | ||
<Message Text="$(InnoSetupCommandUser)" Importance="High" /> | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -15,6 +15,10 @@ | |||||||||||||||||
#error Installer target property 'InstallTarget' must be specifed | ||||||||||||||||||
#endif | ||||||||||||||||||
|
||||||||||||||||||
#ifndef GcmRuntimeIdentifier | ||||||||||||||||||
#error GCM Runtime Identifier 'GcmRuntimeIdentifier' must be specifed (e.g. win-x64) | ||||||||||||||||||
#endif | ||||||||||||||||||
|
||||||||||||||||||
#if InstallTarget == "user" | ||||||||||||||||||
#define GcmAppId "{{aa76d31d-432c-42ee-844c-bc0bc801cef3}}" | ||||||||||||||||||
#define GcmLongName "Git Credential Manager (User)" | ||||||||||||||||||
|
@@ -40,7 +44,6 @@ | |||||||||||||||||
#define GcmRepoRoot "..\..\.." | ||||||||||||||||||
#define GcmAssets GcmRepoRoot + "\assets" | ||||||||||||||||||
#define GcmExe "git-credential-manager.exe" | ||||||||||||||||||
#define GcmArch "x86" | ||||||||||||||||||
|
||||||||||||||||||
#ifnexist PayloadDir + "\" + GcmExe | ||||||||||||||||||
#error Payload files are missing | ||||||||||||||||||
|
@@ -67,9 +70,17 @@ AppUpdatesURL={#GcmUrl} | |||||||||||||||||
AppContact={#GcmUrl} | ||||||||||||||||||
AppCopyright={#GcmCopyright} | ||||||||||||||||||
AppReadmeFile={#GcmReadme} | ||||||||||||||||||
; Windows ARM64 supports installing and running x64 binaries, but not vice versa. | ||||||||||||||||||
#if GcmRuntimeIdentifier=="win-x64" | ||||||||||||||||||
ArchitecturesAllowed=x64compatible | ||||||||||||||||||
ArchitecturesInstallIn64BitMode=x64compatible | ||||||||||||||||||
#elif GcmRuntimeIdentifier=="win-arm64" | ||||||||||||||||||
ArchitecturesAllowed=arm64 | ||||||||||||||||||
ArchitecturesInstallIn64BitMode=arm64 | ||||||||||||||||||
#endif | ||||||||||||||||||
Comment on lines
+73
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this logic, the supported installation types are:
This ensures that e.g. x64 Windows can not accidentally install the arm64 GCM version, which it can't run. If you want, we could even make this more strict and force users of x64 Windows to install the x64 version and prohibit installation of the x86 version on that architecture, even though it will work on there as well. But that probably goes a bit too far. Also, on x64 and arm64, this will install GCM into |
||||||||||||||||||
VersionInfoVersion={#GcmVersion} | ||||||||||||||||||
LicenseFile={#GcmRepoRoot}\LICENSE | ||||||||||||||||||
OutputBaseFilename={#GcmSetupExe}-win-{#GcmArch}-{#GcmVersionSimple} | ||||||||||||||||||
OutputBaseFilename={#GcmSetupExe}-{#GcmRuntimeIdentifier}-{#GcmVersionSimple} | ||||||||||||||||||
DefaultDirName={autopf}\{#GcmShortName} | ||||||||||||||||||
Compression=lzma2 | ||||||||||||||||||
SolidCompression=yes | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly,
dotnet build
doesn't support setting--runtime
at the solution level. I basically took the same logic as #1633 by setting it at the project level: theInstaller.Windows
project has all the necessary dependencies so this builds correctly.