Pass management-url to msi installer. #1004

Open
opened 2025-11-20 05:21:36 -05:00 by saavagebueno · 5 comments
Owner

Originally created by @svardie on GitHub (Jun 20, 2024).

Is your feature request related to a problem? Please describe.
We struggling to autodeploy MSI installer to our Windows users with custom management-url.

Describe the solution you'd like
An option to provide management-url address to MSI packet during installation.

Originally created by @svardie on GitHub (Jun 20, 2024). **Is your feature request related to a problem? Please describe.** We struggling to autodeploy MSI installer to our Windows users with custom management-url. **Describe the solution you'd like** An option to provide management-url address to MSI packet during installation.
saavagebueno added the feature-request label 2025-11-20 05:21:36 -05:00
Author
Owner

@lixmal commented on GitHub (Jun 21, 2024):

You can populate the values in %PROGRAMDATA%/Netbird/config.json as an alternative, would that help?

@lixmal commented on GitHub (Jun 21, 2024): You can populate the values in `%PROGRAMDATA%/Netbird/config.json` as an alternative, would that help?
Author
Owner

@svardie commented on GitHub (Jun 24, 2024):

We managed to create custom msi installer with powershell script that populate needed value in config.json after installation.

@svardie commented on GitHub (Jun 24, 2024): We managed to create custom msi installer with powershell script that populate needed value in config.json after installation.
Author
Owner

@nicjohnston commented on GitHub (Oct 15, 2024):

@svardie Would you by any chance be able to share details on creating the custom installer to do this?
(I'm a linux guy that has been dropped in the deep end with windows admin and using Intune)

@nicjohnston commented on GitHub (Oct 15, 2024): @svardie Would you by any chance be able to share details on creating the custom installer to do this? (I'm a linux guy that has been dropped in the deep end with windows admin and using Intune)
Author
Owner

@svardie commented on GitHub (Oct 15, 2024):

@nicjohnston Sure. Here it is.

((Get-Content -path "C:\ProgramData\Netbird\config.json" -Raw) -replace 'api.netbird.io:443','your_custom_url') | Set-Content -Path "C:\ProgramData\Netbird\config.json"

We modified official Netbird msi installer with Advanced Installer software and stick this powershell script in it.

If you are using Microsoft Intune, then possible scenario can be to deploy official msi-packet without changing it, and then run PS script on clients via Intune. Maybe i am wrong, not worked with Intune.

Hope this will help.

@svardie commented on GitHub (Oct 15, 2024): @nicjohnston Sure. Here it is. `((Get-Content -path "C:\ProgramData\Netbird\config.json" -Raw) -replace 'api.netbird.io:443','your_custom_url') | Set-Content -Path "C:\ProgramData\Netbird\config.json"` We modified official Netbird msi installer with [Advanced Installer ](https://www.advancedinstaller.com/) software and stick this powershell script in it. If you are using Microsoft Intune, then possible scenario can be to deploy official msi-packet without changing it, and then run PS script on clients via Intune. Maybe i am wrong, not worked with Intune. Hope this will help.
Author
Owner

@itmunky commented on GitHub (Nov 15, 2024):

I used the below instead to acheive basically the same thing. It also changes the admin url too.

'# Define the path to the config file
$configFilePath = "C:\ProgramData\Netbird\config.json"

Check if the config file exists

if (Test-Path -Path $configFilePath) {
# Read the content of the config file
$configContent = Get-Content -Path $configFilePath -Raw | ConvertFrom-Json

# Check if the Host values are correct
$isUpdated = $false
if ($configContent.ManagementURL.Host -ne "<self-hosted-url>:33073") {
    $configContent.ManagementURL.Host = "<self-hosted-url>:33073"
    $isUpdated = $true
}
if ($configContent.AdminURL.Host -ne "<self-hosted-url>:443") {
    $configContent.AdminURL.Host = "<self-hosted-url>:443"
    $isUpdated = $true
}

# If updates were made, convert the updated content back to JSON format and write it back to the file
if ($isUpdated) {
    $updatedConfigContent = $configContent | ConvertTo-Json -Depth 10
    Set-Content -Path $configFilePath -Value $updatedConfigContent
    Write-Output "Config file updated successfully."
} else {
    Write-Output "Config file is already up to date."
}

} else {
Write-Output "Config file does not exist. No changes made."
}'

@itmunky commented on GitHub (Nov 15, 2024): I used the below instead to acheive basically the same thing. It also changes the admin url too. '# Define the path to the config file $configFilePath = "C:\ProgramData\Netbird\config.json" # Check if the config file exists if (Test-Path -Path $configFilePath) { # Read the content of the config file $configContent = Get-Content -Path $configFilePath -Raw | ConvertFrom-Json # Check if the Host values are correct $isUpdated = $false if ($configContent.ManagementURL.Host -ne "<self-hosted-url>:33073") { $configContent.ManagementURL.Host = "<self-hosted-url>:33073" $isUpdated = $true } if ($configContent.AdminURL.Host -ne "<self-hosted-url>:443") { $configContent.AdminURL.Host = "<self-hosted-url>:443" $isUpdated = $true } # If updates were made, convert the updated content back to JSON format and write it back to the file if ($isUpdated) { $updatedConfigContent = $configContent | ConvertTo-Json -Depth 10 Set-Content -Path $configFilePath -Value $updatedConfigContent Write-Output "Config file updated successfully." } else { Write-Output "Config file is already up to date." } } else { Write-Output "Config file does not exist. No changes made." }'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1004