3
responses

Hi Folks,

We are from a reputed service based company, We have recently tested NXLog. We are planning to deploy it more than 500 production server. We want to automate deployment process. We have below queries.

1) Is the windows setup (nxlog-ce-3.0.2272.msi) supports silent installation?
2) Can it be installed using a PowerShell script without manual intervention?

Note- If NxLog serves our purpose with better performance then we will go for enterprise edition.

Thanks
Anil

AskedFebruary 25, 2022 - 3:22pm

Answer (1)

Yes and yes.

Comments (2)

  • anilbqkumar's picture

    Thank for the confirmation.

    Can you please help me with code, how you are invoking setup installation and passing necessary parameters for silent installation using PowerShell.
    say, we need to install windows MSI setup (nxlog-ce-3.0.2272.msi) using PowerShell script

  • DR_'s picture

    Almost every MSI file can be installed silenty. There are numerous examples on the web. You don't have to do anything special with NXLog, the regular msi deployment stuff is sufficient. You need to deploy a premade configuration file though.

    Stripped down example of how I do it:

    Set-Location -Path ${PSScriptRoot}
    
    ${LOGFILE} = "output.log"
    ${SETUPFILE} = "nxlog-ce-3.0.2272.msi"
    ${CONF} = "nxlog.conf"
    ${SERVICE} = Get-Service nxlog -ErrorAction SilentlyContinue
    
    If(${SERVICE}.Status -eq "Running") {
        Stop-Service ${SERVICE}
    }
    
    ${INSTALLER} = Start-Process msiexec.exe -Wait -PassThru -ArgumentList "/i `"${SETUPFILE}`" ALLUSERS=1 /qn /norestart /l*+ `"${LOGFILE}`""
    
    ${SERVICE} = Get-Service nxlog -ErrorAction SilentlyContinue
    If(${SERVICE}.Status -eq "Running") {
        Stop-Service ${SERVICE}
    }
    
    Move-Item -Path "${Env:ProgramFiles}\nxlog\conf\${CONF}" -Destination "${Env:ProgramFiles}\nxlog\conf\${CONF}.orig" -Force
    Move-Item -Path .\"${CONF}" -Destination "${Env:ProgramFiles}\nxlog\conf\${CONF}" -Force
    
    Start-Service ${SERVICE}
    
    Exit ${INSTALLER}.ExitCode