-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to the Windows Batches #4213
Changes from all commits
5cfd216
7d23005
ae2945e
124a886
50c66e5
1751fa6
e2244ae
49ed395
331c80f
6d49bc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ CLS | |
|
||
|
||
:init | ||
setlocal DisableDelayedExpansion | ||
setlocal EnableDelayedExpansion | ||
path c:\Program Files\Git\cmd;%PATH% | ||
path C:\Python27;%PATH% | ||
path C:\Python27\Scripts;%PATH% | ||
|
@@ -20,7 +20,6 @@ set GitFName64=Git-2.9.3-64-bit.exe | |
set "batchPath=%~0" | ||
for %%k in (%0) do set batchName=%%~nk | ||
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs" | ||
setlocal EnableDelayedExpansion | ||
|
||
|
||
|
||
|
@@ -63,7 +62,7 @@ CLS | |
@ECHO. | ||
set InstallPath= | ||
set /p InstallPath= "Choose an installation folder or press Enter to close:" ||goto:eof | ||
FOR /F "tokens=1-4 delims=/-. " %%G IN ("%InstallPath%") DO (set InstallPath=%%G\%%H\%%I\%%J) | ||
FOR /F "tokens=1-4 delims=/-. " %%G IN ("%InstallPath%") DO (set InstallPath=%%G\%%H\%%I) | ||
set PGBotPath=%InstallPath%\PokemonGo-Bot | ||
set DownPath=%InstallPath%\Install-Files | ||
if not exist %DownPath% md %DownPath% | ||
|
@@ -190,9 +189,11 @@ CLS | |
@ECHO. | ||
@ECHO. | ||
@ECHO. | ||
if exist %PGBotPath%\configs\config.json copy %PGBotPath%\configs\config.json %DownPath% | ||
if exist %PGBotPath%\web\config\userdata.js copy %PGBotPath%\web\config\userdata.js %DownPath% | ||
if exist %PGBotPath%\encrypt. copy %PGBotPath%\encrypt. %DownPath% | ||
if exist %PGBotPath%\encrypt.so COPY %PGBotPath%\encrypt.so %DownPath% | ||
if exist %PGBotPath%\encrypt.dll COPY %PGBotPath%\encrypt.dll %DownPath% | ||
if exist %PGBotPath%\encrypt_64.dll COPY %PGBotPath%\encrypt_64.dll %DownPath% | ||
if exist %PGBotPath%\configs\config.json COPY %PGBotPath%\configs\config.json %DownPath% | ||
if exist %PGBotPath%\web\config\userdata.js COPY %PGBotPath%\web\config\userdata.js %DownPath% | ||
@ECHO. | ||
@ECHO. | ||
@ECHO. | ||
|
@@ -201,24 +202,26 @@ if exist %PGBotPath%\encrypt. copy %PGBotPath%\encrypt. %DownPath% | |
@ECHO. | ||
@ECHO. | ||
if exist %PGBotPath% rmdir %PGBotPath% /s /q | ||
if not exist %PGBotPath% md %PGBotPath% | ||
cd C:\Python27\ | ||
pip2 install --upgrade pip | ||
pip2 install --upgrade virtualenv | ||
git clone --recursive -b master https://github.com/PokemonGoF/PokemonGo-Bot %PGBotPath% | ||
if "%OS%" == "32-BIT" pip2 install --upgrade %PGBotPath%\windows_bat\PyYAML-3.11-cp27-cp27m-win32.whl | ||
if "%OS%" == "64-BIT" pip2 install --upgrade %PGBotPath%\windows_bat\PyYAML-3.11-cp27-cp27m-win_amd64.whl | ||
cd %PGBotPath% | ||
virtualenv . | ||
call "%PGBotPath%\Scripts\activate.bat" | ||
pip2 install --upgrade -r %PGBotPath%\requirements.txt | ||
pip2 install -r %PGBotPath%\requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove these 2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PyYAML is installed by the command pip2 install -r %PGBotPath%\requirements.txt in line 206. It was redundant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 13, pyyaml==3.11 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Protobuf is there too, in line 5: protobuf==3.0.0b4. It was removed in the last PR too. I just didnt notice the PYYAML there. I saw it last night after reading the install results and seeing the requirement fulfilled messages. |
||
@ECHO. | ||
@ECHO. | ||
@ECHO. | ||
@ECHO --------------------Restoring Backup-------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove this line? If anything, you should remove the line without --upgrade as this line does both (whether fresh install or not) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was being done twice. Now its done only once by pip2 install -r %PGBotPath%\requirements.txt on line 206 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't include the --upgrade tag though, which imho is required, as there will be some users updating, and some users installing from fresh. Needs to account for both. There is no harm in having --upgrade if the pckage doesnt exist already, but if an older version does exist, not having this flag will not update users and will cause issues There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a --upgrade works fine until it reaches the xxhash package, where it freezes just like it happens with setuptools package. This seems to be a loop where pip fails to upgrade the package and keeps trying, for hours if you let it. Thats why I removed it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installation of setuptools and xxhash works fine, just upgrading it wont work. Virtualenv is broken on some systems because it tries to update setuptools at start too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Im gonna keep trying to run it using --upgrade on my machine and some others, as soon it Works again in most of them, I can create another PR and add that function back. Right now, this issue blocks the installation to move forward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going to allow second review to see if it's ready for merge or not |
||
@ECHO. | ||
@ECHO. | ||
@ECHO. | ||
if exist %DownPath%\encrypt. COPY %DownPath%\encrypt. %PGBotPath% | ||
if exist %~dp0\encrypt.so COPY %~dp0\encrypt.so %PGBotPath% | ||
if exist %~dp0\encrypt.dll COPY %~dp0\encrypt.dll %PGBotPath% | ||
if exist %~dp0\encrypt_64.dll COPY %~dp0\encrypt_64.dll %PGBotPath% | ||
if exist %~dp0\config.json COPY %~dp0\config.json %PGBotPath%\configs\ | ||
if exist %~dp0\userdata.js COPY %~dp0\userdata.js %PGBotPath%\web\config\ | ||
if exist %DownPath%\encrypt.so COPY %DownPath%\encrypt.so %PGBotPath% | ||
if exist %DownPath%\encrypt.dll COPY %DownPath%\encrypt.dll %PGBotPath% | ||
if exist %DownPath%\encrypt_64.dll COPY %DownPath%\encrypt_64.dll %PGBotPath% | ||
if exist %DownPath%\config.json COPY %DownPath%\config.json %PGBotPath%\configs\ | ||
if exist %DownPath%\userdata.js COPY %DownPath%\userdata.js %PGBotPath%\web\config\ | ||
@ECHO. | ||
|
@@ -247,15 +250,15 @@ CLS | |
@ECHO. | ||
@ECHO. | ||
@ECHO. | ||
@ECHO "%PGBotPath%/configs/config.json" | ||
@ECHO "%PGBotPath%\configs\config.json" | ||
@ECHO INSTRUCTIONS: | ||
@ECHO "https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/docs/configuration_files.md" | ||
@ECHO. | ||
@ECHO "%PGBotPath%/web/config/userdata.js" | ||
@ECHO "%PGBotPath%\web\config\userdata.js" | ||
@ECHO INSTRUCTIONS: | ||
@ECHO "https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/docs/google_map.md" | ||
@ECHO. | ||
@ECHO To get an Google Map API Key: | ||
@ECHO To get an Google Maps API Key: | ||
@ECHO "https://developers.google.com/maps/documentation/javascript/get-api-key" | ||
@ECHO. | ||
@ECHO. | ||
|
@@ -266,4 +269,4 @@ CLS | |
|
||
:eof | ||
ENDLOCAL | ||
exit | ||
exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be presented as an option to the user whether they want virtualenv or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed because after testing in some Windows machines it would cause issues in some of them. Pip just wouldnt be able to get setuptools from the online repositories, so it stuck on a loop and the bot would never start. Removing virtualenv made the bot work, but makes the user unable to run multiple bots simultaneously. I think this is fine, as these batches are intended to be used by people with very low knowledge of how to configure the bot, and running multiple bots require a bit more understanding of how it Works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with what you're saying, but you shouldn't make the decision for someone, you should let them make a decision and give them the option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I leave virtualenv in the install and start batch, they will just stop in 3 out of 4 Windows machines, show a
Installing pip, setuptools
message and stay there for hours, not showing any error messages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No give the user the option "Do you want to install virtual env [Y / N]" if yes install, if no don't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to find a way to do this, as it would require changes to both install and start batchs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it back to the installation as it installs fine, just starting it causes the freezing. Im not gonna add it to the start batch as the start batch doesnt support multiple bot anyway.