Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single executable #26

Closed
bvarnai opened this issue Mar 6, 2020 · 3 comments
Closed

Single executable #26

bvarnai opened this issue Mar 6, 2020 · 3 comments

Comments

@bvarnai
Copy link

bvarnai commented Mar 6, 2020

Maybe it would be nice to have a single executable with dependencies statically linked. It might be around 50-60mb but I don't think that is an issue for the users. Just as additional distribution. Thanks!

@gerardog
Copy link
Owner

gerardog commented Mar 6, 2020

Hi bvarnai.

This can be done. But first, let me ask you: Did you have to install something to make it work? Do you find it convenient to be a single file? Why?

The current packaging logic is to target .Net 4.6 because "Windows 10 (all editions) includes the .NET Framework 4.6 as an OS component, and it is installed by default"

And, I wasn't really interested in supporting anything older than W10.
Therefore I the package size is small, and should work without installing a any dep.
It's not a single file, but can be deployed with copy/paste in W10, so it could be said it is 'portable'.

@gerardog
Copy link
Owner

gerardog commented Mar 6, 2020

This seems to do the trick...

choco install ilmerge
ilmerge gsudo.exe System.Security.Claims.dll System.Security.Principal.Windows.dll /out:gsudoPortable.exe /target:exe /targetplatform:v4,"C:\Windows\Microsoft.NET\Framework\v4.0.30319"

... before signing the assembly.

Final file size is around the sum of all input files.
I can include this in the next release. I can't think of any drawback, but haven't tested it.

(for example: http://www.hurryupandwait.io/blog/what-you-should-know-about-running-ilmerge-on-net-4-5-assemblies-targeting-net-4-0 )

@bvarnai
Copy link
Author

bvarnai commented Mar 7, 2020

Hi gerardog!

Thanks for the feedback!

Sorry, "no-dep" was misleading, there are no missing external dependencies, everything works fine. What I meant to have a single executable without the dlls etc. IMO it's easier to handle from the user perspective. You proposal using "ilmerge" seems to be a perfect solution.

BTW the tool is awesome! We have a bunch of DevOps related bash scripts under Windows, it was a mess to run things elevated, getting stdout or errorlevel was a pain. Now it's just works.

@bvarnai bvarnai changed the title Single no-dep executable Single executable Mar 7, 2020
gerardog added a commit that referenced this issue Mar 19, 2020
fix: Choco not continue if gsudo is running (fixes #17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants