diff --git a/.gitignore b/.gitignore index c5d11ab7..b215777e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ bin/ benchmark/ out/ -resources.syso +resource.syso # only allow man/*.\d.ronn files man/* diff --git a/appveyor.yml b/appveyor.yml index 5fea14fc..e07bcf45 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,6 @@ install: - set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH% build_script: - - C:\Ruby23\DevKit\mingw\bin\windres.exe script\windows-installer\resources.rc -o resources.syso - bash --login -c 'GOARCH=386 script/bootstrap' - mv bin\git-lfs.exe git-lfs-x86.exe - bash --login -c 'GOARCH=amd64 script/bootstrap' diff --git a/git-lfs.go b/git-lfs.go index 823dcebd..c0dad72a 100644 --- a/git-lfs.go +++ b/git-lfs.go @@ -1,3 +1,5 @@ +//go:generate goversioninfo -icon=script/windows-installer/git-lfs-logo.ico + package main import ( diff --git a/script/bootstrap b/script/bootstrap index 1ed05341..e57a1b80 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -14,6 +14,14 @@ if [ -z "$GOPATH" ]; then ln -s "$GOPATH" src/github.com/git-lfs/git-lfs fi +if uname -s | grep -q "_NT-"; then + echo "Installing goversioninfo to embed resources into Windows executables..." + go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo + export PATH=$PATH:$GOPATH/bin/windows_386 + echo "Creating the resource.syso version information file..." + go generate +fi + script/fmt rm -rf bin/* GO15VENDOREXPERIMENT=1 go run script/*.go -cmd build "$@" diff --git a/script/windows-installer/resources.rc b/script/windows-installer/resources.rc deleted file mode 100644 index 5fb0b451..00000000 --- a/script/windows-installer/resources.rc +++ /dev/null @@ -1,20 +0,0 @@ -main ICON "git-lfs-logo.ico" -1 VERSIONINFO -FILEVERSION 1,5,0,0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */ - BEGIN - VALUE "FileDescription", "Git LFS\0" - VALUE "ProductName", "Git Large File Storage (LFS)\0" - VALUE "ProductVersion", "1.5.0\0" - VALUE "LegalCopyright", "GitHub, Inc. and Git LFS contributors\0" - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/update-version.sh b/update-version.sh index a1d2292e..936fdb1d 100755 --- a/update-version.sh +++ b/update-version.sh @@ -4,7 +4,8 @@ VERSION_STRING=$1 VERSION_ARRAY=( ${VERSION_STRING//./ } ) VERSION_MAJOR=${VERSION_ARRAY[0]} VERSION_MINOR=${VERSION_ARRAY[1]} -VERSION_PATCH=${VERSION_ARRAY[2]} +VERSION_PATCH=${VERSION_ARRAY[2]:-0} +VERSION_BUILD=${VERSION_ARRAY[3]:-0} # Update the version number git-lfs is reporting. sed -i "s,\(Version = \"\).*\(\"\),\1$VERSION_STRING\2," config/version.go @@ -13,5 +14,8 @@ sed -i "s,\(Version = \"\).*\(\"\),\1$VERSION_STRING\2," config/version.go sed -i "s,\(Version:[[:space:]]*\).*,\1$VERSION_STRING," rpm/SPECS/git-lfs.spec # Update the version numbers in the Windows installer. -sed -i "s,\(FILEVERSION \).*,\1$VERSION_MAJOR\,$VERSION_MINOR\,$VERSION_PATCH\,0," script/windows-installer/resources.rc -sed -i "s,\([[:space:]]*VALUE \"ProductVersion\"\, \"\).*\(\\\\0\"\),\1$VERSION_STRING\2," script/windows-installer/resources.rc +sed -i "s,\(\"Major\": \).*\,,\1$VERSION_MAJOR\,," versioninfo.json +sed -i "s,\(\"Minor\": \).*\,,\1$VERSION_MINOR\,," versioninfo.json +sed -i "s,\(\"Patch\": \).*\,,\1$VERSION_PATCH\,," versioninfo.json +sed -i "s,\(\"Build\": \).*,\1$VERSION_BUILD," versioninfo.json +sed -i "s,\(\"ProductVersion\": \"\).*\(\"\),\1$VERSION_STRING\2," versioninfo.json diff --git a/versioninfo.json b/versioninfo.json new file mode 100644 index 00000000..3d1e5ec7 --- /dev/null +++ b/versioninfo.json @@ -0,0 +1,18 @@ +{ + "FixedFileInfo": + { + "FileVersion": { + "Major": 1, + "Minor": 5, + "Patch": 0, + "Build": 0 + } + }, + "StringFileInfo": + { + "FileDescription": "Git LFS", + "LegalCopyright": "GitHub, Inc. and Git LFS contributors", + "ProductName": "Git Large File Storage (LFS)", + "ProductVersion": "1.5.0" + } +}