From 2b87ce16f747eb2f8b652d595d41338a09187613 Mon Sep 17 00:00:00 2001 From: iPromKnight Date: Fri, 22 May 2026 21:38:28 +0100 Subject: [PATCH] feat(windows): embed long-path-aware manifest in CLI binary (#587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a Windows application manifest with longPathAware=true (plus UTF-8 activeCodePage) and ships pre-generated .syso resources so the Go linker embeds the manifest automatically for GOOS=windows builds. The .syso files are GOOS/GOARCH-suffixed, so they are only linked into Windows binaries — linux and darwin builds are unaffected. Users must still enable the system-wide LongPathsEnabled registry key (or matching Group Policy) for Windows to honor the opt-in; README has a new section covering that. Also tightens an over-broad gitignore rule that was shadowing new files under cmd/altmount/. --- .gitignore | 4 +-- Makefile | 9 +++++ README.md | 27 +++++++++++++++ cmd/altmount/altmount.exe.manifest | 20 +++++++++++ cmd/altmount/resource_windows_386.syso | Bin 0 -> 1718 bytes cmd/altmount/resource_windows_amd64.syso | Bin 0 -> 1718 bytes cmd/altmount/resource_windows_arm.syso | Bin 0 -> 1718 bytes cmd/altmount/resource_windows_arm64.syso | Bin 0 -> 1718 bytes cmd/altmount/versioninfo.json | 42 +++++++++++++++++++++++ 9 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 cmd/altmount/altmount.exe.manifest create mode 100644 cmd/altmount/resource_windows_386.syso create mode 100644 cmd/altmount/resource_windows_amd64.syso create mode 100644 cmd/altmount/resource_windows_arm.syso create mode 100644 cmd/altmount/resource_windows_arm64.syso create mode 100644 cmd/altmount/versioninfo.json diff --git a/.gitignore b/.gitignore index 3b3e3493..df3e2998 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,8 @@ go.work.sum # .idea/ example/ -./altmount -altmount +/altmount +/altmount.exe *.db* *node_modules* .git diff --git a/Makefile b/Makefile index 2b351b12..661d1227 100644 --- a/Makefile +++ b/Makefile @@ -121,5 +121,14 @@ build-cli-windows: build-frontend # WinFsp must be installed on the target machine: https://winfsp.dev/ # WinFsp headers for cgofuse (if building natively): C:\Program Files (x86)\WinFsp\inc\fuse +# Regenerate the Windows resource (.syso) files from versioninfo.json + altmount.exe.manifest. +# The generated cmd/altmount/resource_windows_*.syso files are committed and the Go linker +# picks them up automatically for GOOS=windows builds — embedding the long-path-aware +# manifest. Re-run this target after editing versioninfo.json or altmount.exe.manifest. +# Requires: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest +.PHONY: windows-resources +windows-resources: + cd cmd/altmount && goversioninfo -platform-specific versioninfo.json + .PHONY: build build: build-cli \ No newline at end of file diff --git a/README.md b/README.md index 1bbea52f..0cfed165 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,33 @@ go install github.com/javi11/altmount@latest altmount serve --config config.yaml ``` +## Windows: Enable Long Path Support + +The Windows AltMount binaries are built with a long-path-aware manifest, which +opts the process in to paths longer than the legacy `MAX_PATH` (260 character) +limit. However, Windows also requires the matching system-wide setting to be +enabled before long paths actually work — without it, you may see errors like +`The filename or extension is too long` when accessing deeply nested releases. + +Enable it once per machine in an **elevated PowerShell** prompt (Run as +administrator), then restart AltMount: + +```powershell +New-ItemProperty ` + -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` + -Name "LongPathsEnabled" ` + -Value 1 ` + -PropertyType DWORD ` + -Force +``` + +Equivalent via Group Policy: `Computer Configuration → Administrative Templates +→ System → Filesystem → Enable Win32 long paths`. + +This setting requires Windows 10 version 1607 (build 14393) or newer. A reboot +is not strictly required, but any already-running process — including AltMount +and your file manager — needs to be restarted to pick up the change. + ## Links - 📚 [Documentation](https://altmount.kipsilabs.top) diff --git a/cmd/altmount/altmount.exe.manifest b/cmd/altmount/altmount.exe.manifest new file mode 100644 index 00000000..00e83817 --- /dev/null +++ b/cmd/altmount/altmount.exe.manifest @@ -0,0 +1,20 @@ + + + + + + true + UTF-8 + + + + + + + + + diff --git a/cmd/altmount/resource_windows_386.syso b/cmd/altmount/resource_windows_386.syso new file mode 100644 index 0000000000000000000000000000000000000000..6fcd4599d03306a0b57362302a4b26a86635be20 GIT binary patch literal 1718 zcmb7F%Wl&^6uoI9P%9y^WI0%@5RUCOg``SSLQADcEsaQ9mS|#65=-$zo=Mw?BJ~4U z@Cp3{mTdSF{((P0obe-%rbuv|dHCLQU&mwTs8k{?w-1Q2UAa_AWa6gUZ0f?+!1fDP zEo&IB)1SU8WQ`tU%ZP5CVC`bXvLK~2e(fIpMtMaEzYITGF_lQ;zXEZKajlEVg{>34 zz$oN;t%~hA_2?t!xAY#n4xP|D+;=b^Vz1>#`Pc8F`&5xnd-+v+3%qv@y#ar`Rc&&={f3D>Z1{0X>3G z(cb}(5_RalW90DDith7e=N;?4X;TSC7p+68(oi8S9Z8A2C)$v5Ad^Lqm zi<-trcq;=td65es0!_@e7llfg+5LqS4bHp?Zh4VO1Ns0!2P*lWohGh z?7Li{^MCAO+t7}v7)5!}rR)i%K$Oh1(1W94m#b0xk|&}FI#Md$wXB?-%8Z=~*s*%Y z9c#;WURocPLmDlWOhm(4ia5)|UFBbh{m2ttKK!pl_0>e_Q*KzxG4n>PdpZSl&YZ?I z&`1m(`~DbDuW0-4Ct?Y%&qki?PS}*`r>4nrYM5g)i#ZN6%^4AL630=Zgm=Ip`*pr!R%-)q$L7usuk+8@0YKp^omfk?;hbB=L2qs9_vJ=U Ukca8lJ=-n*7vXbC>*>4q2PeFAS^xk5 literal 0 HcmV?d00001 diff --git a/cmd/altmount/resource_windows_amd64.syso b/cmd/altmount/resource_windows_amd64.syso new file mode 100644 index 0000000000000000000000000000000000000000..30a53578236590d2e1edd079e75f0d675ba512f2 GIT binary patch literal 1718 zcmb7F%Wl&^6uoI9q*g*=$#Sq*AspLn3Q3iugqBK?D2+&4mS|#65=-$zo=Mw?B6Y=z z1)tDQV9AC*;UD+|#2G*GXj%!bGY{W;?(2B$cwb7S<>moVwkww^iA>y7n@wHV8rXit zs$~u1Rr=F+g{;vdY#Gt@W2{}QSQey|#;@I>-zcvr;g{h@E2a`@{5K$OFs^hlxv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_tOwiFQ^KrBAtGEyv6oweIK?&^dD& z*FYmNc$2wlq z_*576;3ao9&HkXjW!46wZuWQhwpptWyltC1+kA(A&JF+yU+KhJstxDdDh_&UL%%QA VdV-YGuY0yz{4c`il-AOB?=MUjbjSbz literal 0 HcmV?d00001 diff --git a/cmd/altmount/resource_windows_arm64.syso b/cmd/altmount/resource_windows_arm64.syso new file mode 100644 index 0000000000000000000000000000000000000000..4e7971510d2e25faa592b47c91c6a3ea919ac3c6 GIT binary patch literal 1718 zcmb7F%Wl&^6un6!q*g*=$#Sq*AspLn3Tc(3gqBK?D2+&4mS|#65=-$zo=Mw?BJ~4U z@CjYBV#$U-;UD+|#2G*GXj%!bGY{W;?(2B$c;8B-<>moVwyTt?iA>y7n@wHV8rXip zs-=waD*frZLdx_ATSj#K7;6_RmIW!L@#}Z!*DEVZ_+|Lfim5~z{}qTEj4NGCE^LkH zIYuE@-_U#PI&@6$aNogvh`pAdmEV7g?o&lR?d5BQDmgcE>o1U1LOewY z`4rL+(R><{K;)1H6ao4p#n@CMn|3g2^cpj2CI`Ozzy!Di@QNh#ZTKrXf_{?f7@6Sn z6gG_!urYFB)%eVd!M{LfRWRbPdq7H{65u#6nN3$;qxD(tIK@uEgvJPMUa3Lr4(K6# zivA9Ol&C}Z9V3UIR&||ig>JM@miIW#G)#NYsG<%X zA*=efZxtCX^M10tUBrmM$^><*g{=4WtDo%|;wQ6g^QTJm6z75H1Xj(pL`{5&hxN*L z4WP!}WiV#vB9VR+HVvn08%%_5TEGtYlE>_td1u_<*O-l zTGTW~!V5p#+B9-i$OEX_V|5fwLRDyI<=fTtD)ey@xkAb)X(#T;SHe}31n$oaD@z;4 zW8dWpo&RGOTZVQ-#VE>)E@V$A1)^l8g&rIYyIhUh7d#O~(2-K{u4U!yRA=l|!H(5C z>R6k$^TPVD9MWj1WFi{YQp8yv?kfLW>_?vH^5K6a+F4DMKIMkB95Zj!x}#G-=getb z1C7MsvG0%Z^oq9cKM_lCeKzuBx5B1OKQT>~Q^OpaSmY0ij{lQ@nNCA{Mv>v&D$ zQ(f4Dm)zMj`-A?LSsRGD+27&YX01N(wr%cg^Bw*