forked from netdata/netdata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basis for MSI installer. (netdata#18787)
* Import draft Wix template for creating MSI packages. * msi-wix: Add missing XML entry * msi-wix: Format lines using wixtoolset and Heatwave, also remove a wrong close * msi-wix: Reorganize code allowing it to be compiled with command 'wix build netdata.wxs' * Install event manifest and netdata service. * msi-wix: Add basis to claim agent * msi-wix: Add Icon to Control panel * msi-wix: Add Script to convert txt to rtf to be used with licenses * msi-wix: Add UI and Cloud license * msi-wix: Add file to install wix dependencies * msi-wix: Add message to last screen and a checkbox to launch terminal * Fix event manifest registration. * msi-wix: Restore removed options * msi-wix: Add basis for new windows * msi-wix: Add new dialog * msi-wix: Comment UI that was posponed and users/group not found * msi-wix: Remove UI and keep only inline installer * msi-wix: Add necessary parameter to WIX * msi-wix: Adjust code and installer * msi-wix: Fix MSI installer * msi-wix: Adjust claiming to work with different installers * msi-wix: Remove no compression and embed files to run final tests * msi-wix: Address part of permissions issues * msi-wix: Address remaining issue * msi-wix: Cleanup * msi-wix: Add current version to MSI * msi-wix: Remove unused file * msi-wix: Fix missing variable kept only in Windows host * msi-wix: Set correct permissions * msi-wix: Set correct permissions * msi-wix: Call wevtutil * msi-wix: Fix multiple entries in Control Panel * msi-wix: Rename installation directory * msi-wix: Rename name in Control Panel * msi-wix: Address comment (cleanup) * msi-wix: Address comments (Part II) * msi-wix: Address comments (Part III) * msi-wix: Fix rtf convertion * msi-wix: Remove left-over from previous installer that could be affecting current * msi-wix: Add missing directories --------- Co-authored-by: thiagoftsm <[email protected]>
- Loading branch information
1 parent
b4dfc78
commit 46cd039
Showing
9 changed files
with
866 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
set -e | ||
|
||
function txt_to_rtf() { | ||
INPUT="$1" | ||
OUTPUT="$2" | ||
|
||
echo '{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;}}' > "$OUTPUT" | ||
echo '\paperh15840 \paperw12240' >> "$OUTPUT" | ||
echo '\margl720 \margr720 \margt720 \margb720' >> "$OUTPUT" | ||
echo '\f0\fs24' >> "$OUTPUT" | ||
|
||
sed s/\$/'\\line'/ "$INPUT" | sed s/\\f/'\\page'/ >> "$OUTPUT" | ||
echo '}' >> "$OUTPUT" | ||
} | ||
|
||
if [ ! -f "gpl-3.0.txt" ]; then | ||
curl -o gpl-3.0.txt "https://www.gnu.org/licenses/gpl-3.0.txt" | ||
fi | ||
|
||
if [ ! -f "cloud.txt" ]; then | ||
curl -o cloud.txt "https://raw.githubusercontent.com/netdata/netdata/master/src/web/gui/v2/LICENSE.md" | ||
fi | ||
|
||
if [ -f "gpl-3.0.txt" ] ; then | ||
txt_to_rtf "gpl-3.0.txt" "gpl-3.0.rtf" | ||
fi | ||
|
||
if [ -f "cloud.txt" ] ; then | ||
txt_to_rtf "cloud.txt" "cloud.rtf" | ||
fi |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
wix extension -g add WixToolset.Util.wixext/5.0.2 | ||
wix extension -g add WixToolset.UI.wixext/5.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
<!-- xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui" --> | ||
<Package Name="Netdata Agent" | ||
Manufacturer="Netdata Inc." | ||
Version="@CMAKE_PROJECT_VERSION@" | ||
UpgradeCode="0d949b90-a54d-4aae-9616-e15fbc410530"> | ||
|
||
<UIRef Id="WixUI_ErrorProgressText" /> | ||
|
||
<MediaTemplate EmbedCab="yes"/> | ||
|
||
<WixVariable Id="WixUILicenseRtf" Value="cloud.rtf" /> | ||
|
||
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" /> | ||
<Icon Id="NetdataIcon.ico" SourceFile="NetdataWhite.ico"/> | ||
<Property Id="ARPPRODUCTICON" Value="NetdataIcon.ico" /> | ||
|
||
<Property Id="TOKEN" Value=" " /> | ||
<Property Id="ROOMS" Value=" " /> | ||
<Property Id="INSECURE" Value="0" /> | ||
<Property Id="PROXY" Value=" " /> | ||
<Property Id="URL" Value="https://app.netdata.cloud" /> | ||
|
||
<Feature Id="Main"> | ||
<ComponentGroupRef Id="NetdataComponents" /> | ||
<ComponentRef Id="NetdataVarCache" /> | ||
<ComponentRef Id="NetdataVarLib" /> | ||
<ComponentGroupRef Id="WevtComponents" /> | ||
<ComponentRef Id="NetdataService" /> | ||
</Feature> | ||
</Package> | ||
|
||
<Fragment> | ||
<Property Id="MsiLogging" Value="voicewarmupx!"/> | ||
|
||
<StandardDirectory Id="ProgramFiles64Folder"> | ||
<Directory Id="INSTALLFOLDER" Name="Netdata"> | ||
<Directory Id="USRDIR" Name="usr"> | ||
<Directory Id="USRBINDIR" Name="bin" /> | ||
</Directory> | ||
<Directory Id="VARDIR" Name="var"> | ||
<Directory Id="VARCACHEDIR" Name="cache" /> | ||
<Directory Id="VARLIBDIR" Name="lib" /> | ||
</Directory> | ||
</Directory> | ||
</StandardDirectory> | ||
|
||
<StandardDirectory Id="System64Folder"> | ||
</StandardDirectory> | ||
|
||
<!-- All the files except for the ones we need to handle specially --> | ||
<ComponentGroup Id="NetdataComponents" Directory="INSTALLFOLDER"> | ||
<Files Include="C:\msys64\opt\netdata\**"> | ||
<Exclude Files="C:\msys64\opt\netdata\usr\bin\netdata.exe" /> | ||
<Exclude Files="C:\msys64\opt\netdata\usr\bin\wevt_netdata_manifest.xml" /> | ||
<Exclude Files="C:\msys64\opt\netdata\usr\bin\wevt_netdata.dll" /> | ||
</Files> | ||
</ComponentGroup> | ||
|
||
<Component Id="NetdataVarCache" Directory="VARCACHEDIR" Guid="a41bc888-60d4-4d99-bb4f-da92614a8f72"> | ||
<CreateFolder /> | ||
</Component> | ||
|
||
<Component Id="NetdataVarLib" Directory="VARLIBDIR" Guid="c72d7ea8-c848-46c4-a983-589044f2eec9"> | ||
<CreateFolder /> | ||
</Component> | ||
|
||
<!-- Install wevt manifest/dll files --> | ||
<ComponentGroup Id="WevtComponents" Directory="System64Folder"> | ||
<File Id="WevtDll" Name="wevt_netdata.dll" Source="C:\msys64\opt\netdata\usr\bin\wevt_netdata.dll"> | ||
</File> | ||
|
||
<File Id="WevtManifest" Name="wevt_netdata_manifest.xml" Source="C:\msys64\opt\netdata\usr\bin\wevt_netdata_manifest.xml"> | ||
</File> | ||
</ComponentGroup> | ||
|
||
<CustomAction Id="ClaimAgent" Directory="USRBINDIR" ExeCommand='[USRBINDIR]NetdataClaim.exe /T "[TOKEN]" /R "[ROOMS]" /U "[URL]" /I [INSECURE] /P "[PROXY]" /F "[INSTALLFOLDER]etc\netdata\claim.conf"' Execute="deferred" Return="ignore" Impersonate="no"/> | ||
<InstallExecuteSequence> | ||
<Custom Action="ClaimAgent" Before="InstallFinalize" /> | ||
</InstallExecuteSequence> | ||
|
||
<CustomAction Id="WevtNetdataDLL" Directory="System64Folder" ExeCommand='[System64Folder]icacls.exe "[System64Folder]wevt_netdata.dll" /GRANT "NT SERVICE\EventLog":R' Execute="deferred" Return="ignore" Impersonate="no"/> | ||
<InstallExecuteSequence> | ||
<Custom Action="WevtNetdataDLL" Before="InstallFinalize" /> | ||
</InstallExecuteSequence> | ||
|
||
<CustomAction Id="WevtUtil" Directory="System64Folder" ExeCommand='[System64Folder]wevtutil.exe im "[System64Folder]wevt_netdata_manifest.xml" "/mf:[System64Folder]wevt_netdata.dll" "/rf:[System64Folder]wevt_netdata.dll"' Execute="deferred" Return="ignore" Impersonate="no"/> | ||
<InstallExecuteSequence> | ||
<Custom Action="WevtUtil" Before="InstallFinalize" /> | ||
</InstallExecuteSequence> | ||
|
||
<Component Id="NetdataService" Directory="USRBINDIR"> | ||
<File Id="netdata.exe" Source="C:\msys64\opt\netdata\usr\bin\netdata.exe" KeyPath="yes" /> | ||
|
||
<ServiceInstall Id="InstallService" | ||
Name="Netdata" | ||
DisplayName="Netdata Agent" | ||
Description="Netdata is distributed, real-time, performance and health monitoring for systems and applications." | ||
Type="ownProcess" | ||
Start="auto" | ||
ErrorControl="normal" /> | ||
|
||
<ServiceControl Id="ControlService" | ||
Start="install" | ||
Stop="both" | ||
Remove="uninstall" | ||
Name="Netdata" | ||
Wait="yes" /> | ||
</Component> | ||
</Fragment> | ||
</Wix> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters