You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-FeatureThis is a feature request for the Windows Package Manager client.PortableIssue related to portable packageZipped-BinaryDepends on .dlls that aren't available via symlink
With current zip support, the only types of installer allowed are:
Portable standalone exe files
Compressed installers
But what about supporting regular compressed binary packages, such as those having exe along with dynamic dll libraries?
Proposed technical implementation details
To use the dynamic dll libraries, they must either be:
in PATH environment variable
linked by specifying Files -> RelativeFilePath within the installer manifest
It is not possible to link dll files to make it work using the 2 approach, because the links are forced to have .exe extension.
This could be fixed either by:
Adding the dlls folder to PATH environment variable
Allowing to link dll files specifying something like NestedInstallerType: library. Then it would also be useful to provide pattern matching RelativeFilePath, such as *.dll
Instead of making a symlink inside WinGet\Links, make an executable bat with the command @call "path\to\exe" %*, then the working directory will be the same where the exe actually is (this would the easiest path in my opinion)
Reacted by Huhni, coehlrich, Kevin Locke, Howard Kapustein, Code., soredake, Markus, elonzh, blafrank, Miles Budnek and 76 more
iirc, the entire Zip folder is extracted and moved to the default install location. Take the Paint.Net Pull Request for example. If you comment out everything except for the zip-portable installer entry, it still installs and runs correctly, meaning that all the DLLs needed to run it are referenced. The DLLs aren’t needed in the installer files because they aren’t installers
iirc, the entire Zip folder is extracted and moved to the default install location. Take the Paint.Net Pull Request for example. If you comment out everything except for the zip-portable installer entry, it still installs and runs correctly, meaning that all the DLLs needed to run it are referenced. The DLLs aren’t needed in the installer files because they aren’t installers
Maybe I wasnt' clear enough. By binary files I mean plain binary, not an exe installer, that's the case for Paint.Net. What I mean is plain binary packages, which is just a bunch of exe files along with dll files, many development tools are deployed this way such as nginx, php, etc. And they won't run unless:
They are launched from the same directory where they were extracted, which a symlink will break
They are added to PATH
They are launched through a .bat file as I proposed: this strategy is used throughout many different packages.
If the community agrees with the bat implementation I would gladly like to contribute. I think it is much better than polluting the PATH or forcing the manifest to declare a whole bunch of DLL files which could also drive other side effects such as DLL versions conflicts.
iirc, the entire Zip folder is extracted and moved to the default install location. Take the Paint.Net Pull Request for example. If you comment out everything except for the zip-portable installer entry, it still installs and runs correctly, meaning that all the DLLs needed to run it are referenced. The DLLs aren’t needed in the installer files because they aren’t installers
They are launched from the same directory where they were extracted, which a symlink will break
They are added to PATH
They are launched through a .bat file as I proposed: this strategy is used throughout many different packages.
If the community agrees with the bat implementation I would gladly like to contribute. I think it is much better than polluting the PATH or forcing the manifest to declare a whole bunch of DLL files which could also drive other side effects such as DLL versions conflicts.
I think you should look at the Paint.Net manifest and zip file more closely. Specifically, this entry -
Kaleb Luedtke (@Trenly), it does work if you install it and launch it through run dialog (Win + R) paint.net.exe, but that's because it looks like it follows the symlink working directory somehow, but if you try to launch it through cmd or powershell it won't work at all!
Although this is fine for Desktop Apps, it is not the expected behavior for development tools and won't work for CLI apps.
But even for Desktop Apps you need to specify paint.net.exe which is not what I would expect to type in the run dialog, I usually just type paint.net, code, etc. I do not type the .exe, I think this is another issue with the SymLinking strategy.
Reacted by Martin Hinshelwood nkdAgility.com, sidy3d, Ralph Lewis, Mr Beedell, Roke Julian Lockhart and Jake O'Shannessy
Kaleb Luedtke (@Trenly), it does work if you install it and launch it through run dialog (Win + R) paint.net.exe, but that's because somehow it looks like it follows the symlink working directory somehow, but if you try to launch it through cmd or powershell it won't work at all!
Although this is fine for Desktop Apps, it is not the expected behavior for development tools and won't work for CLI apps.
But even for Desktop Apps you need to specify paint.net.exe which is not what I would expect to type in the run dialog, I usually just type paint.net, code, etc. I do not type the .exe, I think this is another issue with the SymLinking strategy.
It works fine for me from powershell when I use start paint.net
That's my point, start shouldn't be needed at all, you won't be running development tools using start by default, besides you probably won't be launching these development tools yourself but they will be launched by other development tools which you don't have control over.
The issue title should be better renamed to something like "Handle DLLs for symlinked executables."
This could be fixed either by:
Adding the dlls folder to PATH environment variable
Allowing to link dll files specifying something like NestedInstallerType: library. Then it would also be useful to provide pattern matching RelativeFilePath, such as *.dll
Instead of making a symlink inside WinGet\Links, make an executable bat with the command @call "path\to\exe" %*, then the working directory will be the same where the exe actually is (this would the most easier path in my opinion)
Another solution would be to use shims, like Scoop or Chocolatey:
iirc, the entire Zip folder is extracted and moved to the default install location. Take the Paint.Net Pull Request for example. If you comment out everything except for the zip-portable installer entry, it still installs and runs correctly, meaning that all the DLLs needed to run it are referenced. The DLLs aren’t needed in the installer files because they aren’t installers
Maybe I wasnt' clear enough. By binary files I mean plain binary, not an exe installer, that's the case for Paint.Net. What I mean is plain binary packages, which is just a bunch of exe files along with dll files, many development tools are deployed this way such as nginx, php, etc. And they won't run unless:
They are launched from the same directory where they were extracted, which a symlink will break
They are added to PATH
They are launched through a .bat file as I proposed: this strategy is used throughout many different packages.
If the community agrees with the bat implementation I would gladly like to contribute. I think it is much better than polluting the PATH or forcing the manifest to declare a whole bunch of DLL files which could also drive other side effects such as DLL versions conflicts.
Use bat might cause problem while execute it in another bat script.
It would likely involve uninstalling the package and reinstalling it (if it's installed and not working), but this should unblock a fairly large number of packages in the community repository.
Should be worth mentioning that existing packages affected by this issue like scrcpy needs to have their manifests patched with this new option, and only then reinstalling them with the new winget version should work.
Reacted by Markus, reyqn, 张新伟, Martin Hinshelwood nkdAgility.com, Mr Beedell, Roke Julian Lockhart and welpdx
Reacted by 张新伟 and Martin Hinshelwood nkdAgility.com
Reacted by 张新伟 and Martin Hinshelwood nkdAgility.com
Demitrius Nelon (@denelon) do you have an example of where specifically to add ArchiveBinariesDependOnPath and i'll go patch my packages today?
never mind... I trawled the code and found:
PackageIdentifier: AppInstallerTest.ArchivePortableWithBinariesDependentOnPath
PackageVersion: 1.0.0.0
PackageName: TestArchivePortableWithBinariesDependentOnPath
PackageLocale: en-US
Publisher: AppInstallerTest
License: Test
ShortDescription: E2E test for installing a zip containing a portable with binaries that depend on the PATH variable.
Installers:
- Architecture: x64
InstallerUrl: https://localhost:5001/TestKit/AppInstallerTestZipInstaller/AppInstallerTestZipInstaller.zip
InstallerType: zip
InstallerSha256: <ZIPHASH>
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: AppInstallerTestExeInstaller.exe
PortableCommandAlias: TestPortable
ArchiveBinariesDependOnPath: true
ManifestType: singleton
ManifestVersion: 1.9.0
Where is ManifestVersion 1.9.0 documented?
Reacted by Mr Beedell, Roke Julian Lockhart and Fotis Gimian
Issue-FeatureThis is a feature request for the Windows Package Manager client.PortableIssue related to portable packageZipped-BinaryDepends on .dlls that aren't available via symlink
Activity
Trenly commentedon Nov 21, 2022
iirc, the entire Zip folder is extracted and moved to the default install location. Take the Paint.Net Pull Request for example. If you comment out everything except for the zip-portable installer entry, it still installs and runs correctly, meaning that all the DLLs needed to run it are referenced. The DLLs aren’t needed in the installer files because they aren’t installers
caiohamamura commentedon Nov 21, 2022
Maybe I wasnt' clear enough. By binary files I mean plain binary, not an
exeinstaller, that's the case for Paint.Net. What I mean is plain binary packages, which is just a bunch ofexefiles along withdllfiles, many development tools are deployed this way such asnginx,php, etc. And they won't run unless:PATH.batfile as I proposed: this strategy is used throughout many different packages.If the community agrees with the
batimplementation I would gladly like to contribute. I think it is much better than polluting thePATHor forcing themanifestto declare a whole bunch of DLL files which could also drive other side effects such asDLLversions conflicts.Trenly commentedon Nov 21, 2022
I think you should look at the Paint.Net manifest and zip file more closely. Specifically, this entry -
That specific entry is exactly what you described - a loose .exe file with a bunch of DLLs and other assets included.
If you comment out all the other entries in the manifest, and then use winget to install this specific entry, it will still run perfectly fine
caiohamamura commentedon Nov 21, 2022
Kaleb Luedtke (@Trenly), it does work if you install it and launch it through run dialog (
Win + R)paint.net.exe, but that's because it looks like it follows the symlink working directory somehow, but if you try to launch it throughcmdorpowershellit won't work at all!Although this is fine for Desktop Apps, it is not the expected behavior for development tools and won't work for CLI apps.
But even for Desktop Apps you need to specify
paint.net.exewhich is not what I would expect to type in the run dialog, I usually just typepaint.net,code, etc. I do not type the.exe, I think this is another issue with the SymLinking strategy.Trenly commentedon Nov 21, 2022
It works fine for me from powershell when I use
start paint.netcaiohamamura commentedon Nov 21, 2022
That's my point,
startshouldn't be needed at all, you won't be running development tools usingstartby default, besides you probably won't be launching these development tools yourself but they will be launched by other development tools which you don't have control over.Trenly commentedon Nov 21, 2022
Ahhh, I see. Thank you for your patience and the clarification!
sitiom commentedon Jan 28, 2023
The issue title should be better renamed to something like "Handle DLLs for symlinked executables."
Another solution would be to use shims, like Scoop or Chocolatey:
ddspj23 commentedon Feb 18, 2023
Use bat might cause problem while execute it in another bat script.
[-]Zip binaries installer[/-][+]Handle DLLs for Symlinked exe[/+][-]Handle DLLs for Symlinked exe[/-][+]Handle DLLs for Symlinked executables[/+]6 remaining items
BrandonWanHuanSheng commentedon Aug 19, 2023
It look like another problem with the winget while during install, https://download.wsusoffline.net/wsusoffline120.zip
Kasparsu commentedon Sep 27, 2023
Well the PATH issue can be mitigated by having separate variable for winget package path eg
WINGETso you can add stuff to path like%WINGET%or another option is to hold all winget path variables in WINGET variable and just add that to path. You can extend path by just chaining variables togather.https://stackoverflow.com/questions/34491244/environment-variable-is-too-large-on-windows-10beriberikix commentedon Feb 29, 2024
Any progress on this issue? Seems to be blocked many, many packages.
denelon commentedon Oct 9, 2024
I believe we've resolved this with:
It would likely involve uninstalling the package and reinstalling it (if it's installed and not working), but this should unblock a fairly large number of packages in the community repository.
felipecrs commentedon Oct 9, 2024
Should be worth mentioning that existing packages affected by this issue like scrcpy needs to have their manifests patched with this new option, and only then reinstalling them with the new winget version should work.
MrHinsh commentedon Oct 10, 2024
Demitrius Nelon (@denelon) do you have an example of where specifically to add
ArchiveBinariesDependOnPathand i'll go patch my packages today?never mind... I trawled the code and found:
Where is ManifestVersion 1.9.0 documented?
Update nkdAgility.AzureDevOpsMigrationTools.installer.yaml