❔ should i use C# for a standalone exe or should i use C++ or something else
idk what to use, i have quite a lot of java experience thats why i thought i would use C# but i need a standalone executalbe and afaik thats only possible with like a really old C# version, or am i wrong there?
30 Replies
u r wrong ;p
ofc it is up to the actual use case what to use, but generally speaking there is single file deployment https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli
Create a single file for application deployment - .NET
Learn what single file application is and why you should consider using this application deployment model.
oh even for the newest version?
nice
and if you need like a library? or does the sdk already have pretty much everything you need?
(basically deploying the runtime urself, just like u were able to choose in java to either just provide a jar and having the user install the jvm, or bring it urself)
these will be embedded as well
wdym with the latter
you mean embedding the runtime within the app?
wouldnt that create like huge apps
well, i guess u know about eclipse/intellj, these bring their own jvm runtimes, instead of requiring u to install one (well u still need a jdk to compile ur stuff, but thats more regarding their functionality than how the application works on its own)
well fair
it does, but there is a trimming option, that means, stuff that isnt used will be thrown out to reduce the size
its a pretty small app so it should definetly not be like 1 GB
altho i doubt it would get that big
yeah, with trimming iirc a hello world console app is like 2-4mb
oh fair
and there wont be much of a change if u dont add a lot dependencies
thats not bad at all
ye well i do want a window to pop up but
and a video to play
and some user interaction too
so it might get a bit more complicated then but ye
well, then it will grow quite a bit as u have a lot more dependencies, but thats also just a couple of mega bytes at max
ok itll be under 100 MB?
cuz ill take that
the size heavy part is basically ur embedded resources, like icons for the toolbar, etc
ye and the videos
i guess you could download them at runtime but thats kind of sketchy too
well videos are big, if u embed them ur binary will grow a lot ofc. but usually u dont embed these but bring them along as external resources via installs
a game for example isnt just one big exe either ;p
ye but i cant have that, i just need a run once and done, no user input required
and as little things that can be blocked by some stupid anti virus as possible, im not creating a virus but yk how those things are, installers usually require admin and stuff
so if an app downloads things and stuff that jjust sounds like more stuff that can go wrong
well, to be on the safe side u embed the resources then
ye
video quality doesnt have to be great anywyas
and the longest one is like 4 minutes
so maybe it wont be that bad
well then its mainly about how good u can reduce the sizes of the videos, not the code u write itself
XD fair enough
Would base64 encoding help
Tbh there is probably a more efficient compression algorithm out there
base64 will make it bigger for sure, u can embed the videos as raw binary data, the tools u use to create/edit the videos will know better how to compress the sizes using codecs
these tools and which library u use for playing the video are the deciding factors here
I had to convert a forms app to exe, and give or take the exe size was ~150mb with .net environment included
that sounds like u didnt enable trimming
I don't think desktop apps can be trimmed
u can even trim avalonia apps, so yes it also applies to desktop apps
by desktop apps I meant WPF / WinForms
and if you try trimming a WPF app:
Ye, i wasn't sure what would be removed and how it'd effect the app
And also it's not possible like @chiyoko_s said
It's possible but not supported/suggested*
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.