Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lnfel committed Oct 10, 2021
1 parent 552fa3f commit 14a1167
Showing 1 changed file with 99 additions and 8 deletions.
107 changes: 99 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Laragon Lamy
Automated setup for Laragon portable
Automated setup for Laragon portable **without dependencies**.

## How to use
1. Download or clone this repo
2. Run `laragon.bat`
3. Open the installed laragon.exe in C:\laragon
4. Install the preconfigured packages via laragon menu, **Right click > Tools > Quick Add > All**
5. Run `override1.bat` for final setup
6. Finally using laragon menu, **Click Menu > Apache > SSL > Add laragon.crt to Trust Store**

## TO DO
Everything is hard coded at the moment, and assumes the user is gonna use the default setup.
[ ] Allow user to specify where to dump winrar, laragon portable and git portable, currently using C:\Users\Administrator\Downloads\
[ ] Allow user to specify a custom packages conf file to use, currently uses the hard coded packages_conf block
[ ] Allow user to opt in using nginx instead of deleting it by default
[ ] Allow user to opt in for other text editor instead of assuming they would use sublime text
[ ] Separate the command for setting up cmder mini
[ ] Test setting up Rails on Laragon

## Defaults
- PHP 8.0.9
Expand All @@ -10,9 +27,11 @@ Automated setup for Laragon portable
- Cmder mini 1.3.18
- Git Portable

## Steps
## Manual Steps for reference

### Initial laragon setup
1. Download laragon portable, run and extract to `C:\laragon`
2. Copy and paste this whole text to `C:\laragon\usr\packages.conf` overriding it
2. Update `C:\laragon\usr\packages.conf` and include the packages needed to install by laragon
3. Download all using laragon menu, **Right click > Tools > Quick Add > All**
4. Download git portable and extract to `C:\laragon\bin\git`
- Don't forget to set up `git config --global user.name` and `git config --global user.email`
Expand All @@ -22,7 +41,7 @@ Automated setup for Laragon portable
6. Select corresponding versions for PHP, Apache, MySQL

### Setup Apache
1. Using laragon menu, **Right click > Apache > SSL > Enabled** and **Add laragon.crt to Trust Store**
1. This step is now moved as the final override step ~~Using laragon menu, **Right click > Apache > SSL > Enabled** and **Add laragon.crt to Trust Store**~~
2. Open `C:/laragon/bin/apache/httpd-2.4.48-o111k-x64-vs16/conf/httpd.conf`
- Change `Define SRVROOT "/Apache24"`
- To `Define SRVROOT "C:/laragon/bin/apache/httpd-2.4.48-o111k-x64-vs16"`
Expand Down Expand Up @@ -60,8 +79,80 @@ No need to do following steps steps since `--initialize-insecure` initializes my
4. Change keyUsage = keyEncipherment, dataEncipherment
5. To keyUsage = nonRepudiation, digitalSignature, keyEncipherment
6. Reload Apache - Laragon will generate new SAN certificate
7. Click Menu > Apache > SSL > Add laragon.crt to Trust Store
7. **Click Menu > Apache > SSL > Add laragon.crt to Trust Store**

### Replace laragon cmder with updated cmder mini
Since cmder mini is installed already via laragon package that we had customized we can just rename it.
1. Rename `C:\laragon\bin\cmder` to **cmder.bak**
2. Rename `C:\laragon\bin\cmdermini` to **cmder**
3. Copy the following from `C:\laragon\bin\cmder.bak\vendor\init.bat`

```sh
:: Laragon Start -------------------------------------------------------------------


if exist "%CMDER_ROOT%\..\git" (
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\..\git"
)

if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
echo Running Git for Windows one time Post Install....
pushd "%GIT_INSTALL_ROOT%"
call "%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat
@DEL post-install.bat

popd
:: cd /d %USERPROFILE%
rem
)

for /f "delims=" %%i in ("%CMDER_ROOT%\..\..\usr") do set USER_DIR=%%~fi
set USR_DIR=%USER_DIR%



if exist "%CMDER_ROOT%\..\laragon\laragon.cmd" (
:: call Laragon own commands
call "%CMDER_ROOT%\..\laragon\laragon.cmd"
)

if exist "%USER_DIR%\user.cmd" (
rem create this file and place your own command in there
call "%USER_DIR%\user.cmd"
) else (
echo Creating user startup file: "%USER_DIR%\user.cmd"
(
echo :: use this file to run your own startup commands
echo :: use in front of the command to prevent printing the command
echo.
echo :: call %%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd
echo :: set PATH=%%USER_DIR%%\bin\whatever;%%PATH%%
echo.
echo :: cmd /c start http://localhost
echo.
) > "%USER_DIR%\user.cmd"

:: cd /d "%CMDER_ROOT%\..\..\www"
rem
)

:: Laragon End -------------------------------------------------------------------
```
4. Then insert it into `C:\laragon\bin\cmder\vendor\init.bat` after the following lines:
```sh
:: some code at the top...

:: Set home path
if not defined HOME set "HOME=%USERPROFILE%"
%print_debug% init.bat "Env Var - HOME=%HOME%"

:: paste it here
```
5. This should make laragon detect the updated cmder mini we just installed, to test open `laragon.exe` and click on Terminal button.
webpack toast encountered an error Please make sure that the app id is set correctly.
https://stackoverflow.com/questions/64949275/npm-run-dev-not-compiling-assets-with-error-notifications-for-user-are-disabled
windows settings -> Notifications and Actions (on Windows 10)
## Known errors
- Error: webpack toast encountered an error Please make sure that the app id is set correctly.
- Solution: windows settings -> Notifications and Actions (on Windows 10)
- Source: https://stackoverflow.com/questions/64949275/npm-run-dev-not-compiling-assets-with-error-notifications-for-user-are-disabled

0 comments on commit 14a1167

Please sign in to comment.