/
Install-Xampp.ps1
50 lines (40 loc) · 1.41 KB
/
Install-Xampp.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) 2018, the WebKit for Windows project authors. Please see the
# AUTHORS file for details. All rights reserved. Use of this source code is
# governed by a BSD-style license that can be found in the LICENSE file.
<#
.Synopsis
Installs XAMPP.
.Description
Downloads the specified release of Ruby and installs it silently on the host.
A silent install of XAMPP does not allow a path to be specified so the install
will always be present at C:/xampp.
.Parameter Version
The version of XAMPP to install.
.Example
# Install 7.2.4.0
Install-Xampp -Version 7.2.4.0
#>
function Install-Xampp {
param(
[Parameter(Mandatory)]
[string]$version
)
$major,$minor,$patch,$build = $version.split('.')
if (-not $build) {
$build = '0'
}
if ($major -eq '7') {
$toolchain = 'VC15';
}
else {
$toolchain = 'VS16';
}
$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));
$options = @(
'--unattendedmodeui','none',
'--mode','unattended',
'--launchapps','0',
'--disable-components','xampp_mysql,xampp_filezilla,xampp_mercury,xampp_tomcat,xampp_perl,xampp_phpmyadmin,xampp_webalizer,xampp_sendmail'
);
Install-FromExe -Name 'xampp' -url $url -Options $options -noVerify;
}