Skip to content

Commit 7382007

Browse files
committed
refactor(): use choco for xampp
Install xampp through chocolatey.
1 parent 4730b9d commit 7382007

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

WebKitDev/Functions/Install-Xampp.ps1

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,17 @@ function Install-Xampp {
2525
[string]$version
2626
)
2727

28-
$major,$minor,$patch,$build = $version.split('.')
29-
if (-not $build) {
30-
$build = '0'
31-
}
32-
33-
if ($major -eq '7') {
34-
$toolchain = 'VC15';
35-
}
36-
else {
37-
$toolchain = 'VS16';
38-
}
39-
40-
$url = ('https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/{0}.{1}.{2}/xampp-windows-x64-{0}.{1}.{2}-{3}-{4}-installer.exe' -f ($major,$minor,$patch,$build,$toolchain));
41-
42-
$options = @(
43-
'--unattendedmodeui','none',
44-
'--mode','unattended',
45-
'--launchapps','0',
46-
'--disable-components','xampp_mysql,xampp_filezilla,xampp_mercury,xampp_tomcat,xampp_perl,xampp_phpmyadmin,xampp_webalizer,xampp_sendmail'
47-
);
48-
49-
Install-FromExe -Name 'xampp' -url $url -Options $options -noVerify;
28+
$major,$minor,$patch = $version.split('.')
29+
$name = ('xampp-{0}{1}' -f $major,$minor);
30+
31+
$installerOptions = @(
32+
'--disable-components',
33+
'xampp_mysql,xampp_filezilla,xampp_mercury,xampp_tomcat,xampp_perl,xampp_phpmyadmin,xampp_webalizer,xampp_sendmail'
34+
)
35+
36+
Install-FromChoco `
37+
-Name $name `
38+
-Version $version `
39+
-InstallerOptions $installerOptions `
40+
-noVerify;
5041
}

0 commit comments

Comments
 (0)