Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ edit-git-bash.exe
/msi/obj/
/msi/package-versions.txt
/msi/wix40-binaries.zip
/msix/root/
/nuget/GitForWindows.nuspec
/nuget/Git-Windows-Minimal.nuspec
/nuget/Git-Windows-Minimal.nuspec.unmoved
Expand Down
161 changes: 161 additions & 0 deletions msix/appxmanifest.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
IgnorableNamespaces="uap uap2 uap3 rescap desktop desktop6 uap10">

<Identity
Name="Git.GitforWindows"
Publisher="CN=The Git Development Community"
Version="@@VERSION@@" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @@VERSION@@ placeholder makes sense. Nit: The commit message talks about @@Version@@ instead.


<Properties>
<DisplayName>Git for Windows</DisplayName>
<PublisherDisplayName>The Git Development Community</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
<Description>Git for Windows focuses on offering a lightweight, native set of tools that bring the full feature set of the Git to Windows while providing appropriate user interfaces for experienced users.</Description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Description>Git for Windows focuses on offering a lightweight, native set of tools that bring the full feature set of the Git to Windows while providing appropriate user interfaces for experienced users.</Description>
<Description>Git for Windows focuses on offering a lightweight, native set of tools that bring the full feature set of Git to Windows while providing appropriate user interfaces for experienced users.</Description>

I don't think I've ever seen "the Git" in any reasonably formal writing.

<desktop6:FileSystemWriteVirtualization>disabled</desktop6:FileSystemWriteVirtualization>
<desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the MinVersion also need a placeholder, so we can switch it to 10.0.2XXX.0 on CLANGARM64 (due to the requirement for x64 emulation)?

</Dependencies>

<Resources>
<Resource Language="en-us"/>
</Resources>

<Applications>
<Application Id="GitBash" Executable="git-bash.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap3:VisualElements
DisplayName="Git Bash"
Description="Git Bash - Unix-like command line for Git"
VisualGroup="Git for Windows"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
</uap3:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="git-bash.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="GitCmd" Executable="git-cmd.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap3:VisualElements
DisplayName="Git CMD"
Description="Git CMD - Windows command line for Git"
VisualGroup="Git for Windows"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
</uap3:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="git-cmd.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="GitGui" Executable="cmd\git-gui.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap3:VisualElements
DisplayName="Git GUI"
Description="Git GUI - Windows graphical interface for Git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Description="Git GUI - Windows graphical interface for Git"
Description="Git GUI - Graphical interface for Git"

VisualGroup="Git for Windows"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
</uap3:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="git-gui.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="Bash" Executable="bin\bash.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the bash alias? It would allow MSIX users to create their own Windows Terminal profile, so it might be usefull.

<uap:VisualElements
DisplayName="Bash"
Description="Bash shell"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
AppListEntry="none">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="bash.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="Git" Executable="bin\git.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap:VisualElements
DisplayName="Git"
Description="Git version control"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
AppListEntry="none">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="git.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="Sh" Executable="bin\sh.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap:VisualElements
DisplayName="Sh"
Description="Shell"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
AppListEntry="none">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="sh.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="Nano" Executable="usr\bin\nano.exe" uap10:RuntimeBehavior="win32App" uap10:TrustLevel="mediumIL">
<uap:VisualElements
DisplayName="Nano"
Description="Nano Editor"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
AppListEntry="none">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="nano.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="unvirtualizedResources" />
</Capabilities>
</Package>
110 changes: 110 additions & 0 deletions msix/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/sh

# Build the MSIX package for Git for Windows.

. "$(dirname "$0")/../release-common.sh"

case "$MSYSTEM" in
MINGW32) ARTIFACT_SUFFIX="x86";;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we'll need a MINGW32 MSIX.

MINGW64) ARTIFACT_SUFFIX="x64";;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this explains why the suffix isn't common. I'm not sure how I feel about introducing a different suffix for one artefact, though.

CLANGARM64) ARTIFACT_SUFFIX=arm64;;
esac

# MSIX requires version in X.X.X.X format (numeric only)
# Convert Git for Windows versions like "2.47.1.windows.1" to "2.47.1.1"
# and test versions like "0-test" to "0.0.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any plans how to handle snapshot and rc builds?

