0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-02 20:48:06 +00:00
netdata_netdata/packaging/windows/copy_files.ps1
Costa Tsaousis e80fdfdc20
fix MSI installer ()
* allow users to install any version; stop netdata before installing the update

* fix compatibility with wix 4

* fix-msi: Remove conflict between options (https://docs.firegiant.com/wix3/xsd/wix/majorupgrade/)

* fix-msi: Comment not allowed code. We cannot have more than one primary key listed (FileInUse)

* fix-msi: Add Power Shell script to be called after installation

* fix-msi: Copy power shell script to installer.

* fix-msi: Add option to do download and move PS file

* fix-msi: First try run at the end

* iis_ad: Fix wrong execution order and call to powershell

* fix-msi: Add messages and test to Power Shell script

---------

Co-authored-by: thiagoftsm <thiagoftsm@gmail.com>
2025-03-27 21:14:37 +02:00

42 lines
989 B
PowerShell

Function NetdataCopyConfig {
param ($dst, $src, $file)
Write-Host "Creating $file if it does not exist!"
$testDST = "$dst\$file"
$testSRC = "$src\$file"
if (-Not (Test-Path $testDST)) {
if (Test-Path $testSRC) {
robocopy /xc /xn /xo $src $dst $file
}
}
}
Function NetdataDownloadNetdataConfig {
param ($path)
Write-Host "Creating netdata.conf if it does not exist!"
$netdataConfPATH = "$path\netdata.conf"
$netdataConfURL = "http://localhost:19999/netdata.conf"
if (Test-Path $netdataConfPATH) {
exit 0
}
try {
Invoke-WebRequest $netdataConfURL -OutFile $netdataConfPATH
}
catch {
New-Item -Path "$netdataConfPATH" -ItemType File
}
}
$confPath = "C:\Program Files\Netdata\etc\netdata";
$stockStreamPath = "C:\Program Files\Netdata\usr\lib\netdata\conf.d";
NetdataCopyConfig $confPath $stockStreamPath "stream.conf"
NetdataDownloadNetdataConfig $confPath
exit 0;