Add Windows setup script
This PR (which now uses the correct base branch) adds a Windows-specific setup script located in dev/windows/setup.ps1 using PowerShell.
The script's actions is as follows:
- Create the variables
$phpDirand$fullPhpDir - Asks for the PHP install directory, because it isn't standardized in Windows
- Checks if the given path exists
- Checks if the PHP executable exists
- If the script was started in the
dev/windowsfolder, go to the project root - Create the variables
$composerInstallerUrland$composerInstallerPath - Downloads composer's installer using the two variables aforementioned
- Checks if composer exists after the download
- Runs composer's installer using the PHP in
$fullPhpDir - Runs the
installcommand from composer to install dependencies - Cleans up the downloaded installer
Added a whole lot of .ini validation stuff. Works with nearly all but the most extreme edge cases on my machine
Tested this as well on my Windows partition that was not set up at all to do dev work (with php installed through choco, that is lmao) and the script just works! Fantastic job!
I was going to install WAMP but the website creeped me out, so I used choco per @rubiefawn's steps. This is a really cool script.
Some issues:
- It never yelled at me to fix my
php.inifile. - I fixed it anyway but before I did I received some warnings (also screenshotted below):
Failed to download symfony/deprecation-contracts from dist: The zip extension and unzip/7z commands are both missing, skipping. The php.ini used by your command-line PHP is: C:\tools\php84\php.ini Now trying to download from source - The website still will not run, it says pear is missing (also screenshotted below):
Warning: Unknown: Failed to open stream: Permission denied in Unknown on line 0 Fatal error: Failed opening required '.\public\' (include_path='.;C:\php\pear') in Unknown on line 0
(I don't think this is relevant, but I'm running this all through x64 emulation using Prism)
I was going to install WAMP but the website creeped me out, so I used
chocoper @rubiefawn's steps. This is a really cool script.Some issues:
- It never yelled at me to fix my
php.inifile.- I fixed it anyway but before I did I received some warnings (also screenshotted below):
Failed to download symfony/deprecation-contracts from dist: The zip extension and unzip/7z commands are both missing, skipping. The php.ini used by your command-line PHP is: C:\tools\php84\php.ini Now trying to download from source- The website still will not run, it says pear is missing (also screenshotted below):
Warning: Unknown: Failed to open stream: Permission denied in Unknown on line 0 Fatal error: Failed opening required '.\public\' (include_path='.;C:\php\pear') in Unknown on line 0(I don't think this is relevant, but I'm running this all through x64 emulation using Prism)
![]()
![]()
Yeah, looks like you're missing some of the common dependencies that otherwise Composer would use.
You also possibly have permission/access restrictions that makes Composer fail reading/writing to directories.
I'll see if I can include dependency and access checks in the script
@tresf I figured out that the permission error on the second screenshot is due to PHP trying to run at its directory instead of /lmms.io's base dir due to the include_path setting being set to a fixed path instead of the current working directory, which probably is write-protected. Unfortunately, the best that I can do with this is to warn the user that PHP functions will try to access that directory instead of CWD, since changing that will probably break existing PHP installs or other PHP apps
include_path setting being set to a fixed path instead of the current working directory, which probably is write-protected.
So... Just cd to public first or will that not fix this? Furthermore, why wouldn't the include path be configurable at runtime? Is that not a thing?
Reinstalled php, deleted the repo directory, tried again. These are my results:
It never yelled at me to fix my php.ini file.
- It yelled at me this time. 👍
- I chose the option to fix the
.inifile, this worked!
I received some warnings (also screenshotted below)
- All warnings are gone.
The website still will not run
- Website runs now!