install script fix, bg organization

This commit is contained in:
SpikeHD 2022-04-20 16:27:40 -07:00
parent 339323d52f
commit 73a47526a2
3 changed files with 52 additions and 17 deletions

View File

@ -3,7 +3,14 @@ Grasscutter launcher for easily switching between Official and Private servers
[Download Here!](https://github.com/Grasscutters/GrassClipper/releases/)
# Setup
# Setup (for Users)
1. Download the zip file
2. Extract the zip file somewhere
3. Run `install.cmd` as administrator. This will install the proxy server.
4. Run `GrassClipper.exe` and set your `Genshin Impact` folder!
# Setup (for Development)
0. Clone the repository
1. Ensure you have [NodeJS](https://nodejs.org/en/download/) installed.
@ -17,9 +24,25 @@ Grasscutter launcher for easily switching between Official and Private servers
* Interface
* UI
* Official and Private options
* Server IP input
* ~~Official and Private options~~
* ~~Server IP input~~
* Fun fancy CSS styling n stuff (CoD: MW 2019-style vertical menu for choosing between official and private servers? [See this](https://charlieintel.com/wp-content/uploads/2020/11/MW-new-menu.png))
* Proxy service
* Local proxy server
* Intercept and modify GI requests like with Fiddler, allow anything else to pass through
* ~~Local proxy server~~~~
* ~~Intercept and modify GI requests like with Fiddler, allow anything else to pass through~~
# Having problems?
Below are some scenarios you may encounter and their solutions.
### My Discord is not letting my send messages or load images!
Discord does not seem to be a fan of the proxy server. You may need to disable it by either closing mitmdump or by disabling your proxy in the Windows proxy settings.
### I have no internet after closing everything/restarting my PC!
The launcher most likely did not close correctly, and was unable to clean your proxy settings back to what they were. Disable your proxy in the Windows proxy settings.
### The game will not launch/background launcher images don't load!
Ensure you have selected to correct path to Genshin Impact. This is ***not*** your `Genshin Impact Game` folder, but instead the main `Genshin Impact` folder (where the `bg` folder and `launcher.exe` can be found).

View File

@ -1,25 +1,36 @@
@echo off
:: Ensure we are elevated for certs
>nul 2>&1 certutil -addstore root %USERPROFILE%\.mitmproxy\mitmproxy-ca-cert.cer || (
echo Currently running with non Administrator privileges, run as Administrator to install the certificate.
)
echo Downloading proxy server...
if not exist "./ext" mkdir "ext"
if not exist "./temp" mkdir "temp"
:: Begin by retrieving mitmproxy 8.0.0
powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/8.0.0/mitmproxy-8.0.0-windows.zip -OutFile "./temp/mitmproxy-8.0.0-windows.zip"
:: powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/8.0.0/mitmproxy-8.0.0-windows.zip -OutFile "./temp/mitmproxy-8.0.0-windows.zip"
echo Extracting...
:: Extract from temp/ to ext/ with powershell
powershell Expand-Archive -Path "./temp/mitmproxy-8.0.0-windows.zip" -DestinationPath "./ext/" -Force
:: powershell Expand-Archive -Path "./temp/mitmproxy-8.0.0-windows.zip" -DestinationPath "./ext/" -Force
del /s /q "./temp"
pause
echo Running proxy server in order to generate certificates...
:: Start proxy server
start "Proxy Server" ./ext/mitmdump.exe --ssl-insecure --set ip=%ip%
:: Allow the proxy server to create the certificates
ping 127.0.0.1 -n 6 > nul
:: Kill the process
taskkill /f /im mitmdump.exe
:: Ensure we are elevated for certs
>nul 2>&1 certutil -addstore root %USERPROFILE%\.mitmproxy\mitmproxy-ca-cert.cer || (
echo Certificate install failed, ensure the script is running as Administrator and that the path "%USERPROFILE%\.mitmproxy" exists,
)
echo Done! You can now open GrassClipper.exe!
pause

View File

@ -49,17 +49,18 @@ async function setBackgroundImage() {
const bgDir = await Neutralino.filesystem.readDirectory(NL_CWD + '/resources')
if (!bgDir.find(dir => dir.entry === 'bg')) {
await Neutralino.filesystem.createDirectory(NL_CWD + '/resources/bg')
await Neutralino.filesystem.createDirectory(NL_CWD + '/resources/bg/official')
}
// Copy to backgrounds folder
const bgs = (await Neutralino.filesystem.readDirectory(NL_CWD + '/resources/bg/')).filter(file => file.type === 'FILE')
const bgs = (await Neutralino.filesystem.readDirectory(NL_CWD + '/resources/bg/official/')).filter(file => file.type === 'FILE')
if (!bgs.find(file => file.entry === image)) {
await Neutralino.filesystem.copyFile(path, NL_CWD + '/resources/bg/' + image)
await Neutralino.filesystem.copyFile(path, NL_CWD + '/resources/bg/official/' + image)
}
// Set the background image
document.querySelector('#firstHalf').style.backgroundImage = `url("../bg/${image}")`
document.querySelector('#firstHalf').style.backgroundImage = `url("../bg/official/${image}")`
}
async function setGenshinImpactFolder() {