Skip to content

Commit

Permalink
MSI service restart configuration (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym authored Oct 26, 2023
1 parent 3dd9763 commit 31b4143
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/msi/msi/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<?else?>
<?error MondooSKU must be defined as one of "standard" or "enterprise" ?>
<?endif?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Name="$(var.ProductName)" Version="$(var.ProductVersion)" Manufacturer="Mondoo, Inc." Language="1033" Codepage="1252" Id="*" UpgradeCode="$(var.UpgradeCode)">
<!-- custom action do not work if its not privileged-->
<Package
Expand Down
11 changes: 9 additions & 2 deletions packages/msi/msi/components.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SPDX-License-Identifier: BUSL-1.1
-->

<Include>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLLOCATION" Name="Mondoo" />
Expand All @@ -23,7 +23,14 @@
Description="Verifies your system for known vulnerabilities"
Start="$(var.ServiceInstallStart)"
Account="LocalSystem"
ErrorControl="normal" Arguments=" serve --config C:\ProgramData\Mondoo\mondoo.yml" Interactive="no" />
ErrorControl="normal" Arguments=" serve --config C:\ProgramData\Mondoo\mondoo.yml" Interactive="no">
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="none"
ResetPeriodInDays="1"
RestartServiceDelayInSeconds="30" />
</ServiceInstall>
<?if $(var.ServiceInstallStart) = "auto" ?>
<ServiceControl Id="StartWixServiceInstaller" Name="Mondoo" Start="install" Stop="uninstall" Wait="no" Remove="uninstall" />
<?else?>
Expand Down
2 changes: 1 addition & 1 deletion packages/msi/package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Remove-Item .\Product.wixobj -ErrorAction Ignore
Remove-Item .\mondoo.wixpdb -ErrorAction Ignore
# build package
info "run candle (standard)"
& 'C:\Program Files (x86)\WiX Toolset v3.11\bin\candle' -nologo -arch x64 -dMondooSKU="standard" -dProductVersion="$version" Product.wxs
& 'C:\Program Files (x86)\WiX Toolset v3.11\bin\candle' -nologo -arch x64 -dMondooSKU="standard" -dProductVersion="$version" -ext WixUtilExtension Product.wxs

info "run light (standard)"
& 'C:\Program Files (x86)\WiX Toolset v3.11\bin\light' -nologo -dcl:high -cultures:en-us -loc en-us.wxl -ext WixUIExtension -ext WixUtilExtension product.wixobj -o mondoo.msi
Expand Down

0 comments on commit 31b4143

Please sign in to comment.