Skip to content

Commit b0ed850

Browse files
committed
further optimizations to build.sh to include manifest
1 parent a363a4a commit b0ed850

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

build.sh

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,43 @@ generate_windows_versioninfo() {
5757
minor=${minor:-0}
5858
patch=${patch:-0}
5959

60+
# Create Windows application manifest
61+
cat > "${MAIN_PKG}/hfdownloader.exe.manifest" << 'MANIFEST'
62+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
63+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
64+
<assemblyIdentity
65+
type="win32"
66+
name="HuggingFaceModelDownloader"
67+
version="1.0.0.0"
68+
processorArchitecture="amd64"/>
69+
<description>HuggingFace Model Downloader - Download AI models from HuggingFace Hub</description>
70+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
71+
<security>
72+
<requestedPrivileges>
73+
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
74+
</requestedPrivileges>
75+
</security>
76+
</trustInfo>
77+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
78+
<application>
79+
<!-- Windows 10/11 -->
80+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
81+
<!-- Windows 8.1 -->
82+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
83+
<!-- Windows 8 -->
84+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
85+
<!-- Windows 7 -->
86+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
87+
</application>
88+
</compatibility>
89+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
90+
<windowsSettings>
91+
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
92+
</windowsSettings>
93+
</application>
94+
</assembly>
95+
MANIFEST
96+
6097
cat > "${MAIN_PKG}/versioninfo.json" << EOF
6198
{
6299
"FixedFileInfo": {
@@ -79,33 +116,38 @@ generate_windows_versioninfo() {
79116
"FileSubType": "00"
80117
},
81118
"StringFileInfo": {
82-
"Comments": "HuggingFace Model Downloader - Download models from HuggingFace Hub",
83-
"CompanyName": "Open Source",
84-
"FileDescription": "HuggingFace Model Downloader",
119+
"Comments": "HuggingFace Model Downloader - Download AI models from HuggingFace Hub",
120+
"CompanyName": "HuggingFace Model Downloader Project",
121+
"FileDescription": "HuggingFace Model Downloader CLI Tool",
85122
"FileVersion": "${VERSION}",
86123
"InternalName": "hfdownloader",
87-
"LegalCopyright": "Apache-2.0 License",
124+
"LegalCopyright": "Copyright (c) 2024-2026 HuggingFace Model Downloader Contributors. Apache-2.0 License.",
125+
"LegalTrademarks": "",
88126
"OriginalFilename": "hfdownloader.exe",
127+
"PrivateBuild": "",
89128
"ProductName": "HuggingFace Model Downloader",
90-
"ProductVersion": "${VERSION}"
129+
"ProductVersion": "${VERSION}",
130+
"SpecialBuild": ""
91131
},
92132
"VarFileInfo": {
93133
"Translation": {
94134
"LangID": "0409",
95135
"CharsetID": "04B0"
96136
}
97-
}
137+
},
138+
"ManifestPath": "hfdownloader.exe.manifest"
98139
}
99140
EOF
100141

101-
echo " Generating Windows version resource..."
142+
echo " Generating Windows version resource with manifest..."
102143
(cd "${MAIN_PKG}" && goversioninfo -o resource_windows_amd64.syso)
103144
return 0
104145
}
105146

106147
# Cleanup Windows version info files
107148
cleanup_windows_versioninfo() {
108149
rm -f "${MAIN_PKG}/versioninfo.json"
150+
rm -f "${MAIN_PKG}/hfdownloader.exe.manifest"
109151
rm -f "${MAIN_PKG}/resource_windows_amd64.syso"
110152
}
111153

0 commit comments

Comments
 (0)