Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
d2ca35b965
@ -92,9 +92,19 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
|
||||
|
||||
####Getting NadekoBot
|
||||
|
||||
![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif)
|
||||
Use the following command to get and run `linuxAIO.sh`:
|
||||
(Remember **DO NOT** rename the file `linuxAIO.sh`)
|
||||
|
||||
`cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh`
|
||||
`cd ~ && wget https://github.com/Kwoth/NadekoBot-BashScript/raw/master/linuxAIO.sh && bash linuxAIO.sh`
|
||||
|
||||
Follow the on screen instructions:
|
||||
|
||||
1. To Get the latest build. (most recent updates)
|
||||
2. To Get the stable build.
|
||||
|
||||
Choose either `1` or `2` then press `enter` key.
|
||||
Once Installation is completed you should see the options again.
|
||||
Next, choose `5` to exit.
|
||||
|
||||
####Creating and Inviting bot
|
||||
|
||||
@ -141,8 +151,8 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
|
||||
- Copy the `credentials.json` to desktop
|
||||
- EDIT it as it is guided here: [Setting up credentials.json](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-credentialsjson-file)
|
||||
- Paste/put it back in the folder once done. `(Using CyberDuck/WinSCP)`
|
||||
- If you already have Nadeko 1.0 setup and have `credentials.json` and `NadekoBot.db`, you can just copy and paste the `credentials.json` to `NadekoBot/src/NadekoBot` and `NadekoBot.db` to `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data` using CyberDuck.
|
||||
- If you have Nadeko 0.9x follow the [Upgrading Guide](http://nadekobot.readthedocs.io/en/1.0/guides/Upgrading%20Guide/)
|
||||
- **If** you already have Nadeko 1.0 setup and have `credentials.json` and `NadekoBot.db`, you can just copy and paste the `credentials.json` to `NadekoBot/src/NadekoBot` and `NadekoBot.db` to `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data` using CyberDuck.
|
||||
- **If** you have Nadeko 0.9x follow the [Upgrading Guide](http://nadekobot.readthedocs.io/en/1.0/guides/Upgrading%20Guide/)
|
||||
|
||||
####Setting up Music
|
||||
|
||||
@ -152,32 +162,33 @@ Once done, go back to **PuTTY**
|
||||
|
||||
####Running NadekoBot
|
||||
|
||||
![img8](https://cdn.discordapp.com/attachments/251504306010849280/251506149973557259/running_nadeko.gif)
|
||||
|
||||
**Create a new Session:**
|
||||
|
||||
- `tmux new -s nadeko`
|
||||
|
||||
That command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep running the PuTTY.
|
||||
The above command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep the PuTTY running.
|
||||
|
||||
- `cd NadekoBot/src/NadekoBot/`
|
||||
**Next, we need to run `linuxAIO.sh` in order to get the latest running scripts with patches:**
|
||||
|
||||
**Without Auto Restart:**
|
||||
- `cd ~ && bash linuxAIO.sh`
|
||||
|
||||
- `dotnet run --configuration Release`
|
||||
From the options,
|
||||
|
||||
**With Auto Restart:**
|
||||
Choose `3` To Run the bot normally.
|
||||
**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline until you manually run it again. (best if you want to check the bot.)
|
||||
|
||||
- `while :; do dotnet run -c Release; sleep 5s; done`
|
||||
Choose `4` To Run the bot with Auto Restart.
|
||||
**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to function as restart.
|
||||
|
||||
**NOTE:** With Auto Restart, bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) so you do not have to manual restart if you ever want to.
|
||||
See how that happens below:
|
||||
See how that happens:
|
||||
|
||||
![img9](https://cdn.discordapp.com/attachments/251504306010849280/251506312893038592/die_explaination.gif)
|
||||
|
||||
**Remember** that, while running with Auto Restart, you will need to [close the tmux session](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#restarting-nadeko) to stop the bot completely.
|
||||
|
||||
**Now check your Discord, the bot should be online**
|
||||
|
||||
Now time to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now.
|
||||
Next to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now.
|
||||
|
||||
####Some more Info (just in case)
|
||||
|
||||
@ -205,25 +216,36 @@ Open **PuTTY** and login as you have before, type `reboot` and hit Enter.
|
||||
|
||||
- Kill your previous session, check with `tmux ls`
|
||||
- `tmux kill-session -t nadeko` (don't forget to replace "nadeko" to what ever you named your bot's session)
|
||||
- Follow: [Running NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot)
|
||||
- [Run the bot again.](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot)
|
||||
|
||||
####Updating Nadeko
|
||||
|
||||
- Connect to the terminal
|
||||
- Connect to the terminal through PuTTY.
|
||||
- `tmux kill-session -t nadeko` (don't forget to replace **nadeko** in the command with the name of your bot's session)
|
||||
- Make sure the bot is **not** running.
|
||||
- `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` (The same command used to install earlier)
|
||||
- Run the bot again as normal.
|
||||
- `tmux new -s nadeko` (**nadeko** is the name of the session)
|
||||
- `cd ~ && bash linuxAIO.sh`
|
||||
- Choose either `1` or `2` to update the bot with **latest build** or **stable build** respectively.
|
||||
- Choose either `3` or `4` to run the bot again with **normally** or **auto restart** respectively.
|
||||
- Done. You can close PuTTY now.
|
||||
|
||||
####Alternative way to Install
|
||||
|
||||
- If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows errors, try manually installing with the following steps:
|
||||
If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows any kind error, check if you have the `linuxAIO.sh` file and make sure its not renamed or if you want to manually install the bot. Use the following command(s):
|
||||
|
||||
|
||||
![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif)
|
||||
|
||||
`cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh`
|
||||
|
||||
**OR**
|
||||
|
||||
```
|
||||
cd ~ && git clone -b 1.0 --recursive --depth 1 https://github.com/Kwoth/NadekoBot.git
|
||||
cd ~/NadekoBot/discord.net/src/Discord.Net && dotnet restore && cd ../Discord.Net.Commands && dotnet restore && cd ../../../src/NadekoBot/ && dotnet restore && dotnet build --configuration Release
|
||||
```
|
||||
|
||||
- If you are still getting errors using the above steps:
|
||||
If you are getting error using the above steps try:
|
||||
|
||||
```
|
||||
cd ~/NadekoBot/discord.net && dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json && dotnet restore
|
||||
|
@ -1,4 +1,5 @@
|
||||
### Setting Up NadekoBot on OSX
|
||||
## Setting Up NadekoBot on OSX
|
||||
|
||||
#### Prerequisites
|
||||
- [Homebrew][Homebrew]
|
||||
- Google Account
|
||||
@ -54,10 +55,19 @@ A dialog box will open asking if you want to install `xcode-select`. Select inst
|
||||
|
||||
####Downloading and building Nadeko
|
||||
|
||||
**METHOD I**
|
||||
Use the following command to get and run `linuxAIO.sh`:
|
||||
(Remember **DO NOT** rename the file `linuxAIO.sh`)
|
||||
|
||||
- `cd ~`
|
||||
- `curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh`
|
||||
`cd ~ && wget https://github.com/Kwoth/NadekoBot-BashScript/raw/master/linuxAIO.sh && bash linuxAIO.sh`
|
||||
|
||||
Follow the on screen instructions:
|
||||
|
||||
1. To Get the latest build. (most recent updates)
|
||||
2. To Get the stable build.
|
||||
|
||||
Choose either `1` or `2` then press `enter` key.
|
||||
Once Installation is completed you should see the options again.
|
||||
Next, choose `5` to exit.
|
||||
|
||||
####Creating DiscordBot application
|
||||
- Go to [the Discord developer application page.][DiscordApp]
|
||||
@ -101,15 +111,21 @@ A dialog box will open asking if you want to install `xcode-select`. Select inst
|
||||
|
||||
- Start Nadeko using .NET Core:
|
||||
|
||||
`cd ~/NadekoBot/src/NadekoBot/`
|
||||
`cd ~ && bash linuxAIO.sh`
|
||||
|
||||
`dotnet run --configuration Release`
|
||||
From the options,
|
||||
|
||||
CHECK THE BOT IN DISCORD, IF EVERYTHING IS WORKING
|
||||
Choose `3` To Run the bot normally.
|
||||
**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline untill you manually run it again. (best if you want to check the bot.)
|
||||
|
||||
Choose `4` To Run the bot with Auto Restart.
|
||||
**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to be used as restart.
|
||||
**NOTE:** [To stop the bot you will have to kill the session.](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#some-more-info)
|
||||
|
||||
**Now check your Discord, the bot should be online**
|
||||
|
||||
Now time to move bot to background and to do that, press CTRL+B+D (this will detach the nadeko session using TMUX)
|
||||
|
||||
*If you used Screen press CTRL+A+D (this will detach the nadeko screen)*
|
||||
If you used Screen press CTRL+A+D (this will detach the nadeko screen)
|
||||
|
||||
####Inviting your bot to your server
|
||||
- [Invite Guide](http://discord.kongslien.net/guide.html)
|
||||
@ -125,24 +141,14 @@ For Music Setup and API keys check [Setting up NadekoBot for Music](http://nadek
|
||||
|
||||
####Updating Nadeko
|
||||
|
||||
Nadeko is really easy to update as of version 1.0! just copy and paste the command below to update Nadeko to the latest version
|
||||
|
||||
`cd ~/NadekoBot/ && git init && git pull`
|
||||
|
||||
####Alternative Method to Install Nadeko
|
||||
|
||||
*If you fail to install the bot using [METHOD I](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#downloading-and-building-nadeko) try:*
|
||||
|
||||
**METHOD II**
|
||||
|
||||
- `cd ~`
|
||||
- `git clone -b 1.0 --recursive https://github.com/Kwoth/NadekoBot.git`
|
||||
- `cd ~/NadekoBot/discord.net`
|
||||
- `dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json`
|
||||
- `dotnet restore`
|
||||
- `cd ~/NadekoBot/src/NadekoBot/`
|
||||
- `dotnet restore`
|
||||
- `dotnet build --configuration Release`
|
||||
- Connect to the terminal.
|
||||
- `tmux kill-session -t nadeko` [(don't forget to replace **nadeko** in the command to what ever you named your bot's session)](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#some-more-info)
|
||||
- Make sure the bot is **not** running.
|
||||
- `tmux new -s nadeko` (**nadeko** is the name of the session)
|
||||
- `cd ~ && bash linuxAIO.sh`
|
||||
- Choose either `1` or `2` to update the bot with **latest build** or **stable build** respectively.
|
||||
- Choose either `3` or `4` to run the bot again with **normally** or **auto restart** respectively.
|
||||
- Done. You can close terminal now.
|
||||
|
||||
####Some more Info
|
||||
|
||||
@ -158,6 +164,23 @@ Nadeko is really easy to update as of version 1.0! just copy and paste the comma
|
||||
- If you want to switch to/ see that screen, type `screen -r nadeko` (nadeko is the name of the screen we created before so, replace `nadeko` with the screen name you created.)
|
||||
- If you want to kill the NadekoBot screen, type `screen -X -S nadeko quit`
|
||||
|
||||
####Alternative Method to Install Nadeko
|
||||
|
||||
**METHOD I**
|
||||
|
||||
- `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh`
|
||||
|
||||
**METHOD II**
|
||||
|
||||
- `cd ~`
|
||||
- `git clone -b 1.0 --recursive https://github.com/Kwoth/NadekoBot.git`
|
||||
- `cd ~/NadekoBot/discord.net`
|
||||
- `dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json`
|
||||
- `dotnet restore`
|
||||
- `cd ~/NadekoBot/src/NadekoBot/`
|
||||
- `dotnet restore`
|
||||
- `dotnet build --configuration Release`
|
||||
|
||||
[Homebrew]: http://brew.sh/
|
||||
[DiscordApp]: https://discordapp.com/developers/applications/me
|
||||
[Atom]: https://atom.io/
|
||||
|
@ -2,7 +2,8 @@ ________________________________________________________________________________
|
||||
*Thanks to @Flatbread and Mirai for making this guide*
|
||||
________________________________________________________________________________
|
||||
|
||||
### Setting Up NadekoBot on Windows
|
||||
## Setting Up NadekoBot on Windows
|
||||
|
||||
#### Prerequisites
|
||||
- 1) [.NET Core SDK][.NET Core SDK]
|
||||
- 2) [Git][Git]
|
||||
@ -11,18 +12,19 @@ ________________________________________________________________________________
|
||||
- 5) Soundcloud Account (if you want soundcloud support)
|
||||
- 6) [7zip][7zip] (or whatever you are using, WinRar)
|
||||
- 7) [Notepad++][Notepad++]
|
||||
- 8) Windows 8 or newer
|
||||
- 8) Windows 8 or later
|
||||
|
||||
####Guide
|
||||
- Make sure you have installed both [Git][Git] and the [.NET Core SDK][.NET Core SDK].
|
||||
- Create a folder somewhere and name it `Nadeko`.
|
||||
- Head to the [Windows Installer releases page][WinInstaller] and save the zip as prompted.
|
||||
- Extract the contents of the zip you just downloaded to the `Nadeko` folder that we created earlier.
|
||||
- You should see another folder in the `Nadeko` folder, something along the lines of `NadekoBotInstallerWin-master` copy the contents of this folder, to the `Nadeko` folder, then (optionally) remove the empty, `NadekoBotInstallerWin-master` folder
|
||||
- You should now see three files, most importantly, `NadekoInstaller.bat` after moving the contents of the folder mentioned above to the `Nadeko` folder (You may not see the `.bat` part of the filename).
|
||||
- Run/Launch/Open `NadekoInstaller.bat` and you will see it running in the command prompt.
|
||||
- Create a **new folder** anywhere you like and name it `Nadeko`.
|
||||
- Next, [Right-Click on this link](https://github.com/Kwoth/NadekoBotInstallerWin/raw/master/NadekoWinAIO.bat) and select **Save link as** and save the file `NadekoWinAIO.bat` inside the `Nadeko` folder that we created earlier. (**DO NOT** rename the file `NadekoWinAIO.bat`)
|
||||
- Once that's done, double-click on `NadekoWinAIO.bat` to run it.
|
||||
- From the options,
|
||||
- Choose `1` to get the **most recent build**.
|
||||
- Choose `2` to get the **stable build**.
|
||||
- Wait a while for the file to finish installing, it'll display it's progress in the command prompt.
|
||||
- You should now have a new folder named `NadekoBot` inside the `Nadeko` folder we previously created.
|
||||
- Once Installation is completed, press any key to close the command prompt.
|
||||
|
||||
####Creating DiscordBot application
|
||||
- Go to [the Discord developer application page][DiscordApp].
|
||||
@ -57,14 +59,24 @@ ________________________________________________________________________________
|
||||
- The bot should have been added to your server.
|
||||
|
||||
####Starting the bot
|
||||
- Go to the folder which you extracted the zip to earlier, and run the `NadekoRun.bat` file
|
||||
- Your bot should now be online in the server we added her to.
|
||||
- Note: Your bot will be offline in case you close the `NadekoBot` command prompt window.
|
||||
- Go to the `Nadeko` folder that we have created earlier, and run the `NadekoWinAIO.bat` file.
|
||||
- From the options,
|
||||
- Choose `3` to **run the bot normally**.
|
||||
(with normal-run the bot will shutdown and will stay offline if it disconnects by the use of `.die` command until you manually run it again. Useful if you want to test the bot.)
|
||||
- Choose `4` to **run the bot with auto restart**.
|
||||
(with auto restart the bot will restart itself if it disconnects by the use of `.die` command. Useful if you want to have restart function for any reason.)
|
||||
|
||||
####Updating NadekoBot
|
||||
- Make sure the bot is closed and is not running (Run `.die` in a connected server to ensure it's not running).
|
||||
- Run `NadekoInstaller.bat` again and wait for it to finish.
|
||||
- Run `NadekoRun.bat`.
|
||||
- Once that's checked, go to the `Nadeko` folder.
|
||||
- Run the `NadekoWinAIO.bat` file.
|
||||
- From the options,
|
||||
- Choose `1` to get the **most recent build**.
|
||||
- Choose `2` to get the **stable build**.
|
||||
- Follow the messages and press any key to continue.
|
||||
- Wait for it to finish.
|
||||
- Press any key to close the window when it shows **Installation complete.**
|
||||
- [Start the bot again.](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#starting-the-bot)
|
||||
- You've updated and are running again, easy as that!
|
||||
________________________________________________________________________________
|
||||
|
||||
@ -99,7 +111,7 @@ ________________________________________________________________________________
|
||||
- Setup your API keys as explained above.
|
||||
- Restart your computer.
|
||||
|
||||
[.NET Core SDK]: https://go.microsoft.com/fwlink/?LinkID=827524
|
||||
[.NET Core SDK]: https://www.microsoft.com/net/core#windowscmd
|
||||
[Git]: https://git-scm.com/download/win
|
||||
[WinInstaller]: https://github.com/Kwoth/NadekoBotInstallerWin/archive/master.zip
|
||||
[FFMPEG]: https://github.com/Soundofdarkness/FFMPEG-Inst/releases
|
||||
|
6
scripts/NadekoAutoRun.bat
Normal file
6
scripts/NadekoAutoRun.bat
Normal file
@ -0,0 +1,6 @@
|
||||
@ECHO off
|
||||
@TITLE NadekoBot
|
||||
:auto
|
||||
CD /D %~dp0NadekoBot\src\NadekoBot
|
||||
dotnet run --configuration Release
|
||||
goto auto
|
110
scripts/NadekoInstaller.bat
Normal file
110
scripts/NadekoInstaller.bat
Normal file
@ -0,0 +1,110 @@
|
||||
@ECHO off
|
||||
TITLE Downloading NadekoBot, please wait
|
||||
::Setting convenient to read variables which don't delete the windows temp folder
|
||||
SET root=%~dp0
|
||||
CD /D %root%
|
||||
SET rootdir=%cd%
|
||||
SET build1=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net\
|
||||
SET build2=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net.Commands\
|
||||
SET build3=%root%NadekoInstall_Temp\NadekoBot\src\NadekoBot\
|
||||
SET installtemp=%root%NadekoInstall_Temp\
|
||||
::Deleting traces of last setup for the sake of clean folders, if by some miracle it still exists
|
||||
IF EXIST %installtemp% ( RMDIR %installtemp% /S /Q >nul 2>&1)
|
||||
::Checks that both git and dotnet are installed
|
||||
dotnet --version >nul 2>&1 || GOTO :dotnet
|
||||
git --version >nul 2>&1 || GOTO :git
|
||||
::Creates the install directory to work in and get the current directory because spaces ruins everything otherwise
|
||||
:start
|
||||
MKDIR NadekoInstall_Temp
|
||||
CD /D %installtemp%
|
||||
::Downloads the latest version of Nadeko
|
||||
ECHO Downloading Nadeko...
|
||||
ECHO.
|
||||
git clone -b 1.0 --recursive --depth 1 --progress https://github.com/Kwoth/NadekoBot.git >nul
|
||||
IF %ERRORLEVEL% EQU 128 (GOTO :giterror)
|
||||
TITLE Installing NadekoBot, please wait
|
||||
ECHO.
|
||||
ECHO Installing...
|
||||
::Building Nadeko
|
||||
CD /D %build1%
|
||||
dotnet restore >nul 2>&1
|
||||
CD /D %build2%
|
||||
dotnet restore >nul 2>&1
|
||||
CD /D %build3%
|
||||
dotnet restore >nul 2>&1
|
||||
dotnet build --configuration Release >nul 2>&1
|
||||
::Attempts to backup old files if they currently exist in the same folder as the batch file
|
||||
IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
||||
:freshinstall
|
||||
::Moves the NadekoBot folder to keep things tidy
|
||||
ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
GOTO :end
|
||||
:backupinstall
|
||||
TITLE Backing up old files
|
||||
ECHO.
|
||||
ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss
|
||||
PAUSE >nul 2>&1
|
||||
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
||||
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old files backed up to NadekoBot_Old
|
||||
::Copies the credentials and database from the backed up data to the new folder
|
||||
COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO credentials.json copied to new folder
|
||||
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old bin folder copied to new folder
|
||||
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old data folder copied to new folder
|
||||
::Moves the setup Nadeko folder
|
||||
RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1
|
||||
ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
GOTO :end
|
||||
:dotnet
|
||||
::Terminates the batch script if it can't run dotnet --version
|
||||
TITLE Error!
|
||||
ECHO dotnet not found, make sure it's been installed as per the guides instructions!
|
||||
ECHO Press any key to exit.
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:git
|
||||
::Terminates the batch script if it can't run git --version
|
||||
TITLE Error!
|
||||
ECHO git not found, make sure it's been installed as per the guides instructions!
|
||||
ECHO Press any key to exit.
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:giterror
|
||||
ECHO.
|
||||
ECHO Git clone failed, trying again
|
||||
RMDIR %installtemp% /S /Q >nul 2>&1
|
||||
GOTO :start
|
||||
:copyerror
|
||||
::If at any point a copy error is encountered
|
||||
TITLE Error!
|
||||
ECHO.
|
||||
ECHO An error in copying data has been encountered, returning an exit code of %ERRORLEVEL%
|
||||
ECHO.
|
||||
ECHO Make sure to close any files, such as `NadekoBot.db` before continuing or try running the installer as an Administrator
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:end
|
||||
::Normal execution of end of script
|
||||
TITLE Installation complete!
|
||||
CD /D "%root%"
|
||||
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
||||
ECHO.
|
||||
ECHO Installation complete, press any key to close this window!
|
||||
PAUSE >nul 2>&1
|
||||
del NadekoStable.bat
|
110
scripts/NadekoInstallerLatest.bat
Normal file
110
scripts/NadekoInstallerLatest.bat
Normal file
@ -0,0 +1,110 @@
|
||||
@ECHO off
|
||||
TITLE Downloading NadekoBot, please wait
|
||||
::Setting convenient to read variables which don't delete the windows temp folder
|
||||
SET root=%~dp0
|
||||
CD /D %root%
|
||||
SET rootdir=%cd%
|
||||
SET build1=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net\
|
||||
SET build2=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net.Commands\
|
||||
SET build3=%root%NadekoInstall_Temp\NadekoBot\src\NadekoBot\
|
||||
SET installtemp=%root%NadekoInstall_Temp\
|
||||
::Deleting traces of last setup for the sake of clean folders, if by some miracle it still exists
|
||||
IF EXIST %installtemp% ( RMDIR %installtemp% /S /Q >nul 2>&1)
|
||||
::Checks that both git and dotnet are installed
|
||||
dotnet --version >nul 2>&1 || GOTO :dotnet
|
||||
git --version >nul 2>&1 || GOTO :git
|
||||
::Creates the install directory to work in and get the current directory because spaces ruins everything otherwise
|
||||
:start
|
||||
MKDIR NadekoInstall_Temp
|
||||
CD /D %installtemp%
|
||||
::Downloads the latest version of Nadeko
|
||||
ECHO Downloading Nadeko...
|
||||
ECHO.
|
||||
git clone -b dev --recursive --depth 1 --progress https://github.com/Kwoth/NadekoBot.git >nul
|
||||
IF %ERRORLEVEL% EQU 128 (GOTO :giterror)
|
||||
TITLE Installing NadekoBot, please wait
|
||||
ECHO.
|
||||
ECHO Installing...
|
||||
::Building Nadeko
|
||||
CD /D %build1%
|
||||
dotnet restore >nul 2>&1
|
||||
CD /D %build2%
|
||||
dotnet restore >nul 2>&1
|
||||
CD /D %build3%
|
||||
dotnet restore >nul 2>&1
|
||||
dotnet build --configuration Release >nul 2>&1
|
||||
::Attempts to backup old files if they currently exist in the same folder as the batch file
|
||||
IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
||||
:freshinstall
|
||||
::Moves the NadekoBot folder to keep things tidy
|
||||
ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
GOTO :end
|
||||
:backupinstall
|
||||
TITLE Backing up old files
|
||||
ECHO.
|
||||
ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss
|
||||
PAUSE >nul 2>&1
|
||||
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
||||
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old files backed up to NadekoBot_Old
|
||||
::Copies the credentials and database from the backed up data to the new folder
|
||||
COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO credentials.json copied to new folder
|
||||
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old bin folder copied to new folder
|
||||
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
ECHO.
|
||||
ECHO Old data folder copied to new folder
|
||||
::Moves the setup Nadeko folder
|
||||
RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1
|
||||
ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1
|
||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||
GOTO :end
|
||||
:dotnet
|
||||
::Terminates the batch script if it can't run dotnet --version
|
||||
TITLE Error!
|
||||
ECHO dotnet not found, make sure it's been installed as per the guides instructions!
|
||||
ECHO Press any key to exit.
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:git
|
||||
::Terminates the batch script if it can't run git --version
|
||||
TITLE Error!
|
||||
ECHO git not found, make sure it's been installed as per the guides instructions!
|
||||
ECHO Press any key to exit.
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:giterror
|
||||
ECHO.
|
||||
ECHO Git clone failed, trying again
|
||||
RMDIR %installtemp% /S /Q >nul 2>&1
|
||||
GOTO :start
|
||||
:copyerror
|
||||
::If at any point a copy error is encountered
|
||||
TITLE Error!
|
||||
ECHO.
|
||||
ECHO An error in copying data has been encountered, returning an exit code of %ERRORLEVEL%
|
||||
ECHO.
|
||||
ECHO Make sure to close any files, such as `NadekoBot.db` before continuing or try running the installer as an Administrator
|
||||
PAUSE >nul 2>&1
|
||||
CD /D "%root%"
|
||||
GOTO :EOF
|
||||
:end
|
||||
::Normal execution of end of script
|
||||
TITLE Installation complete!
|
||||
CD /D "%root%"
|
||||
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
||||
ECHO.
|
||||
ECHO Installation complete, press any key to close this window!
|
||||
PAUSE >nul 2>&1
|
||||
del NadekoLatest.bat
|
9
scripts/NadekoRun.bat
Normal file
9
scripts/NadekoRun.bat
Normal file
@ -0,0 +1,9 @@
|
||||
@ECHO off
|
||||
@TITLE NadekoBot
|
||||
CD /D %~dp0NadekoBot\src\NadekoBot
|
||||
dotnet run --configuration Release
|
||||
ECHO NadekoBot has been succesfully stopped, press any key to close this window.
|
||||
TITLE NadekoBot - Stopped
|
||||
CD /D %~dp0
|
||||
PAUSE >nul 2>&1
|
||||
del NadekoRunNormal.bat
|
Loading…
Reference in New Issue
Block a user