GabiBrawl / Bat-Chat

Simple Chat program between various computers.
Other
2 stars 1 forks source link

Updating Script #1

Open AuraProgramming opened 3 years ago

AuraProgramming commented 3 years ago

@echo off echo Would you like to install the update? Y/N choice /c yn /n if %ERRORLEVEL% 1 goto install if %ERRORLEVEL% 2 goto cancel :install powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/GabiBrawl/Bat-Chat/Application/Chat.cmd" - Outfile %temp%\Chat.cmd del /q %USERPROFILE%\Downloads\Chat.cmd move "%temp%\Chat.cmd" "%USERPROFILE%\Downloads" echo Update Successful! :cancel cls cancelling timeout /t 1 > nul exit

AuraProgramming commented 3 years ago

Format was weird, hopefully you can understand that.

AuraProgramming commented 3 years ago

I also don't see where it is supposed to send the file through google drive, would you mind pointing it out for me?

GabiBrawl commented 3 years ago

You have to download the chat program, then install google drive (I used google drive but I think other drives may work too). Copy the chat program to a folder in your drive, the run it. (I will try to use an api to remove the drive dependency)

It is still in development, all this confusion will disappear in the next versions (I hope)

GabiBrawl commented 3 years ago

@echo off echo Would you like to install the update? Y/N choice /c yn /n if %ERRORLEVEL% 1 goto install if %ERRORLEVEL% 2 goto cancel :install powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/GabiBrawl/Bat-Chat/Application/Chat.cmd" - Outfile %temp%\Chat.cmd del /q %USERPROFILE%\Downloads\Chat.cmd move "%temp%\Chat.cmd" "%USERPROFILE%\Downloads" echo Update Successful! :cancel cls cancelling timeout /t 1 > nul exit

But... how will my program detect if there is a new update or not?

AuraProgramming commented 3 years ago

What you can do is make a .version file, and inside it put the version. Then make the updater check if the numbers are the same using something like this @echo off powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/GabiBrawl/Bat-Chat/Application/Version.ver" - Outfile %temp%\Version.ver if "%temp%\Version.ver"=="https://raw.githubusercontent.com/GabiBrawl/Bat-Chat/Application/Version.ver" do ( echo Would you like to install the update? Y/N choice /c yn /n if %ERRORLEVEL% 1 goto install if %ERRORLEVEL% 2 goto cancel :install powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/GabiBrawl/Bat-Chat/Application/Chat.cmd" - Outfile %temp%\Chat.cmd del /q %USERPROFILE%\Downloads\Chat.cmd move "%temp%\Chat.cmd" "%USERPROFILE%\Downloads" echo Update Successful! :cancel cls cancelling timeout /t 1 > nul exit

AuraProgramming commented 3 years ago

Format was again screwed up by GitHub.

connorslade commented 3 years ago

The formatting was probably messed up because you use '`' to start and end your code block. For a multi line code block, try using '```'

This is a
Multi Line
Code Block