❔ Is there a way I can make a terminal downloader?
I just want to make a program that downloads a file, extracts it, downloads another file, extracts that in the same directory, maybe with a download progress tracker
60 Replies
HttpClient.
7Zip.
Yes, thats doable. Making the progressbar and download speed etc is a bit more complicated, but still doable.
a program that downloads and extracts a thing is quite easy
awesome, I tried installing spectre.console but it threw errors that made my head hurt, is there an interface that I can get into and just hit the ground running? I don't wanna spend too long on this but I want it to work
interface?
just, anything that's easy to develop in
have you uh... used C# before?
yeah
okay so use whatever "interface" you like for making C# programs :d
thats the problem, is I used visual studio
why is that a problem?
VS is excellent
That’s good.
Spectre is quite easy.
but a fresh visual studio is throwing me about a gazillion errors that I have zero clue how to fix, there's a whole bunch of setup that I can't get past
do you mean visual studio code?
nah
visual studio
hm
Very rare for VS to be throwing errors randomly
if you open a terminal and do
dotnet --info
, what does it say?I don't know where the console is, but it does this when nuget thing
your project seems to be.. weird
I've tried it on multiple projects
I've never seen
native,Version=v0.0
as a target beforeneither
okay, so lets fix your environment
that's what's making my head hurt
okie dokie
Pobiega
if you open a terminal and do
dotnet --info
, what does it say?Quoted by
<@105026391237480448> from #Is there a way I can make a terminal downloader? (click here)
React with ❌ to remove this embed.
give me a few minutes, I never could find the terminal amidst all these buttons
windows key, write "cmd"
oh just windows terminal
yep
thats fine
first we gotta check that your dotnet installation seems to work
after that, we can try and fix VS
Host:
Version: 7.0.9
Architecture: x64
Commit: 8e9a17b221
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
dotnet command - .NET CLI
Learn about the dotnet command (the generic driver for the .NET CLI) and its usage.
Microsoft
.NET Downloads (Linux, macOS, and Windows)
Official .NET downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.
NET SDKs installed: No SDKs were found.you do not have an SDK, and can thus not create or build projects easily fixed by installing an SDK. However, lets verify that you dont have an x86 runtime installed first go to
C:\Program Files(x86)\
is there a dotnet
folder there?nope
great
then we install the .net 7 sdk
it's in regular
good
that means you only have an x64 runtime
this is good news
no conflicts
https://dotnet.microsoft.com/en-us/download/dotnet/7.0
go here, grab the latest x64 sdk you want. Probaly 7.0.401
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.401-windows-x64-installer <--
aight I'll install the SDK and keep you posted, it's been years since I had to install dotnet so I completely forgot runtime and sdk were seperate
ugggggggggh it's still targeting 0.0 and there is a trillion different buttons and google insists on showing me 20 step methods that look completely different to what I'm working with
relax. did you install the SDK?
yep
dotnet --info
please.NET SDKs installed:
7.0.401 [C:\Program Files\dotnet\sdk]
excellent
okay, lets make a simple hello world app to test that everything works
in your terminal window, navigate to some proper place for code. Like..
C:\code
then do dotnet new console -n HelloWorld
cd HelloWorld
dotnet run
seems good
did you get any response to
dotnet run
?yep, the "Hello, World!" as planned, I see there's project files here now, I take it these will not be targetting 0.0
excellent
yeah if you open up the .csproj file in your favorite editor, you can see what it does
lets try adding spectre console to it!
alright, before I do that, it wants me to install more stuff, 17.4.0 of MSBuild, I guess I'll just google that real quick and get that installed too
huh?
whats asking you to do that?
visual studio
what version of VS?
2019
uninstall
you need 2022
ok
so just wipe it all out and install VS 2022 community from scratch. Part of the installer will be asking you what "workloads" you want, the only thing you must pick there is ".NET Desktop development"
Pobiega you're such a hero
Thanks 🙂
okay I have reinstalled everything to be latest, installed dotnet sdk, started the project, and installed spectre.console, no errors, I think I can finally get started
yup yup!
do you know what file formats the stuff you want to extract is?
if its .zip, you dont need any packages for that, its built in
but if its .rar, .7z or so, you'll likely want to use 7zip
awesome, I think I'll be using .zip for all my packages
👍
and just for the record, you're not going to use this to download and unzip anything malicious right?
nope
good 🙂
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.