C
C#10mo ago
Lemur2591

❔ 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
No description
60 Replies
Azrael
Azrael10mo ago
HttpClient. 7Zip.
Pobiega
Pobiega10mo ago
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
Lemur2591
Lemur259110mo ago
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
Pobiega
Pobiega10mo ago
interface?
Lemur2591
Lemur259110mo ago
just, anything that's easy to develop in
Pobiega
Pobiega10mo ago
have you uh... used C# before?
Lemur2591
Lemur259110mo ago
yeah
Pobiega
Pobiega10mo ago
okay so use whatever "interface" you like for making C# programs :d
Lemur2591
Lemur259110mo ago
thats the problem, is I used visual studio
Pobiega
Pobiega10mo ago
why is that a problem? VS is excellent
Azrael
Azrael10mo ago
That’s good. Spectre is quite easy.
Lemur2591
Lemur259110mo ago
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
Pobiega
Pobiega10mo ago
do you mean visual studio code?
Lemur2591
Lemur259110mo ago
nah visual studio
Pobiega
Pobiega10mo ago
hm Very rare for VS to be throwing errors randomly if you open a terminal and do dotnet --info, what does it say?
Lemur2591
Lemur259110mo ago
I don't know where the console is, but it does this when nuget thing
Severity Code Description Project File Line Suppression State
Error Could not install package 'Spectre.Console 0.47.0'. You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Severity Code Description Project File Line Suppression State
Error Could not install package 'Spectre.Console 0.47.0'. You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Pobiega
Pobiega10mo ago
your project seems to be.. weird
Lemur2591
Lemur259110mo ago
I've tried it on multiple projects
Pobiega
Pobiega10mo ago
I've never seen native,Version=v0.0 as a target before
Lemur2591
Lemur259110mo ago
neither
Pobiega
Pobiega10mo ago
okay, so lets fix your environment
Lemur2591
Lemur259110mo ago
that's what's making my head hurt okie dokie
MODiX
MODiX10mo ago
Pobiega
if you open a terminal and do dotnet --info, what does it say?
React with ❌ to remove this embed.
Lemur2591
Lemur259110mo ago
give me a few minutes, I never could find the terminal amidst all these buttons
Pobiega
Pobiega10mo ago
windows key, write "cmd"
Lemur2591
Lemur259110mo ago
oh just windows terminal
Pobiega
Pobiega10mo ago
yep thats fine first we gotta check that your dotnet installation seems to work after that, we can try and fix VS
Lemur2591
Lemur259110mo ago
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.
Pobiega
Pobiega10mo ago
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?
Lemur2591
Lemur259110mo ago
nope
Pobiega
Pobiega10mo ago
great then we install the .net 7 sdk
Lemur2591
Lemur259110mo ago
it's in regular
Pobiega
Pobiega10mo ago
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 <--
Lemur2591
Lemur259110mo ago
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
Pobiega
Pobiega10mo ago
relax. did you install the SDK?
Lemur2591
Lemur259110mo ago
yep
Pobiega
Pobiega10mo ago
dotnet --info please
Lemur2591
Lemur259110mo ago
.NET SDKs installed: 7.0.401 [C:\Program Files\dotnet\sdk]
Pobiega
Pobiega10mo ago
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
Lemur2591
Lemur259110mo ago
PS C:\code> dotnet new console -n HelloWorld

Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.401

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring C:\code\HelloWorld\HelloWorld.csproj:
Determining projects to restore...
Restored C:\code\HelloWorld\HelloWorld.csproj (in 40 ms).
Restore succeeded.


PS C:\code> cd HelloWorld
PS C:\code\HelloWorld> dotnet run
PS C:\code> dotnet new console -n HelloWorld

Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.401

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring C:\code\HelloWorld\HelloWorld.csproj:
Determining projects to restore...
Restored C:\code\HelloWorld\HelloWorld.csproj (in 40 ms).
Restore succeeded.


PS C:\code> cd HelloWorld
PS C:\code\HelloWorld> dotnet run
Pobiega
Pobiega10mo ago
seems good did you get any response to dotnet run?
Lemur2591
Lemur259110mo ago
yep, the "Hello, World!" as planned, I see there's project files here now, I take it these will not be targetting 0.0
Pobiega
Pobiega10mo ago
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!
Lemur2591
Lemur259110mo ago
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
Pobiega
Pobiega10mo ago
huh? whats asking you to do that?
Lemur2591
Lemur259110mo ago
visual studio
Pobiega
Pobiega10mo ago
what version of VS?
Lemur2591
Lemur259110mo ago
2019
Pobiega
Pobiega10mo ago
uninstall you need 2022
Lemur2591
Lemur259110mo ago
ok
Pobiega
Pobiega10mo ago
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"
Tvde1
Tvde110mo ago
Pobiega you're such a hero
Pobiega
Pobiega10mo ago
Thanks 🙂
Lemur2591
Lemur259110mo ago
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
Pobiega
Pobiega10mo ago
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
Lemur2591
Lemur259110mo ago
awesome, I think I'll be using .zip for all my packages
Pobiega
Pobiega10mo ago
👍 and just for the record, you're not going to use this to download and unzip anything malicious right?
Lemur2591
Lemur259110mo ago
nope
Pobiega
Pobiega10mo ago
good 🙂
Accord
Accord10mo ago
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.