MSIX_VERSION="$(echo "$VERSION" | sed -e 's/\.windows\./\./' -e 's/[^0-9.]//g')"
# Ensure we have exactly 4 numeric segments
while test "$(echo "$MSIX_VERSION" | tr -cd '.' | wc -c)" -lt 3
do
MSIX_VERSION="$MSIX_VERSION.0"
done

TARGET="$output_directory"/Git.GitforWindows_"$VERSION"_"$ARTIFACT_SUFFIX".msix

# Generate MSIX asset images from SVG
ASSETS_DIR="$SCRIPT_PATH/Assets"
mkdir -p "$ASSETS_DIR" ||
die "Could not create Assets directory"

type rsvg-convert ||
case "$ARCH" in
i686) pacman -Sy --noconfirm mingw-w64-i686-librsvg;;
x86_64) pacman -Sy --noconfirm mingw-w64-x86_64-librsvg;;
aarch64) pacman -Sy --noconfirm mingw-w64-clang-aarch64-librsvg;;
esac ||
die "Could not install librsvg"

SVG_SOURCE="$SCRIPT_PATH/../git-for-windows.svg"
for spec in \
LockScreenLogo.png:24 \
LockScreenLogo.scale-200.png:48 \
Square150x150Logo.png:150 \
Square150x150Logo.scale-200.png:300 \
Square44x44Logo.png:44 \
Square44x44Logo.scale-200.png:88 \
Square44x44Logo.targetsize-24_altform-unplated.png:24 \
StoreLogo.png:50
do
name="${spec%%:*}"
size="${spec##*:}"
rsvg-convert -w "$size" -h "$size" "$SVG_SOURCE" \
-o "$ASSETS_DIR/$name" ||
die "Could not generate $name"
done

prepare_root

init_etc_gitconfig
generate_file_list "$@"
copy_dlls_to_libexec
unpack_pdbs

# Find makeappx.exe from the Windows SDK
MAKEAPPX=
for sdk_dir in "/c/Program Files (x86)/Windows Kits/10/bin"/*/
do
case "$ARCH" in
x86_64) sdk_arch=x64;;
i686) sdk_arch=x86;;
aarch64) sdk_arch=arm64;;
esac
if test -f "$sdk_dir$sdk_arch/makeappx.exe"
then
MAKEAPPX="$sdk_dir$sdk_arch/makeappx.exe"
fi
done
test -n "$MAKEAPPX" ||
die "Could not find makeappx.exe in the Windows SDK"

# Create MSIX

MAPFILE=$SCRIPT_PATH/root/files.map
MANIFESTIN=$SCRIPT_PATH/appxmanifest.xml.in
MANIFESTOUT=$SCRIPT_PATH/root/appxmanifest.xml

echo "Create MSIX"

sed -e "s/@@VERSION@@/$MSIX_VERSION/g" <"$MANIFESTIN" >"$MANIFESTOUT"

echo "[Files]" >"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/root/appxmanifest.xml\" \"AppxManifest.xml\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/root/bin/git.exe\" \"bin/git.exe\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/root/bin/sh.exe\" \"bin/sh.exe\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/root/bin/bash.exe\" \"bin/bash.exe\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/LockScreenLogo.png\" \"Assets/LockScreenLogo.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/LockScreenLogo.scale-200.png\" \"Assets/LockScreenLogo.scale-200.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square150x150Logo.png\" \"Assets/Square150x150Logo.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square150x150Logo.scale-200.png\" \"Assets/Square150x150Logo.scale-200.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square44x44Logo.png\" \"Assets/Square44x44Logo.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square44x44Logo.scale-200.png\" \"Assets/Square44x44Logo.scale-200.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square44x44Logo.targetsize-24_altform-unplated.png\" \"Assets/Square44x44Logo.targetsize-24_altform-unplated.png\"" >>"$MAPFILE" &&
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/StoreLogo.png\" \"Assets/StoreLogo.png\"" >>"$MAPFILE" &&
MSYS_ROOT="$(cygpath -aw /)" &&
echo "$LIST" | while IFS= read -r entry; do
winpath="${entry//\//\\}"
echo "\"$MSYS_ROOT\\$winpath\" \"$winpath\""
done >>"$MAPFILE"

MSYS_NO_PATHCONV=1 "$MAKEAPPX" pack /v /o /f "$(cygpath -aw "$MAPFILE")" /p "$(cygpath -aw "$TARGET")" &&
echo "Package created at $TARGET"
Loading